Example #1
0
def create_boa_tex(event):
    """Create the book of abstracts as a LaTeX archive.

    :return: A `BytesIO` containing the zip file.
    """
    tex = AbstractBook(event)
    return tex.generate_source_archive()
Example #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:
        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
Example #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