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

      @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
                        • ywangd
                          ywangd last edited by

                          @ihf The fix is now merged into the master branch along with some other improvements. You can get the update by running selfupdate. Thanks!

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

                            @ywangd On the latest version of StaSh, I get an error message that makes it unusable:

                            Traceback (most recent call last):
                              File "/private/var/mobile/Containers/Shared/AppGroup/9BC2C58D-632D-4A13-9539-7CC3C7AA159A/Documents/launch_stash.py", line 36, in <module>
                                reload(stash)
                              File "/private/var/mobile/Containers/Shared/AppGroup/9BC2C58D-632D-4A13-9539-7CC3C7AA159A/Documents/site-packages/stash/stash.py", line 34, in <module>
                                from system.shcommon import IN_PYTHONISTA, ON_IPAD
                            ImportError: cannot import name IN_PYTHONISTA
                            
                            1 Reply Last reply Reply Quote 0
                            • disorientedp
                              disorientedp @ywangd last edited by

                              @ywangd Never mind, I stopped getting the error without changing anything

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

                                @disorientedp said:

                                @ywangd Never mind, I stopped getting the error without changing anything

                                It is likely that the old stash related modules were still cached after updating. Restart Pythonista will clear the cache and fix the problem (as indicated by the last message printed by selfupdate).

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

                                  @ywangd, I sent you a pull request for an improved version of edit. Please let me know if you don't receive or if I've erred otherwise in the process; I'm an amateur on GitHub ;-(

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

                                    @Olaf said:

                                    @ywangd, I sent you a pull request for an improved version of edit. Please let me know if you don't receive or if I've erred otherwise in the process; I'm an amateur on GitHub ;-(

                                    It is a good improvement on edit. Thanks for the pull request. It worked out very well.

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

                                      So the porting came along quicker than I expected. The py3 branch can at least start in Pythonista 3.

                                      However many commands still not working, esepcially wget which then affects pip and git. The issue is that I could not figure out how to download a zip file from GitHub using urllib3. I tried following code, but the read method always returns an empty string !!??

                                      import urllib3
                                      http = urllib3.PoolManager()
                                      r = http.request('GET', 'https://github.com/ywangd/stash/archive/master.zip')
                                      
                                      # So far so good, but then nothing can be read from the response object
                                      print(r.read())  # this gives an empty string
                                      print(r.read(999)) # empty string as well ...
                                      

                                      I tried requests as well with requests.get(ZIP_FILE_URL).raw.read(). It returns empty string as well. I guess this is not a surprise as requests is a wrapper of urllib3.

                                      Any help is appreciated.

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

                                        Try this : http://stackoverflow.com/questions/28118611/python-urllib2-returning-an-empty-string

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

                                          @Webmaster4o Thanks for the help. Unfortunately it didn't solve the issue. Still getting empty strings.

                                          The problem that I am experiencing is with urllib3 not 2. It actually worked fine with urllib2. Since urllib2 is removed from Python 3, urllib3 seems to be the logical alternative. The urllib family just seem to have so many incompatibilities between versions.

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

                                            @ywangd What was your code using requests? That's usually easier to handle ;)

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