• jsamlarose47

    Epilogue!

    A couple of questions for me to wrap this up:

    1: Just so I've got this down for future reference, should my original script have been something more like the following?

    #coding: utf-8
    import workflow
    import urllib
    import zipfile
    import shutil
    import os
    
    # get the files
    url = 'https://github.com/burnash/gspread/archive/master.zip'
    
    print "downloading..."
    urllib.urlretrieve(url, 'gspread.zip')
    
    # expand the zip
    zip_ref = zipfile.ZipFile('gspread.zip', 'r')
    zip_ref.extractall()
    zip_ref.close()
    
    # move the required folder to the appropriate location
    shutil.move(os.path.expanduser("~/Library/Application Support/Commands/gspread-master/gspread"), os.path.expanduser("~/Documents/site-packages/gspread"))
    

    Do I need to make the folder in ~/Documents/site-packages/ before I attempt to move something to it?

    2: Is it easier to do this kind of work with Pythonista (stash/pip)? And if so, are modules installed via Pythonista also available to Editorial— does Pythonista also look at ~/Documents/site-packages/ or do they function independently?

    Thanks again, all!

    posted in Editorial read more
  • jsamlarose47

    Forgive me if this has already been flagged, but I have a consistent crash in the Python code editor in Editorial when typing with a Bluetooth keyboard. Typically, when auto-completion is invoked and I arrow-key up or down (without accepting auto-completion— i.e. arrow-key to escape offered auto-completion) Editorial crashes. No crash if I arrow-key left or right. Is this known? (iOS 10.2.1, Editorial up-to-date...)

    posted in Editorial read more
  • jsamlarose47

    Done. Looks like this is the fix for me. Haven't yet fully tested a connection to a spreadsheet, but at least I'm not getting any errors when trying to call gspread modules. Excellent. Thanks!

    posted in Editorial read more
  • jsamlarose47

    @ccc Yep!
    print os.listdir("site-packages/gspread") returns:
    ['__init__.py', 'client.py', 'exceptions.py', 'gspread', 'httpsession.py', 'models.py', 'ns.py', 'urls.py', 'utils.py']

    print os.getcwd() returns:
    /private/var/mobile/Containers/Data/Application/{UUID}/Library/Application Support/Commands

    Presuming I'm in the right place there...

    @olemoritz restarted, no joy...

    And of course, the longer this continues the more I think I've just made a rudimentary error somewhere along the way... ;)

    posted in Editorial read more
  • jsamlarose47

    @ccc sorry— I realise that the way I phrased that was unclear. I meant that I have all of the files from gspread-master/gspread/ in site-packages/gspread/ (as you're saying it should be).

    Admittedly, my first use of shutil.move ended up depositing pygsheets files into the folder above site-package— the less said about that, the better... :) That said, I spent a little time tidying up my handling of paths, and I'm pretty sure I had everything in the right place before my final tests of pygsheets, and now gspread. Anything else it might be?

    Thanks for all the assistance thus far...

    posted in Editorial read more
  • jsamlarose47

    Ah— understood, and good to bear dependencies like that in mind for future reference.

    I've now got the gspread folder (contents of the folder in gspread-master) in site-packages/gspread. Still getting an import error (no module named gspread)...

    posted in Editorial read more
  • jsamlarose47

    Got it. Thanks!

    Downloaded the zip, extracted, and moved files from a folder titled "pygsheets" into "site-packages/pygsheets". Lots of fun learning my way around shutil... ;)

    Tried to import pygsheets into a workflow, but I'm getting an import error (no module of that name). Reckon I've hit a wall with my current level of Python understanding in knowing where the module is and where it needs to be for my workflow to access it...

    posted in Editorial read more
  • jsamlarose47

    Thank you. This is the point at which I declare my love for Editorial. ;)

    I've been using Editorial as a text editor and taskpaper client for a while now, but I'm just now starting to write my own workflows, so I'm starting to learn Python.

    Does this look about right?

    import workflow
    import urllib
    import zipfile
    import os
    
    url = 'https://github.com/nithinmurali/pygsheets/archive/master.zip'
    
    print "downloading..."
    urllib.urlretrieve(url, 'pygsheets.zip')
    
    zip_ref = zipfile.ZipFile('pygsheets.zip', 'r')
    zip_ref.extractall()
    zip_ref.close()
    
    os.system("pygsheets-master/setup.py")
    
    

    posted in Editorial read more
  • jsamlarose47

    Hi. I'm experimenting with logging items to a Google spreadsheet from Editorial. I'd like to play with a Google Sheets API library— either Gspread or Pygsheets, but as far as I understand it, I won't be able to install those libraries in Editorial (is that right?) so I'm wondering whether there's a way of doing that setting up the necessary modules in Pythonista and then writing an Editorial workflow that somehow calls on them? Is that even possible?

    posted in Editorial read more

Internal error.

Oops! Looks like something went wrong!