Ejemplo n.º 1
0
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()
Ejemplo n.º 2
0
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()
Ejemplo n.º 3
0
def download_csv():
    doc = {
        "key": "0AgtV5am-X0b8dG9qS21LQUNMSDNJakRFNkpvbFBGbVE",
        "file_name": "visits",
        "file_format": "csv",
        "gid": "8"
    }
    g = GoogleDoc(**doc)
    g.get_auth()
    g.get_document()
Ejemplo n.º 4
0
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()
Ejemplo n.º 5
0
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()
Ejemplo n.º 6
0
def update_data():
    doc = {
        "key": "0Ag6LtLEJqtdcdEVhT1dUbUdCWDBfcnhfc3FwanZ0OWc",
        "gid": "1",
        "file_format": "csv",
        "file_name": "guest-tracker"
    }
    g = GoogleDoc(**doc)
    g.get_auth()
    g.get_document()
Ejemplo n.º 7
0
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()
Ejemplo n.º 8
0
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()
Ejemplo n.º 9
0
def download_csv():
    doc = {
        "key": "0AgtV5am-X0b8dG9qS21LQUNMSDNJakRFNkpvbFBGbVE",
        "file_name": "visits",
        "file_format": "csv",
        "gid": "8"
    }
    g = GoogleDoc(**doc)
    g.get_auth()
    g.get_document()
Ejemplo n.º 10
0
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()
Ejemplo n.º 11
0
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()
Ejemplo n.º 12
0
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()
Ejemplo n.º 13
0
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()