Command line interface¶
module: rspub.cli.rscli
Command line interface to publish resources under the ResourceSync Framework
The module rscli.py
offers an interface to configure, select and run the publishing of resources under
the ResourceSync framework. Start rscli from anywhere
on the system:
python3 rspub/cli/rscli.py
The internals of the command line interface resemble a three-room house. You enter the house in
the rspub
room. From there you can enter the rooms configure
and select
. You leave the rooms and
the house by typing exit
. In all rooms you can get help by typing help
.
-
class
rspub.cli.rscli.
RsPub
[source]¶ Bases:
rspub.cli.rscli.SuperCmd
,rspub.util.observe.EventObserver
-
prompt
= 'rspub > '¶
-
intro
= '================================================== \nCommand Line Interface for ResourceSync Publishing \n================================================== \n-> For help type: help'¶
-
-
class
rspub.cli.rscli.
Configure
[source]¶ Bases:
rspub.cli.rscli.SuperCmd
-
prompt
= 'configure > '¶
-
intro
= '============================= \nConfigure Metadata Publishing \n============================= \n-> For help type: help'¶
-
do_save_configuration
(name)[source]¶ save_configuration [name]:
Save the current configuration as (name)
-
do_resource_dir
(path)[source]¶ resource_dir:
resource_dir - Get the parameter resource_dir [path] - Set the parameter ---------------------------------------- The resource_dir acts as the root of the resources to be published. The urls to the resources are calculated relative to the resource_dir.
-
do_metadata_dir
(path)[source]¶ metadata_dir:
metadata_dir - Get the parameter metadata_dir [path] - Set the parameter ---------------------------------------- The metadata_dir is where sitemaps will be stored. The metadata_dir is always relative to the resource_dir
-
do_description_dir
(path)[source]¶ description_dir:
description_dir - Get the parameter description_dir [path] - Set the parameter description_dir None - Reset the parameter --------------------------------------------- The path to the directory of the (local copy of) the source description, aka '.well-known/resourcesync'
-
do_url_prefix
(url)[source]¶ url_prefix:
url_prefix - Get the parameter url_prefix [prefix] - Set the parameter ---------------------------------------- The url_prefix is used to prefix urls to documents and resources.
-
do_has_wellknown_at_root
(value)[source]¶ has_wellknown_at_root:
has_wellknown_at_root - Get the parameter has_wellknown_at_root (yes | no) - Set the parameter ---------------------------------------------------- The description document '.well-known/resourcesync' is at the root of the server address.
-
do_strategy
(name)[source]¶ strategy:
strategy - Get the parameter strategy [strategy] - Set the parameter ---------------------------------------- The strategy determines what will be done by ResourceSync upon execution.
-
do_discard_selector_file
(line)[source]¶ discard_selector_file:
Remove the association between this configuration and selector (if any). An association between a configuration and a selector is set after execution of ResourceSync with a Selector as file selector.
-
do_select_mode
(mode)[source]¶ select_mode:
select_mode - Get the parameter select_mode [mode] - Set the parameter --------------------------------------- Mode for selecting resources.
-
do_plugin_dir
(path)[source]¶ plugin_dir:
plugin_dir - Get the parameter plugin_dir [path] - Set the parameter plugin_dir None - Reset the parameter --------------------------------------- The directory where plugins can be found.
-
do_max_items_in_list
(value)[source]¶ max_items_in_list:
max_items_in_list - Get the parameter max_items_in_list (int, 1 - 50000) - Set the parameter ------------------------------------------------------ The maximum amount of records in a sitemap.
-
do_zero_fill_filename
(value)[source]¶ zero_fill_filename:
zero_fill_filename - Get the parameter zero_fill_filename (int, 1 - 10) - Set the parameter ---------------------------------------------------- The amount of digits in a sitemap filename.
-
-
class
rspub.cli.rscli.
Select
[source]¶ Bases:
rspub.cli.rscli.SuperCmd
-
prompt
= 'select > '¶
-
intro
= '======================================= \nSelect data for ResourceSync Publishing \n======================================= \n-> For help type: help'¶
-
do_load_selector
(path)[source]¶ load_selector:
load_selector [path] - Load Selector from location [path] --------------------------------------------------------- If the current Selector has unsaved changes, you will be prompted to save or discard.
-
do_save_selector
(path)[source]¶ save_selector:
save_selector - Save current selector save_selector [path] - Save current selector as [path]
-
do_include_path
(path)[source]¶ include_path:
include_path [path] - Add a file or directory to the collection of includes. ---------------------------------------------------------------------------- The [path] can be relative or absolute.
-
do_exclude_path
(path)[source]¶ exclude_path:
exclude_path [path] - Add a file or directory to the collection of excludes. ---------------------------------------------------------------------------- The [path] can be relative or absolute.
-
do_list_selected
(line)[source]¶ list_selected:
List absolute filenames of the selected files. The selected files are the relative complement of excludes with respect to includes. (list_includes \ list_excludes)
-
do_read_includes
(path)[source]¶ read_includes:
read_includes [path] - Read included filenames from a file at [path]
-
do_read_excludes
(path)[source]¶ read_excludes:
read_excludes [path] - Read excluded filenames from a file at [path]
-
do_discard_include
(path)[source]¶ discard_include:
discard_include [path] - Remove [path] from included filenames.
-