Static site

Todo

Doctrings (module, utilities)

Models

class indico.modules.events.static.models.static.StaticSite(**kwargs)

Static site for an Indico event.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

add_file_date_column = False

Whether to track the creation time. This is required when using versioning!

content_type

The MIME type of the file.

created_dt = None
creator

The user who created the static site

creator_id

ID of the user who created the static site

event

The Event this static site is associated with

event_id

ID of the event

extension

The extension of the file.

file_required = False

Whether a row must always contain a file

filename

The name of the file.

id

Entry ID

property locator
md5

An MD5 hash of the file.

Automatically assigned when save() is called.

requested_dt

The date and time the static site was requested

size

The size of the file (in bytes).

Automatically assigned when save() is called.

state

The state of the static site (a StaticSiteState member)

storage_backend
storage_file_id
class indico.modules.events.static.models.static.StaticSiteState(value)

An enumeration.

expired = 4
failed = 3
pending = 0
running = 1
success = 2

Utilities

class indico.modules.events.static.util.RewrittenManifest(manifest)

A manifest that rewrites its asset paths.

Initialize manifest.

indico.modules.events.static.util.collect_static_files()

Keep track of URLs used by manifest and url_for.

indico.modules.events.static.util.override_request_endpoint(endpoint)
indico.modules.events.static.util.rewrite_css_urls(event, css)

Rewrite CSS in order to handle url(…) properly.

indico.modules.events.static.util.rewrite_static_url(path)

Remove __vxxx prefix from static URLs.

indico.modules.events.static.util.url_to_static_filename(endpoint, url)

Handle special endpoint/URLs so that they link to offline content.