-
transistor1
@Rothrock42 - You are welcome! I'm really glad it's helpful.
When I tried your scenario, I got a "no such file or directory" error. Is that what you got?
Opened a ticket <a href='https://github.com/transistor1/shellista/issues/9'>here</a>. Will try to take a look at this later tonight (Eastern Standard time)... Right now I am slacking on other things I'm supposed to be doing!
@JonB - that is good to know, thanks!
-
transistor1
@briarfox - thanks! I think your modular method is brilliant, and your code and directory structure is very clean. It is implemented just like a "real" shell, in that commands are individual programs - that's how it should be IMHO. I really feel like the way you implemented it is the smart way to go. If you really want to contribute to my repo, create a branch, and make it more like that :).
What I envisioned was somehow taking advantage of the already existing functionality in setuptools to download the plugins and modules -- not sure if this is possible or not. I was going to fork your repo and play around with that when I had a chance. Python isn't my primary language (we are all Microsoft at work), so I'm sure I don't do things the most "Pythonic" way. Suggestions are most definitely welcome.
Regarding installation in site-packages: what do you think the policy should be if the user has that package already in their site-packages? I'm a little worried about overwriting a user's own modules. I keep shellista in a separate subfolder of
~
, so that all the dependencies download there; almost like a hackish virtualenv. -
transistor1
I think the modular approach is the way to go -- I would be grateful for contributions... after seeing what you've done, I think you should really have the 'official' github repo of Shellista. If that doesn't work out, I've added you as a collaborator to my repo, so have at it!
My only desire would be to add that script that grabs the zip directly into the ShellExt.py file... I know it probably uglifies things a bit, but it would be important for a nice user experience for people new to Shellista/Pythonista. I just got Pythonista a few days ago, and I think I might have been scratching my head a bit wondering how to get all those files in there without Git built in... the original Shellista was a simple copy-paste job (you are right-- it's a simple script, but I'm a little absent minded-- that probably wouldn't have been my first thought! :) )
I found a pure Python implementation of Git called <a href='http://www.samba.org/~jelmer/dulwich/docs/'>Dulwich</a>. There is also a wrapper to that called <a href='https://pypi.python.org/pypi/gittle/0.3.0'>Gittle</a>... I used both of them. Everything except the
git push
was very simple. With that, I was having all sorts of issues with the authentication. I believe this is because of versioning of Gittle/Dulwich... they seem to be out of sync. I was not able to pair the correct versions, so I ended up writing a monkeypatch for Gittle's push_to() method, which worked in the end. Not ideal at all, but it practically speaking, it works for now. -
transistor1
@briarfox - I like your version a lot! If I had seen this a couple of days earlier I would have written my add-ins for your version. If the core module had a way of downloading the plugins, that would be ideal for new users -- they could just paste the core file into Pythonista and then it would bootstrap the plugins.
-
transistor1
@briarfox - please be my guest ... all of this code is under the MIT license so it's all fair game! The modular approach sounds like a great idea! I was trying to maintain the original single-file approach to make it easy to paste into Pythonista-- but I thought about making it more modular too, because it's getting big.
My mods to shellista download the Git/pipista dependencies automatically using @mark_tully's wget... I thought that a modular approach might work well if it automatically downloaded its plugins too. Does your version do that? That would be awesome.
-
transistor1
@Rothrock42 - Pasting is probably the quickest way to get started. I have a "shellista" subfolder & I am keeping everything in there.
If you are using <a href='https://github.com/transistor1/shellista'>this version</a>, you can stay synced with this repo using
git clone
:This assumes you're storing shellista in a subfolder of your home folder called "shellista".
- Launch your existing shellista version
cd ~
mkdir update
(you can call this folder anything you want)cd update
git clone https://github.com/transistor1/shellista.git
cd ..
rm shellista
mv update shellista
- Close Pythonista and reload
- Open shellista and run it. It will re-download all the dependencies.
Time willing, I'd like to add a
git pull
command to pull the latest updates. -
transistor1
Thanks @pudquick for the awesome shellista module.
I added pipista integration and basic Git integration into shellista: https://github.com/transistor1/shellista
- Integrate minimal pipista functionality
- pdown - PyPi download
- psrch - PyPi search
- Minimal Git functionality
- git init - Initialize git repo
- git add - Stage one or more files
- git commit - Commit staged files
- git clone - clone a public repo (no auth)
- git push - push commits via web
- git modified - see which files are currently modified
- git log - doesn't currently work
- untgz - a convenience wrapper to untar and ungzip at the same time
- Also ripped @mark_tully's wget - thanks Mark!
- Simple Python sub-shell by typing 'shell', 'python', or '!'
- Running a file directly doesn't work (e.g. 'python somefile.py'), though I tried
- Single-line commands only
It should automatically download all the needed requirements. It uses Gittle with Dulwich to manage the Git functionality. Contributions welcome!
I pushed the code directly to GitHub from my iPad with the git extensions.
- Integrate minimal pipista functionality