omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    Advanced shell - shellista

    Pythonista
    16
    41
    44196
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DanG170
      DanG170 last edited by

      This is handy, thanks for sharing!

      Is there a way to get sub directories to show up in the Library view?

      1 Reply Last reply Reply Quote 0
      • pudquick51
        pudquick51 last edited by

        @DanG - if you're talking about the script list GUI in Pythonista, omz would have to add that. The script list only shows files directly inside it ending in .py.

        1 Reply Last reply Reply Quote 0
        • omz
          omz last edited by

          @DanG @pudquick The library view will also show directories in the next update (1.3).

          1 Reply Last reply Reply Quote 0
          • Cubbarooney104
            Cubbarooney104 last edited by

            Took me a few minutes to get used to it, but once I did I found it VERY useful! Now I can manage those files. :) Thank you!

            Cubbarooney

            1 Reply Last reply Reply Quote 0
            • justinclift244
              justinclift244 last edited by

              @pudquick - Thanks Michael, this is very cool. Shell prompt with no need to jailbreak. :)

              The thing I'm missing most so far is "-la" on ls. Not being able to see file ownership, permissions, size, and date, is a bit frustrating.

              But, I suppose if I get frustrated enough I'll fix it myself. :)

              1 Reply Last reply Reply Quote 0
              • pudquick51
                pudquick51 last edited by

                I'll add in the permissions bit, possibly, but considering that Pythonista on iOS can't launch a +x file / executable anyways ... I'm not sure what it is you're caring about in regards to permissions/modes.

                1 Reply Last reply Reply Quote 0
                • briarfox
                  briarfox last edited by

                  @pudquick I've been using shellista extensively for moving files around as the Pythonista move to function is rather slow when you begin to accumulate lots of projects.

                  I've extended shellista with

                  • zip
                  • gzip
                  • tar
                  • wget
                  • mail.

                  I'm working on adding multi-file gist support with gist. The prompt also now shows the current working directory. I found this to be easier when working with files. Do you have a github repository for shellista? Would you mind if I shared my extended Shellista?

                  1 Reply Last reply Reply Quote 0
                  • ihf
                    ihf last edited by

                    where can I find the latest and greatest shellista?

                    1 Reply Last reply Reply Quote 0
                    • dgelessus
                      dgelessus last edited by

                      We don't yet have a Shellista Git, do we? In that case the newest version is the gist linked in the OP.

                      By the way, there seems to be a bug when working with the file system root (/) as a path. Due to how the path handling is coded, the single slash will get rstriped away, leaving only a n empty string and causing problems. This should be easy to fix by replacing the rstrip() with os.path.normpath(), which works as expected on /.

                      1 Reply Last reply Reply Quote 0
                      • ihf
                        ihf last edited by

                        @briarfox I was looking for your extended version.

                        1 Reply Last reply Reply Quote 0
                        • transistor1
                          transistor1 last edited by

                          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.

                          1 Reply Last reply Reply Quote 0
                          • ccc
                            ccc last edited by

                            I am so happy to see that this is now a GitHub repo instead of a gist so that this community can all collaborate on making one Shellista better instead of dealing with divergent code bases.

                            1 Reply Last reply Reply Quote 0
                            • Rothrock42
                              Rothrock42 last edited by

                              What is the best way to get this into pythonista? And keep it updated? I'm pretty new to all this and have just been cutting and pasting, but I imagine there is something more efficient.

                              1 Reply Last reply Reply Quote 0
                              • briarfox
                                briarfox last edited by

                                @transistor1 Nice additions to shellista. I went with a more modular approach to shellista to make it easier to add new features. I'll need to take a look at your git functionality. I added ssh to mine so I could git from my work computer. Would You mind if I added your git as a module to ShellistaExt?

                                https://github.com/briarfox/ShellistaExt

                                ShellistaExt

                                1 Reply Last reply Reply Quote 0
                                • transistor1
                                  transistor1 last edited by

                                  @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".

                                  1. Launch your existing shellista version
                                  2. cd ~
                                  3. mkdir update (you can call this folder anything you want)
                                  4. cd update
                                  5. git clone https://github.com/transistor1/shellista.git
                                  6. cd ..
                                  7. rm shellista
                                  8. mv update shellista
                                  9. Close Pythonista and reload
                                  10. 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.

                                  1 Reply Last reply Reply Quote 0
                                  • briarfox
                                    briarfox last edited by

                                    @transistor1 I edited my above post just as you posted. Would you mind if I used your code for a git plugin?

                                    1 Reply Last reply Reply Quote 0
                                    • transistor1
                                      transistor1 last edited by

                                      @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.

                                      1 Reply Last reply Reply Quote 0
                                      • transistor1
                                        transistor1 last edited by

                                        @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.

                                        1 Reply Last reply Reply Quote 0
                                        • briarfox
                                          briarfox last edited by

                                          @transistor1 Thanks! I just broke up the cmd into separate files that automatically load into shellista, it uses a very simple template. Most of ShellistaExt is the original code just broken apart. To get by the issue of the initial load into pythonista, just create a single script that grabs the zip from the github and loads it. Take a look at the setup of shellistaExt and let me know what you think. If you'd like to move to a plugin approach I'd be more then happy to contribute. I was finding that I was adding a lot of personal projects into shellista to make it easier to access and being able to just drop in a plugin or even a whole projects like pipista was handy.

                                          Currently the plugins do not auto update but thats a great idea. I'm still working on sftp and ssh auth keys instead of just password. I'm really curious how you got the git working. I tried for a bit and gave up and just wrote the ssh client to access another computer that syncs to dropbox.

                                          1 Reply Last reply Reply Quote 0
                                          • transistor1
                                            transistor1 last edited by

                                            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.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums | Contributors