Beispiel #1
0
def create_boa(event):
    """Create the book of abstracts if necessary

    :return: The path to the PDF file
    """
    path = boa_settings.get(event, 'cache_path')
    if path and os.path.exists(path):
        return path
    pdf = AbstractBook(event)
    tmp_path = pdf.generate()
    path = os.path.join(Config.getInstance().getXMLCacheDir(), 'boa-{}.pdf'.format(event.id))
    shutil.move(tmp_path, path)
    boa_settings.set(event, 'cache_path', path)
    return path
Beispiel #2
0
def create_boa(event):
    """Create the book of abstracts if necessary

    :return: The path to the PDF file
    """
    path = boa_settings.get(event, 'cache_path')
    if path and os.path.exists(path):
        return path
    pdf = AbstractBook(event)
    tmp_path = pdf.generate()
    filename = 'boa-{}.pdf'.format(event.id)
    full_path = os.path.join(Config.getInstance().getXMLCacheDir(), filename)
    shutil.move(tmp_path, full_path)
    boa_settings.set(event, 'cache_path', filename)
    return full_path
Beispiel #3
0
def create_boa(event):
    """Create the book of abstracts if necessary

    :return: The path to the PDF file
    """
    path = boa_settings.get(event, 'cache_path')
    if path:
        path = os.path.join(config.CACHE_DIR, path)
        if os.path.exists(path):
            # update file mtime so it's not deleted during cache cleanup
            os.utime(path, None)
            return path
    pdf = AbstractBook(event)
    tmp_path = pdf.generate()
    filename = 'boa-{}.pdf'.format(event.id)
    full_path = os.path.join(config.CACHE_DIR, filename)
    shutil.move(tmp_path, full_path)
    boa_settings.set(event, 'cache_path', filename)
    return full_path
Beispiel #4
0
def create_boa(event):
    """Create the book of abstracts if necessary

    :return: The path to the PDF file
    """
    path = boa_settings.get(event, 'cache_path')
    if path:
        path = os.path.join(config.CACHE_DIR, path)
        if os.path.exists(path):
            # update file mtime so it's not deleted during cache cleanup
            os.utime(path, None)
            return path
    pdf = AbstractBook(event)
    tmp_path = pdf.generate()
    filename = 'boa-{}.pdf'.format(event.id)
    full_path = os.path.join(config.CACHE_DIR, filename)
    shutil.move(tmp_path, full_path)
    boa_settings.set(event, 'cache_path', filename)
    return full_path