xonsh / slug Goto Github PK
View Code? Open in Web Editor NEWA snail without its shell
License: BSD 3-Clause "New" or "Revised" License
A snail without its shell
License: BSD 3-Clause "New" or "Revised" License
Now that PyPy3.5 is released, PyPy support should be added.
Note that I think there's a few places where we rely on specific CPython behaviors, so some work might be needed.
Implement support for "processes" that are python classes.
Keeping a PTY in sync with the terminal we're attached to.
https://github.com/asciinema/asciinema/blob/master/asciinema/pty_recorder.py
Expand CI to cover Windows Subsystem for Linux (aka Bash on Windows, Ubuntu on Windows).
Support some kind of callback system when process and process group states chage.
ProcessGroup.join()
ignores descendant processes (not direct children).
wait*()
family of functions support PGIDsWaitForSingleObject()
will cover this? Language implies this only happens when job exceeds resource limits, not when it exits naturally.We have a lot of singletons. Most of them get lumped on to builtins
, which is ugly and hackish and they have to all be initialized carefully and at once.
Dependency injection would allow us to delay some initialization, clean up namespaces, and make sure that concerns are where they belong.
Add adaptors to go between purely virtual file-like objects and concrete types with file descriptors.
hi @AstraLuma ! Please add xonsh-dev
topic to this repo to make it more visible in the list https://github.com/topics/xonsh-dev
When a process aborts (ie, ends without setting a numeric return code), what should Process.return_code
return?
Negative number matching the signal number?
String of the signal name?
Special object?
Add Pipes that go between text and binary, or are just text on both sides.
Implement against by-the-spec POSIX.
Currently, it's left up entirely to the calling application to track a VirtualProcess
's current group and making sure any executions it makes get joined to the group.
Implementing this will also likely run afoul of #23.
If you start the individual processes in a process group, the process group is not initialized correctly, causing the processes to not properly join the group nor the group created.
with ProcessGroup() as pg:
pipe = Pipe()
spam = Process(['spam'], stdout=pipe.side_in)
pg.add(spam)
eggs = Process(['eggs'], stdin=pipe.side_out)
pg.add(spam)
spam.start()
eggs.start()
eggs.join()
pg.kill()
pg.join()
Implement Windows support.
Process
(POSIX version) should somehow cache pgid
so it's still available after the process exits.
This is the code in current readme:
with ProcessGroup() as pg:
pipe = mkpipe()
spam = pg.process(['spam'], stdin=StdIn(), stdout=pipe.side_in, stderr=StdErr(), environ=...)
eggs = pg.process(['eggs'], stdin=pipe.side_out, stdout=StdOut(), stderr=StdErr(), environ=...)
pg.start()
pg.join()
The last two line looks a bit weird. I mean it's valid but I'd like keep the pg
only used inside the with
block - make pg.start()
, pg.join()
implemented inside the context manager itself?
Both Valve
and QuickConnect
need extremely special windows implementations.
.read()
will only break on an actual triggered interrupt, not just a faked exception through PyThreadState_SetAsyncExc()
.So I think we need to use win32's ReadFile()
manually in conjunction with CancelSynchronousIo()
in order to not read an extra block when switching.
Expand CI configurations to also test on cygwin.
Content of file test_slug.py
:
from slug import Process, ProcessGroup, Pipe
with ProcessGroup() as pg:
pipe = Pipe()
spam = pg.add(Process(['ls'], stdout=pipe.side_in))
eggs = pg.add(Process(['wc'], stdin=pipe.side_out))
pg.start()
pg.join()
Run py test_slug.py
, on Linux, it will stuck. On Mac this issue shows:
$ py test_slug.py
Traceback (most recent call last):
File "test_slug.py", line 8, in <module>
pg.start()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/xonsh_slug-0.0.1-py3.6.egg/slug/posix.py", line 91, in start
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/xonsh_slug-0.0.1-py3.6.egg/slug/posix.py", line 63, in pgid
ProcessLookupError: [Errno 3] No such process
71 72 750
Currently, Tee
, Valve
, and QuickConnect
clean up when their source pipe hits EOF. Add a method to manually clean up.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.