swissvotes.cli

Attributes

cli

Functions

add(→ Callable[[SwissvotesRequest, SwissvotesApp], None])

Adds an instance to the database. For example:

import_attachments(→ Callable[[SwissvotesRequest, ...)

Import a attachments from the given folder. For example:

import_campaign_material(...)

Import a campaign material from the given folder. For example:

reindex_attachments(→ Callable[[SwissvotesRequest, ...)

Reindexes the attachments.

update_resources(→ Callable[[SwissvotesRequest, ...)

Updates external resources.

Module Contents

swissvotes.cli.cli[source]
swissvotes.cli.add(group_context: onegov.core.cli.core.GroupContext) Callable[[SwissvotesRequest, SwissvotesApp], None][source]

Adds an instance to the database. For example:

onegov-swissvotes --select '/onegov_swissvotes/swissvotes' add
swissvotes.cli.import_attachments(group_context: onegov.core.cli.core.GroupContext, folder: str) Callable[[SwissvotesRequest, SwissvotesApp], None][source]

Import a attachments from the given folder. For example:

onegov-swissvotes \
    --select '/onegov_swissvotes/swissvotes' \
    import-attachments data_folder

Expects a data folder structure with the first level representing an attachment and the second level a locale. The PDFs have to be named by BFS number (single number or range). For example:

data/voting_text/de_CH/001.pdf data/voting_text/de_CH/038.1.pdf data/voting_text/de_CH/622-625.pdf

swissvotes.cli.import_campaign_material(group_context: onegov.core.cli.core.GroupContext, folder: str) Callable[[SwissvotesRequest, SwissvotesApp], None][source]

Import a campaign material from the given folder. For example:

onegov-swissvotes \
    --select '/onegov_swissvotes/swissvotes' \
    import-campaign-material data_folder

Expects all files within this folder and filenames starting with the BFS number. For example:

229_Ja-PB_Argumentarium-Gründe-der-Trennung.pdf 232-1_Nein_PB_Referentenführer.pdf

swissvotes.cli.reindex_attachments(group_context: onegov.core.cli.core.GroupContext) Callable[[SwissvotesRequest, SwissvotesApp], None][source]

Reindexes the attachments.

swissvotes.cli.update_resources(group_context: onegov.core.cli.core.GroupContext, details: bool, sa: bool, mfg: bool) Callable[[SwissvotesRequest, SwissvotesApp], None][source]

Updates external resources.