def update(): """ Downloads a Google Doc as an Excel file. """ if app_config.COPY_GOOGLE_DOC_URL == None: print colored( 'You have set COPY_GOOGLE_DOC_URL to None. If you want to use a Google Sheet, set COPY_GOOGLE_DOC_URL to the URL of your sheet in app_config.py', 'blue') return else: doc = {} url = app_config.COPY_GOOGLE_DOC_URL if 'key' in url: bits = url.split('key=') bits = bits[1].split('&') doc['key'] = bits[0] else: bits = url.split('/d/') bits = bits[1].split('/') doc['key'] = bits[0] g = GoogleDoc(**doc) g.get_auth() g.get_document()
def download_copy(): """ Downloads a Google Doc as an .xls file. """ doc = {} doc['key'] = app_config.COPY_GOOGLE_DOC_KEY g = GoogleDoc(**doc) g.get_auth() g.get_document()
def update(): """ Downloads a Google Doc as an Excel file. """ doc = {} doc['key'] = app_config.COPY_GOOGLE_DOC_KEY g = GoogleDoc(**doc) g.get_auth() g.get_document()
def download_csv(): doc = { "key": "0AgtV5am-X0b8dG9qS21LQUNMSDNJakRFNkpvbFBGbVE", "file_name": "visits", "file_format": "csv", "gid": "8" } g = GoogleDoc(**doc) g.get_auth() g.get_document()
def update(): """ Downloads a Google Doc as an Excel file. """ if app_config.COPY_GOOGLE_DOC_KEY == None: print colored( 'You have set COPY_GOOGLE_DOC_KEY to None. If you want to use a Google Sheet, set COPY_GOOGLE_DOC_KEY to the key of your sheet in app_config.py', 'blue') return else: g = GoogleDoc(key=app_config.COPY_GOOGLE_DOC_KEY) g.get_auth() g.get_document()
def update(): """ Downloads a Google Doc as an Excel file. """ doc = {} url = app_config.COPY_GOOGLE_DOC_URL bits = url.split('key=') bits = bits[1].split('&') doc['key'] = bits[0] g = GoogleDoc(**doc) g.get_auth() g.get_document()
def download_copy(slug): """ Downloads a Google Doc as an .xlsx file. """ graphic_path = '%s/%s' % (app_config.GRAPHICS_PATH, slug) graphic_config = imp.load_source('graphic_config', '%s/graphic_config.py' % graphic_path) doc = {} doc['key'] = graphic_config.COPY_GOOGLE_DOC_KEY doc['file_name'] = slug g = GoogleDoc(**doc) g.get_auth() g.get_document()
def update(): """ Downloads a Google Doc as an Excel file. """ if app_config.COPY_GOOGLE_DOC_URL == None: print colored('You have set COPY_GOOGLE_DOC_URL to None. If you want to use a Google Sheet, set COPY_GOOGLE_DOC_URL to the URL of your sheet in app_config.py', 'blue') return else: doc = {} url = app_config.COPY_GOOGLE_DOC_URL bits = url.split('key=') bits = bits[1].split('&') doc['key'] = bits[0] g = GoogleDoc(**doc) g.get_auth() g.get_document()