geotribu_cli.constants module

Package constants.

class geotribu_cli.constants.ExtendedEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases : Enum

Custom Enum with extended methods.

classmethod has_key(name)

Check if a certain key is present in enum.

Source: https://stackoverflow.com/a/62065380/2556577

Paramètres:

name (str) – key to check.

Renvoie:

True if the key exists.

Type renvoyé:

bool

classmethod has_value(value)

Check if a certain value is present in enum.

Source: https://stackoverflow.com/a/43634746/2556577

Paramètres:

value (str) – value to check

Renvoie:

True is the value exists.

Type renvoyé:

bool

classmethod values_set()

Return a set of enum values.

Type renvoyé:

set

Renvoie:

set of enum’s unique values

class geotribu_cli.constants.GeotribuDefaults(git_base_url_organisation='https://github.com/geotribu/', site_base_url='https://geotribu.fr/', site_git_default_branch='master', site_git_project='website', site_search_index='search/search_index.json', cdn_base_url='https://cdn.geotribu.fr/', cdn_base_path='img', cdn_search_index='search-index.json', comments_base_url='https://comments.geotribu.fr/', rss_path_created='feed_rss_created.xml', rss_path_updated='feed_rss_updated.xml', images_body_extensions=('.png', '.jpg', '.jpeg', '.webp'), images_body_dimensions_max=(400, 800), images_header_extensions=('.png', '.jpg', '.jpeg'), images_header_dimensions_ratio=320000, images_icon_extensions=('.png', '.jpg', '.jpeg', '.webp'), images_icon_dimensions_ratio=320000, geotribu_working_folder=PosixPath('/home/runner/.geotribu'), mastodon_base_url='https://mapstodon.space/', template_article='/articles/templates/template_article.md', template_rdp='/rdp/templates/template_rdp.md', template_rdp_news='/rdp/templates/template_rdp_news.md')

Bases : object

Defaults settings for Geotribu.

__init__(git_base_url_organisation='https://github.com/geotribu/', site_base_url='https://geotribu.fr/', site_git_default_branch='master', site_git_project='website', site_search_index='search/search_index.json', cdn_base_url='https://cdn.geotribu.fr/', cdn_base_path='img', cdn_search_index='search-index.json', comments_base_url='https://comments.geotribu.fr/', rss_path_created='feed_rss_created.xml', rss_path_updated='feed_rss_updated.xml', images_body_extensions=('.png', '.jpg', '.jpeg', '.webp'), images_body_dimensions_max=(400, 800), images_header_extensions=('.png', '.jpg', '.jpeg'), images_header_dimensions_ratio=320000, images_icon_extensions=('.png', '.jpg', '.jpeg', '.webp'), images_icon_dimensions_ratio=320000, geotribu_working_folder=PosixPath('/home/runner/.geotribu'), mastodon_base_url='https://mapstodon.space/', template_article='/articles/templates/template_article.md', template_rdp='/rdp/templates/template_rdp.md', template_rdp_news='/rdp/templates/template_rdp_news.md')
cdn_base_path: str = 'img'
cdn_base_url: str = 'https://cdn.geotribu.fr/'
cdn_search_index: str = 'search-index.json'
property cdn_search_index_full_url: str

Returns CDN search index full URL.

Renvoie:

URL as string

Type renvoyé:

str

comments_base_url: str = 'https://comments.geotribu.fr/'
geotribu_working_folder: Path = PosixPath('/home/runner/.geotribu')
git_base_url_organisation: str = 'https://github.com/geotribu/'
images_body_dimensions_max: tuple = (400, 800)
images_body_extensions: tuple = ('.png', '.jpg', '.jpeg', '.webp')
images_header_dimensions_ratio: int = 320000
images_header_extensions: tuple = ('.png', '.jpg', '.jpeg')
images_icon_dimensions_ratio: int = 320000
images_icon_extensions: tuple = ('.png', '.jpg', '.jpeg', '.webp')
property json_created_full_url: str

Returns website JSON Feed full URL for latest created contents.

Renvoie:

URL as string

Type renvoyé:

str

json_path_created = 'feed_json_created.json'
json_path_updated = 'feed_json_updated.json'
mastodon_base_url: str = 'https://mapstodon.space/'
property rss_created_full_url: str

Returns website RSS full URL for latest created contents.

Renvoie:

URL as string

Type renvoyé:

str

rss_path_created: str = 'feed_rss_created.xml'
rss_path_updated: str = 'feed_rss_updated.xml'
site_base_url: str = 'https://geotribu.fr/'
site_git_default_branch: str = 'master'
site_git_project: str = 'website'
site_git_source_base_url(mode='blob', url_path='')

Returns website git source URL in three flavors: blob, edit or raw.

Paramètres:

mode (Literal['blob', 'edit', 'raw']) – display mode for source. Defaults to « blob ».

Renvoie:

URL as string

Type renvoyé:

str

site_search_index: str = 'search/search_index.json'
property site_search_index_full_url: str

Returns website search index full URL.

Renvoie:

URL as string

Type renvoyé:

str

property site_search_tags_full_url: str

Returns website search tags full URL.

Renvoie:

URL as string

Type renvoyé:

str

site_search_tags_remote_path = 'tags.json'
template_article: str = '/articles/templates/template_article.md'
template_rdp: str = '/rdp/templates/template_rdp.md'
template_rdp_news: str = '/rdp/templates/template_rdp_news.md'
class geotribu_cli.constants.YamlHeaderAvailableLicense(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases : ExtendedEnum

Licences disponibles pour les contenus publiés sur Geotribu.

BEERWARE = 'beerware'
CC4_BY_BC_SA = 'cc4_by-nc-sa'
CC4_BY_SA = 'cc4_by-sa'
DEFAULT = 'default'
class geotribu_cli.constants.YamlHeaderMandatoryKeys(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases : ExtendedEnum

Clés obligatoires dans l’en-tête d’un contenu Geotribu.

AUTHORS = 'authors'
CATEGORIES = 'categories'
DATE = 'date'
DESCRIPTION = 'description'
LICENSE = 'license'
TAGS = 'tags'
TITLE = 'title'