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.


    StaSh for Pythonista 2 and 3

    Pythonista
    13
    61
    50845
    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.
    • ywangd
      ywangd last edited by ywangd

      StaSh v0.5.0 is formally ready for Pythonista 2.0 and it is recommended to upgrade whether you are on v0.4.x or beta 0.5.0.

      Please do NOT try to upgrade using selfupdate. Due to changes to installation structure , please run following one line command to get the latest version (it may also help to restart Pythonista before the installation).

      import requests as r; exec r.get('http://bit.ly/get-stash').text
      

      StaSh is now installed as a Python module in site-packages. To start the shell, please run launch_stash.py found in the home directory. Future upgrades can still be retrieved normally via selfupdate.

      Thanks!

      disorientedp cappy 2 Replies Last reply Reply Quote 0
      • e.warashina
        e.warashina last edited by e.warashina

        Hi,

        I'm new to Pythonista and got your StaSh just now.

        It's amazing tool for me. Thank you.

        By the way, I got stuck in the git.
        I got a error like:

        $ git status
        stash: <type 'exceptions.Exception'> Current directory isn't a git repository
        

        after I run:

        $ git init
        initialize a new Git repository
        

        git commit aslo got the same error.

        Are there any helps or hint?

        I think that I'm running StaSh v0.5.0. The git automatically installed by StaSh would came from dulwich.

        Thanks.

        append:
        I'll paste command log when I installed git.
        I tried that remove site-package directory and reinstall StaSh, Pythonista on both of iPhone and iPad.

        StaSh v0.5.0
        [~/Documents]$ ls
        Examples Welcome.md bs4test.py launch_stash.py site-packages sttest
        [~/Documents]$ cd s
        site-packages/  sttest/
        [~/Documents]$ cd sttest/
        [sttest]$ git init
        dulwich was not found.  Will attempt to download.
        Need to download dulwich.  OK to download [y/n]?y
        Opening: https://github.com/jsbain/dulwich/archive/ForStaSH_0.12.2.zip
        Save as: /private/var/mobile/Containers/Data/Application/BC3334F5-A7B9-4503-A5C0-A3E8D7A8A2DE/tmp/dulwich.zip  (400490 bytes)
              8192  [2.05%]
             16384  [4.09%]
             24576  [6.14%]
             32768  [8.18%]
             40960  [10.23%]
             49152  [12.27%]
             57344  [14.32%]
             65536  [16.36%]
             73728  [18.41%]
             81920  [20.45%]
             90112  [22.50%]
             98304  [24.55%]
            106496  [26.59%]
            114688  [28.64%]
            122880  [30.68%]
            131072  [32.73%]
            139264  [34.77%]
            147456  [36.82%]
            155648  [38.86%]
            163840  [40.91%]
            172032  [42.96%]
            180224  [45.00%]
            188416  [47.05%]
            196608  [49.09%]
            204800  [51.14%]
            212992  [53.18%]
            221184  [55.23%]
            229376  [57.27%]
            237568  [59.32%]
            245760  [61.36%]
            253952  [63.41%]
            262144  [65.46%]
            270336  [67.50%]
            278528  [69.55%]
            286720  [71.59%]
            294912  [73.64%]
            303104  [75.68%]
            311296  [77.73%]
            319488  [79.77%]
            327680  [81.82%]
            335872  [83.87%]
            344064  [85.91%]
            352256  [87.96%]
            360448  [90.00%]
            368640  [92.05%]
            376832  [94.09%]
            385024  [96.14%]
            393216  [98.18%]
            400490  [100.00%]
        /private/var/mobile/Containers/Shared/AppGroup/C2262ABC-29FF-4015-8027-57D05D396DD5/Documents/site-packages/stash/lib/dulwich.old: does not exist
        mv: /private/var/mobile/Containers/Shared/AppGroup/C2262ABC-29FF-4015-8027-57D05D396DD5/Documents/site-packages/stash/lib/dulwich: no such file or directory
        /private/var/mobile/Containers/Shared/AppGroup/C2262ABC-29FF-4015-8027-57D05D396DD5/Documents/site-packages/stash/lib/dulwich.old: does not exist
        Still could not import dulwich.
                    Perhaps your network connection was unavailable.
                    You might also try deleting any existing dulwich versions in site-packages or elsewhere, then restarting pythonista.
        Opening: https://github.com/jsbain/gittle/archive/master.zip
        Save as: /private/var/mobile/Containers/Data/Application/BC3334F5-A7B9-4503-A5C0-A3E8D7A8A2DE/tmp/gittle.zip  (28334 bytes)
              8192  [28.91%]
             16384  [57.82%]
             24576  [86.74%]
             28334  [100.00%]
        Opening: https://github.com/FriendCode/funky/archive/master.zip
        Save as: /private/var/mobile/Containers/Data/Application/BC3334F5-A7B9-4503-A5C0-A3E8D7A8A2DE/tmp/funky.zip  (8474 bytes)
              8192  [96.67%]
              8474  [100.00%]
        initialize a new Git repository
        [sttest]$
        
        1 Reply Last reply Reply Quote 0
        • ccc
          ccc last edited by

          See https://forum.omz-software.com/topic/2515/using-git-inside-stash

          1 Reply Last reply Reply Quote 1
          • ywangd
            ywangd last edited by

            @e-warashina I am glad that you find StaSh useful.

            @JonB is the author of the git tool. I am sure he will be able to share more information on this issue. But here is my take on it:

            • git init requires a path parameter. For an example, if you need initialise the current working directory, you need to run git init .

            • The directory is now initialised. If you type ls -a , you'll be able to see a new .git folder created.

            • Now if you type git status, an error will be generated reporting 'HEAD' is not found. This is expected as there is currently no commit in the repo. I do think the error message can be formatted in a more user-friendly way (a possible future improvement).

            • You can now add a file to the repo via git add SOME_FILE and them commit by git commit.

            • Now if you run git status again, it will correctly show the status.

            Hope this helps.

            e.warashina 1 Reply Last reply Reply Quote 1
            • e.warashina
              e.warashina @ywangd last edited by

              @ccc,
              @ywangd Thank you for your advice.

              It works very well.
              So, I missed any git init's path parameter as you noticed!

              After run git init ., everything went like clockwork.

              I love this tool so much. And, I'm very impressed your support.
              I say thank you again.

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

                Ran the one liner, restarted Pythonista, ran launch_stash.py. Pythonista crashes (returns to home screen) after 1 sec. Then I tried deleting stash and trying again. It gets as far as "Preparing the folder structure..."

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

                  @ihf said:

                  Ran the one liner, restarted Pythonista, ran launch_stash.py. Pythonista crashes (returns to home screen) after 1 sec. Then I tried deleting stash and trying again. It gets as far as "Preparing the folder structure..."

                  What is your device and iOS version? Is it jailbroken? It worked for me on three different devices:

                  • iPhone 6+ with iOS 9.2
                  • iPad Air 2 with iOS 9.2
                  • iPad mini 1 with iOS 9.1 (32-bit)

                  I don't quite get why it stuck at the installation script as it performs only pure and simple Python calls.

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

                    @ywangd Ipad3, JB, IOS 8.1.2. I don't understand either, I'm just reporting what I see.

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

                      @ywangd ran the one liner again and it ended this time with Installation completed but when I run launch_stash it still crashes immediately.

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

                        @ihf said:

                        @ywangd Ipad3, JB, IOS 8.1.2. I don't understand either, I'm just reporting what I see.

                        Thanks for the report. It is very likely that the crash is related to JB. Since I don't have a Jailbroken device, I cannot do any further tests. Anyway, I guess with a JB device, you can leverage the real BSD shell and a pretending shell like stash is of little use.

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

                          @ihf Here are two possible alternatives:

                          • Continue to use v0.4.x
                          • I plan to make the usage of attributed texts optional (i.e. no font color and style). Maybe this would help JB devices.
                          ihf 1 Reply Last reply Reply Quote 0
                          • JonB
                            JonB last edited by

                            I am using stash on ipad3 ios 8.4.1. I seem to remember a few issues with objc that were fixed with later ios versions, but i forget which.

                            I will say that we have found an issue related to cursor setting using the new attributed text functions on 32 bit devices. This could be related.

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

                              @ywangd Please let me know if/when there is a version (other than v0.4.x) that I might try. Once one uses Stash with Pythonista it is hard to go back :-)

                              ywangd 1 Reply Last reply Reply Quote 0
                              • JonB
                                JonB last edited by

                                the ios8crash branch seems to solve the specific problems i was having. modify getstash.py to list the ios8crash instead of master, then restart pythonista.

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

                                  @ihf said:

                                  @ywangd Please let me know if/when there is a version (other than v0.4.x) that I might try. Once one uses Stash with Pythonista it is hard to go back :-)

                                  @JonB and I worked out two solutions for an iOS8 related crash issue.

                                  You can get them with following one-liner installers.

                                  1. ios8crash
                                  import urllib2; exec urllib2.urlopen('http://bit.ly/get-stash').read() in {'_br': 'ios8crash'}
                                  
                                  1. iso8crash2
                                  import urllib2; exec urllib2.urlopen('http://bit.ly/get-stash').read() in {'_br': 'ios8crash2'}
                                  

                                  Please let me know how they work for you. Thanks!

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

                                    @ywangd I only tried the first solution and it worked!. Thank you very much!

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

                                      @ywangd Will I be able to use selfupdate in the future or will I then lose the ios8 fix?

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

                                        @ihf If nothing has changed you should be able to do something like SELFUPDATE_BRANCH=ios8fix selfupdate (this is a single command in one line) to update from a branch that isn't master.

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

                                          @dgelessus I just noticed that the leading environmental variable NO longer works for the new selfupdate.py. It used to work with selfupdate.sh. I'll need to fix it later.

                                          As an alternative, you can still update to a specific branch by just typing selfupdate.py BRANCH

                                          @ihf Great the first fix worked for you. Could you please also give the 2nd fix a try? I currently prefer the 2nd fix as it is much simpler. The fix will stay in the main branch once it is finalised. This means you can simply selfupdate to get any future updates.

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

                                            @ywangd Unfortunately, ios8crash2 does not fix the problem (it crashes as before). Ios8crash works fine.

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