org.cli ======= .. py:module:: org.cli .. autoapi-nested-parse:: Provides commands used to initialize org websites. Attributes ---------- .. autoapisummary:: org.cli.cli Functions --------- .. autoapisummary:: org.cli.add org.cli.import_digirez org.cli.fix_tags org.cli.close_ticket org.cli.fetch org.cli.fix_directory_files org.cli.migrate_town org.cli.migrate_links_cli org.cli.migrate_publications org.cli.delete_invisible_links org.cli.get_resources_and_forms org.cli.import_reservations org.cli.mtan_statistics org.cli.ul org.cli.ol org.cli.li org.cli.p org.cli.b org.cli.em org.cli.br org.cli.a org.cli.h org.cli.img org.cli.import_news org.cli.content_to_markup org.cli.import_meetings org.cli.import_commissions org.cli.import_parliamentary_groups org.cli.handle_es_connection_error org.cli.import_political_business org.cli.import_parliamentarians org.cli.create_memberships org.cli.create_polical_business_participants org.cli.create_parliamentarian_roles org.cli.connect_political_business_meeting_items org.cli.ris_shipping_to_private_address org.cli.ris_set_end_date_for_inactive_parliamentarians org.cli.ris_resolve_parliamentarian_doublette Module Contents --------------- .. py:data:: cli .. py:function:: add(group_context: onegov.core.cli.core.GroupContext, name: str, locale: str) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Adds an org with the given name to the database. For example: .. code-block:: bash onegov-org --select '/onegov_org/evilcorp' add "Evilcorp" .. py:function:: import_digirez(accessdb: str, min_date: str, ignore_booking_conflicts: bool) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Imports a Digirez reservation database into onegov.org. Example: .. code-block:: bash onegov-org --select '/orgs/govikon' import-digirez room_booking.mdb .. py:function:: fix_tags(group_context: onegov.core.cli.core.GroupContext, dry_run: bool) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] .. py:function:: close_ticket(ticket: onegov.ticket.Ticket, user: onegov.user.User, request: onegov.org.request.OrgRequest) -> None .. py:function:: 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] 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. .. code-block:: bash onegov-event --select '/veranstaltungen/zug' fetch \ --source menzingen --source steinhausen \ --published-only \ --create-tickets \ --state-transfers published:withdrawn \ --state-transfers submitted:withdrawm .. py:function:: fix_directory_files(group_context: onegov.core.cli.core.GroupContext) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] 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'. .. py:function:: migrate_town(group_context: onegov.core.cli.core.GroupContext) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Migrates the database from an old town to the new town like in the upgrades. .. py:function:: migrate_links_cli(group_context: onegov.core.cli.core.GroupContext, old_uri: str, dry_run: bool) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Migrates url's in pages. Supports domains and full urls. Most of the urls are located in meta and content fields. .. py:function:: migrate_publications(group_context: onegov.core.cli.core.GroupContext, dry_run: bool) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Marks signed files for publication. .. py:function:: delete_invisible_links() -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Deletes all the data associated with a period, including: Example: .. code-block:: bash onegov-org --select /foo/bar delete-invisible-links .. py:function:: get_resources_and_forms(option_file: IO[bytes]) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Get the resources and forms from the option file. .. py:function:: import_reservations(reservation_file: IO[bytes], option_file: IO[bytes], mapping_yaml: IO[bytes], dry_run: bool, masked: bool) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] 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. .. py:function:: 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] Generate mTAN SMS statistics for the given year and month. .. py:function:: ul(inner: str) -> str .. py:function:: ol(inner: str) -> str .. py:function:: li(inner: str) -> str .. py:function:: p(inner: str) -> str .. py:function:: b(inner: str) -> str .. py:function:: em(inner: str) -> str .. py:function:: br() -> str .. py:function:: a(href: str, text: str) -> str .. py:function:: h(level: int, text: str) -> str .. py:function:: img(src: str, alt: str) -> str .. py:function:: 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] Imports news from archive of json files Example: .. code-block:: bash onegov-org --select '/foo/bar' import-news /path/to/news .. py:function:: content_to_markup(element: dict[str, Any]) -> str .. py:function:: import_meetings(path: str, dry_run: bool) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Imports meetings from archive of json files Example: .. code-block:: bash onegov-org --select '/foo/bar' import-meetings /path/to/items .. py:function:: import_commissions(path: str, dry_run: bool) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Imports commissions from archive of json files Example: .. code-block:: bash onegov-org --select '/foo/bar' import-commissions /path/to/items .. py:function:: import_parliamentary_groups(path: str, dry_run: bool) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Imports parliamentary_groups from archive of json files Example: .. code-block:: bash onegov-org --select '/foo/bar' import-parliamentary_groups /path .. py:function:: handle_es_connection_error(func: Any) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] .. py:function:: import_political_business(path: str, dry_run: bool) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] 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. .. py:function:: import_parliamentarians(path: str, dry_run: bool) -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Imports parliamentarians from archive of json files Example: .. code-block:: bash onegov-org --select '/foo/bar' import-parliamentarians /path/to/items .. py:function:: create_memberships() -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Creates Commission Memberships onegov-org --select '/foo/bar' create-commission-memberships .. py:function:: create_polical_business_participants() -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Creates Political Business Participants onegov-org --select '/foo/bar' create-political-business-participants .. py:function:: create_parliamentarian_roles() -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Creates Parliamentarian Roles onegov-org --select '/foo/bar' create-parliamentarian-roles .. py:function:: connect_political_business_meeting_items() -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Connects Political Business and Meeting Items onegov-org --select '/foo/bar' connect-political-business-meeting-items .. py:function:: ris_shipping_to_private_address() -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Sets the RIS shipping address to the private address onegov-org --select /foo/bar ris-shipping-to-private-address .. py:function:: ris_set_end_date_for_inactive_parliamentarians() -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] Sets the end date for inactive parliamentarians onegov-org --select /foo/bar ris-set-end-date-for-inactive-parliamentarians .. py:function:: ris_resolve_parliamentarian_doublette() -> collections.abc.Callable[[onegov.org.request.OrgRequest, onegov.org.app.OrgApp], None] ogc-2394 replace participants reference for business and delete parliamentarian (id_1)