Yet another reason why I'd like to get lxml
included in the next release of Pythonista!
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.
Best posts made by roosterboy
-
RE: BeautifulSoup XML
Latest posts made by roosterboy
-
RE: dropbox login
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 thetry
block ofget_hints()
and got a different error: Error opening hints file [401] 'Invalid signature.' -
dropbox login
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?
-
RE: MultiMarkdown in Editorial
Ah, I do see here than "inline" footnotes are also allowed by MultiMarkdown. Mea culpa.
-
RE: MultiMarkdown in Editorial
"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.
-
RE: BeautifulSoup XML
Yet another reason why I'd like to get
lxml
included in the next release of Pythonista! -
RE: Wish list for next release
I'll second
lxml
, since without that module it's rather difficult (or it has been in my admittedly somewhat limited experience) to getpython-docx
andpython-xlsx
to work and those would be useful to have in Pythonista. -
RE: MPMediaQuery not found?
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.
-
MPMediaQuery not found?
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
-
RE: Welcome to the new forum!
OK, definitely never noticed that. It's a little awkward that it requires you to make a second action to jump to that spot rather than automatically taking you there like most other forum software I've ever used, but I suppose it'll work.