Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
StaSh for Pythonista 2 and 3
-
This post is deleted! -
I guess I can start removing gittle dependancies (right after I finish the gh command, which is almost ready)
Much of gittle is superceeded by dulwich porcelain, or workarounds in my own code. I have been itching to rewrite git from scratch for a while anyway. my newfound discovery of
docopts
will make much of the CLI interface easier, the trickier bit is whether it makes more sense to update dulwich, or git. -
Guys, time for a new thread for StaSh Pythonista 3.x?
-
-
@ywangd I've just installed Stash. How do I cd to the Home directory? I'm not familiar with the iPad file system.
"Please run launch_stash.py under the Home directory to start StaSh."
-
The best way to run stash, is to click the wrench icon, then edit, then the plus sign. then find the launch_stash file.
Then, you will have a shortcut in the wrench menu that you can run anytime.
-
@cappy The
launch_stash.py
file is found in the directory when you start Pythonista, i.e.Documents
.From Pythonista's file browser (swipe to right to reveal it if not already visible), select
launch_stash.py
. This opens the file in the editor, then click the Run button (the right-facing triangle on the top right) to start StaSh.Once you know where the launch file is, you can create an editor action to access it quickly as @JonB suggested.
-
I just typed 'git' into stash and got this, looks similar to something posted in here earlier...I'm so confused.
'''
StaSh v0.4.0
[~/Documents]$ git
Opening: https://github.com/transistor1/dulwich/archive/master.zip
Save as: /private/var/mobile/Containers/Data/Application/B381FF20-8B02-43E0-870D-BCC9678441DA/tmp/dulwich.zip
8192
16384
24576
32768
40960
49152
57344
65536
73728
81920
90112
98304
106496
114688
122880
131072
139264
147456
155648
163840
172032
180224
188416
196608
204800
212992
221184
229376
237568
245760
253952
262144
270336
278528
286720
294912
303104
311296
319488
327680
335872
344064
352256
355169
stash: ImportError('No module named dulwich',): (No module named dulwich)
[~/Documents]$'''
-
@Tizzy your stash is v0.4.0 but the current version is v0.6.0.
-
@Tizzy It is recommended to install the latest version of StaSh (0.6.3). Version 0.5 and up is not compatible with 0.4 and lower. So please delete your current 0.4 installation and run the following oneliner to get the latest release:
import requests as r; exec r.get('http://bit.ly/get-stash').text
Once installed, restart Pythonista and run
launch_stash.py
underDocuments
to start. -
@ywangd , sorry I am at a total loss.its really mixed up here. About Pythonista 2/3
I do in Pythonista 3
import requests as r; exec r.get('http://bit.ly/get-stash').text
In Python 3,
I getimport requests as r; exec r.get('http://bit.ly/get-stash').text
File "<string>", line 1
import requests as r; exec r.get('http://bit.ly/get-stash').text
^
SyntaxError: invalid syntax -
The line should really be
import requests as r; exec(r.get('http://bit.ly/get-stash').text)
Note the parentheses around the argument to
exec
. In Python 2exec
was a special statement and did not require parentheses like a normal function. In Python 3exec
was changed to a normal function (just likeprint
) so now you need parentheses to call it. In Python 2exec
can also be used like in Python 3 (see the language reference for the details) so the Python 3 style is what you should use in almost all cases. -
@dgelessus , I still get an error
import requests as r; exec(r.get('http://bit.ly/get-stash').text)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<string>", line 18
print 'Downloading %s ...' % URL_ZIPFILE
^
SyntaxError: Missing parentheses in call to 'print'But I can see there is a problem with the print. But it's part of an install, not sure I can do anything about that
-
Uh @ywangd is there a different download link for the
py3
branch? -
-
@dgelessus @ywangd So it's interesting that Stash runs in its own tab, presumably on its own thread, and closing the tab kills the thread?
How do you implement this in pythonsta for other scripts? (this would solve the only being able to run a single script limitation)
ALSO, I appreciate the confirmation before downloading stuff in this version... in that last one simply typing something would try to download it.
ALSO bug report, sometimes the keyboard goes black except the top row with "tab, ~, "etc...
-
For Pythonista 3, there is a separate branch and following oneliner installs it (note it uses a different url for the py3 branch):
import requests as r; exec(r.get('http://j.mp/gsp35').text)
-
@Tizzy
StaSh uses threads to run commands users type in the terminal. The thread is killable and when StaSh UI is closing, it kills all the threads it spawned. With current version, you can already run multiple scripts with StaSh at the same time. Here is an example that a http server and client runs together. Details of the killable threads can be found in the shthreads.py file.in that last one simply typing something would try to download it.
I don't quite understand it. Do you mean that
pip
andgit
download their dependancies?ALSO bug report, sometimes the keyboard goes black except the top row with "tab, ~, "etc...
The extra key row is something I wanted to re-write since 2.0 came out. Just didn't have the time. I'll work on it when time permits.
-
@ywangd , thank you. Successfully downloaded it
-
@ywangd yes in regards to the dependencies. in the previous version it wouldn't even prompt you it just started downloading. This one it asks first. Good call.