Giter Club home page Giter Club logo

Comments (7)

amitkot avatar amitkot commented on May 30, 2024 1

@anki-code Is there a "debug" flag I can run with to see why it freezes?

from xontrib-pipeliner.

anki-code avatar anki-code commented on May 30, 2024

This looks like a known issue - https://github.com/anki-code/xontrib-pipeliner#ppl-on-macos-multicore-pipelining-freezes-on-end

from xontrib-pipeliner.

anki-code avatar anki-code commented on May 30, 2024

You can use pl instead of ppl on mac.

from xontrib-pipeliner.

amitkot avatar amitkot commented on May 30, 2024

Sadly these do not work as well:

> echo 1 | pl 'line'
> echo 1 | pl 'line' | cat

from xontrib-pipeliner.

amitkot avatar amitkot commented on May 30, 2024

@anki-code I really like this idea, but this does not work for me. Any idea how to make it work?

from xontrib-pipeliner.

anki-code avatar anki-code commented on May 30, 2024

May be this is also related to $XONSH_CAPTURE_ALWAYS.
Try to set $XONSH_CAPTURE_ALWAYS = True before usage.

from xontrib-pipeliner.

anki-code avatar anki-code commented on May 30, 2024

@amitkot pl is a callable alias:

def _pl(args, stdin, stdout):
err = False
if len(args) == 0:
print('Error: Python code not found', file=sys.stderr)
err = True
if err:
print('Usage: <command> | <command> | ... | pl "<Python code>"', file=sys.stderr)
print('Example: echo "123" | pl "line[::-1]"', file=sys.stderr)
return
fn = eval('lambda line, num:'+args[0], __xonsh__.ctx)
if stdin is None:
try:
print(fn(None, 0))
except:
print_color('{YELLOW}' + str(traceback.format_exc()), file=sys.stderr)
return
num = 0
for line in stdin.readlines():
try:
res = fn(line.rstrip(os.linesep), num)
except:
print_color('{YELLOW}' + f'Error line {num+1}: {line}', file=sys.stderr)
print_color('{YELLOW}' + str(traceback.format_exc()), file=sys.stderr)
return
num += 1
if res is not None:
print(res, file=stdout, flush=True)

So as a good start you can just debug this function on mac.

from xontrib-pipeliner.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.