• roosterboy

    Sorry about not including any code.

    I'm using this gist that has worked with another script for several years. In that script, I upload a plist file to dropbox. I use it a couple times a week and it works without a hitch.

    But this new script, that downloads a text file, isn't working at all and gives me the errors mentioned in the first post. And, weirdly, the comments on that gist indicate the same errors for those users. Yet, this code has worked for me with my other script.

    Here is my code that calls that gist dropbox login code:

    import dropboxloginv2 as dropboxlogin
    import console
    from dropbox import rest
    
    dropboxlogin.app_key = '...'  #with my app_key
    dropboxlogin.app_secret = '...'   #with my app_secret
    DBX = dropboxlogin.get_client()
    
    AUTOTAG_PATH = '/github/scripts/python/autotag_hints.txt'
    
    def get_hints():
       try:
           md, res = DBX.files_download(AUTOTAG_PATH)
       except rest.ErrorResponse as e:
           console.alert('Error opening hints file', message='{}\n'.format(e))
           return None
       data = res.content
       for line in data:
           (ptn, tags) = line.split(' :: ')
           hints[ptn] = tags.split(' ')
       return hints
    
    def main():
       autotag_hints = get_hints()
       print(autotag_hints)
    
    if __name__ == '__main__':
       main()
    

    I tried moving the line DBX = dropboxlogin.get_client() inside the try block of get_hints() and got a different error: Error opening hints file [401] 'Invalid signature.'

    posted in Pythonista read more
  • roosterboy

    I've been away from using Pythonista for a while but now have need to write a script that reads the contents of a text file in my Dropbox. I'm having a heck of a time getting this to work.

    I've set up my app in the Dropbox settings, I've got my key and secret, I get through the authorization up until the point where I have to enter a code. I pasted the given code into the console but I get back Error: 400 Client Error: Bad Request for url: https://www.dropbox.com/1/oauth2/token and object of type 'NoneType' has no len()

    Can anyone explain to me how to get this working?

    posted in Pythonista read more
  • roosterboy

    I've found that when that happens I have to clear posts by category—like Pythonista or Editorial or General Discussion—rather than by All. And sometimes you have to do multiple categories in order to get rid of them all. Very annoying.

    posted in General Discussion read more
  • roosterboy

    Ah, I do see here than "inline" footnotes are also allowed by MultiMarkdown. Mea culpa.

    posted in Editorial read more
  • roosterboy

    "a rather cumbersome format"

    According to the MMD syntax guide, that's the official format. An identifier goes inline in your text and the actual text of the note goes at the end.

    posted in Editorial read more
  • roosterboy

    Yet another reason why I'd like to get lxml included in the next release of Pythonista!

    posted in Pythonista read more
  • roosterboy

    I'll second lxml, since without that module it's rather difficult (or it has been in my admittedly somewhat limited experience) to get python-docx and python-xlsx to work and those would be useful to have in Pythonista.

    posted in Pythonista read more
  • roosterboy

    That did the trick. Thanks!

    posted in Pythonista read more
  • roosterboy

    Oops, sorry, meant to include that info but forgot.

    This happens on my iPhone 5S and my iPad Air 2, both running iOS 9.2.

    posted in Pythonista read more
  • roosterboy

    Playing around with the new version of Pythonista, I tried out the ObjC example script Music Stats.py. But when I run that script, I get an error:

    Value Error: no Objective-C class named 'MPMediaQuery' found

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!