org.cli

Provides commands used to initialize org websites.

Attributes

cli

Functions

add(...)

Adds an org with the given name to the database. For example:

import_digirez(...)

Imports a Digirez reservation database into onegov.org.

fix_tags(...)

close_ticket(→ None)

fetch(...)

Fetches events from other instances.

fix_directory_files(...)

Not sure of this doubles the files, but actually the file

migrate_town(...)

Migrates the database from an old town to the new town like in the

migrate_links_cli(...)

Migrates url's in pages. Supports domains and full urls. Most of

migrate_publications(...)

Marks signed files for publication.

delete_invisible_links(...)

Deletes all the data associated with a period, including:

get_resources_and_forms(...)

Get the resources and forms from the option file.

import_reservations(...)

Imports reservations from a Excel file (needs to be .xlsx).

mtan_statistics(...)

Generate mTAN SMS statistics for the given year and month.

ul(→ str)

ol(→ str)

li(→ str)

p(→ str)

b(→ str)

em(→ str)

br(→ str)

a(→ str)

h(→ str)

img(→ str)

import_news(...)

Imports news from archive of json files

content_to_markup(→ str)

import_meetings(...)

Imports meetings from archive of json files

import_commissions(...)

Imports commissions from archive of json files

import_parliamentary_groups(...)

Imports parliamentary_groups from archive of json files

handle_es_connection_error(...)

import_political_business(...)

Imports political_businesses from archive of json files

import_parliamentarians(...)

Imports parliamentarians from archive of json files

create_memberships(...)

Creates Commission Memberships

create_polical_business_participants(...)

Creates Political Business Participants

create_parliamentarian_roles(...)

Creates Parliamentarian Roles

connect_political_business_meeting_items(...)

Connects Political Business and Meeting Items

Module Contents

org.cli.cli[source]
org.cli.add(group_context: onegov.core.cli.core.GroupContext, name: str, locale: str) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Adds an org with the given name to the database. For example:

onegov-org --select '/onegov_org/evilcorp' add "Evilcorp"
org.cli.import_digirez(accessdb: str, min_date: str, ignore_booking_conflicts: bool) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Imports a Digirez reservation database into onegov.org.

Example: .. code-block:: bash

onegov-org –select ‘/orgs/govikon’ import-digirez room_booking.mdb

org.cli.fix_tags(group_context: onegov.core.cli.core.GroupContext, dry_run: bool) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]
org.cli.close_ticket(ticket: onegov.ticket.Ticket, user: onegov.user.User, request: onegov.org.request.OrgRequest) None[source]
org.cli.fetch(group_context: onegov.core.cli.core.GroupContext, source: collections.abc.Sequence[str], tag: collections.abc.Sequence[str], location: collections.abc.Sequence[str], create_tickets: bool, state_transfers: collections.abc.Sequence[str], published_only: bool, delete_orphaned_tickets: bool) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Fetches events from other instances.

Only fetches events from the same namespace which have not been imported themselves.

Example .. code-block:: bash

onegov-org –select ‘/veranstaltungen/zug’ fetch

–source menzingen –source steinhausen –tag Sport –tag Konzert –location Zug

Additional parameters:

  • --state-transfers published:withdrawn

    Will update the local event.state from published to withdrawn automatically. If there are any tickets associated with the event, the will be closed automatically.

  • --pusblished-only

    When passing the remote items to the EventCollection, only add events if they are published.

  • --delete-orphaned-tickets

    Delete Tickets, TicketNotes and TicketMessasges if an event gets deleted automatically.

The following example will close tickets automatically for submitted and published events that were withdrawn on the remote.

org.cli.fix_directory_files(group_context: onegov.core.cli.core.GroupContext) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Not sure of this doubles the files, but actually the file reference remains, so it shouldn’t

This command will become obsolete as soon as the type of files in submissions are set correctly with type ‘directory’.

org.cli.migrate_town(group_context: onegov.core.cli.core.GroupContext) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Migrates the database from an old town to the new town like in the upgrades.

Migrates url’s in pages. Supports domains and full urls. Most of the urls are located in meta and content fields.

org.cli.migrate_publications(group_context: onegov.core.cli.core.GroupContext, dry_run: bool) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Marks signed files for publication.

Deletes all the data associated with a period, including:

Example: .. code-block:: bash

onegov-org –select /foo/bar delete-invisible-links

org.cli.get_resources_and_forms(option_file: IO[bytes]) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Get the resources and forms from the option file.

org.cli.import_reservations(reservation_file: IO[bytes], option_file: IO[bytes], mapping_yaml: IO[bytes], dry_run: bool) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Imports reservations from a Excel file (needs to be .xlsx). Creates no resources or allocations, so the availabilty periods need to be set in the resource settings.

org.cli.mtan_statistics(group_context: onegov.core.cli.core.GroupContext, year: int, month: int) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Generate mTAN SMS statistics for the given year and month.

org.cli.ul(inner: str) str[source]
org.cli.ol(inner: str) str[source]
org.cli.li(inner: str) str[source]
org.cli.p(inner: str) str[source]
org.cli.b(inner: str) str[source]
org.cli.em(inner: str) str[source]
org.cli.br() str[source]
org.cli.a(href: str, text: str) str[source]
org.cli.h(level: int, text: str) str[source]
org.cli.img(src: str, alt: str) str[source]
org.cli.import_news(path: str, start_date: datetime.datetime | None, end_date: datetime.datetime | None, overwrite_content: bool, dry_run: bool, local: bool) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Imports news from archive of json files

Example: .. code-block:: bash

onegov-org –select ‘/foo/bar’ import-news /path/to/news

org.cli.content_to_markup(element: dict[str, Any]) str[source]
org.cli.import_meetings(path: str, dry_run: bool) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Imports meetings from archive of json files

Example: .. code-block:: bash

onegov-org –select ‘/foo/bar’ import-meetings /path/to/items

org.cli.import_commissions(path: str, dry_run: bool) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Imports commissions from archive of json files

Example: .. code-block:: bash

onegov-org –select ‘/foo/bar’ import-commissions /path/to/items

org.cli.import_parliamentary_groups(path: str, dry_run: bool) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Imports parliamentary_groups from archive of json files

Example: .. code-block:: bash

onegov-org –select ‘/foo/bar’ import-parliamentary_groups /path

org.cli.handle_es_connection_error(func: Any) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]
org.cli.import_political_business(path: str, dry_run: bool) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Imports political_businesses from archive of json files

Example: .. code-block:: bash

onegov-org –select ‘/foo/bar’ import-political_businesses ./json-path

Note this assumes the filename is named ‘unknown_2416648.json’ where the number 2416648 can be used to find the object in the original url.

org.cli.import_parliamentarians(path: str, dry_run: bool) collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Imports parliamentarians from archive of json files

Example: .. code-block:: bash

onegov-org –select ‘/foo/bar’ import-parliamentarians /path/to/items

org.cli.create_memberships() collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Creates Commission Memberships

onegov-org –select ‘/foo/bar’ create-commission-memberships

org.cli.create_polical_business_participants() collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Creates Political Business Participants

onegov-org –select ‘/foo/bar’ create-political-business-participants

org.cli.create_parliamentarian_roles() collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Creates Parliamentarian Roles

onegov-org –select ‘/foo/bar’ create-parliamentarian-roles

org.cli.connect_political_business_meeting_items() collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None][source]

Connects Political Business and Meeting Items

onegov-org –select ‘/foo/bar’ connect-political-business-meeting-items