metov / openeditor Goto Github PK
View Code? Open in Web Editor NEWEdit files with your $EDITOR, like git commit does.
License: MIT License
Edit files with your $EDITOR, like git commit does.
License: MIT License
Running the following:
python -c "import openeditor; print(openeditor.edit_file())"
Results in IsADirectoryError
. The problem is line
Line 34 in aae3cd3
tfpath = Path(td.name) / (name or "tempfile")
but the actual behavior is tfpath = (Path(td.name) / name) or "tempfile"
.The following works:
VISUAL="vim" python -c "import openeditor; print(openeditor.edit_temp('contents', 'myfile'))"
The following doesn't:
VISUAL="vim -n" python -c "import openeditor; print(openeditor.edit_temp('contents', 'myfile'))"
Instead we get FileNotFoundError: [Errno 2] No such file or directory: 'vim -n'
This issue is particularly a problem on OS X, where often subl -w
(Sublime Text with the wait argument) is the preferred command. The problem is likely because https://github.com/metov/openeditor/blob/master/openeditor/lib.py#L20 expects the arguments to be chopped up, but we are doing the equivalent of subprocess.call(["vim -n", filepath], close_fds=True)
.
The following succeeds:
python -c "import openeditor; print(openeditor.edit_temp(contents='hello'))"
but this gives FileNotFoundError:
python -c "import openeditor; print(openeditor.edit_temp())"
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.