webpub1c package

Submodules

webpub1c.apache_config module

class webpub1c.apache_config.ApacheConfig(filename: str, vrd_path: str, dir_path: str, url_base: str, vrd_params: Dict[str, str | None] | None = None, templates_env: Environment | None = None)[source]

Bases: object

apache config

add_1cws_module(module_filename: str)[source]
add_publication(publication: WebPublication, force: bool = False) None[source]
create_publication(ibname: str, url_path: str | None = None, infobase_filepath='', force: bool = False) WebPublication[source]
end_tag: str = '# --- WEBPUB1C PUBLICATION END:'
get_publication(ibname: str) WebPublication | None[source]
has_1cws_module() bool[source]
is_publicated(ibname: str) bool[source]
is_valid() bool[source]
iter() Iterator[WebPublication][source]
property publications: Iterator[str]
remove_publication(ibname: str, destroy: bool = True, force: bool = False)[source]
start_tag: str = '# --- WEBPUB1C PUBLICATION START:'
property text: str

webpub1c.cli module

class webpub1c.cli.Commands(config: str = 'webpub1c.yml', verbose: bool = False)[source]

Bases: object

1C: Enterprise infobase web publication tool.

add(ibname: str, url: str | None = None, file: str = '', force: bool = False) str[source]

Add new publication

add_module() None[source]

Add 1cws module to apache config

check() None[source]

Check config

get(ibname: str) str | None[source]

Get publication info

has_module() bool[source]

Ensure apache config has 1cws module

list() List[str][source]

List publications

remove(ibname: str, force: bool = False) None[source]

Remove publication

set_url(ibname: str, url: str) None[source]

Set publication url

webpub1c.cli.main()[source]

webpub1c.common module

webpub1c.common.slugify(value: str, lang: str = 'ru') str[source]

Creates a slug according to the given string

Parameters

value: str

The string input to be converted to a slug

lang: str

The language used to properly convert the given string to a slug (Default is ‘ru’, Russian)

Return

str

The converted string with the format of a slug

webpub1c.common.urlpath_join(prefix: str, url_path: str) str[source]

Joins two paths with the prefix being on the left

Parameters

prefix: str

First part of the resulting URL

url_path: str

Second part of the resulting URL

Return

str

The joined URL

webpub1c.webpublication module

class webpub1c.webpublication.WebPublication(name: str, directory: str = '', vrd_filename: str = '', url_path: str = '', vrd_params: Dict[str, str | None] | None = None, templates_env: Environment | None = None, infobase_filepath='')[source]

Bases: object

1c web publication info for apache2 config

create(force: bool = False)[source]

create all

create_directory()[source]
create_vrd(force: bool = False)[source]
describe() str[source]

describe publication info

static from_config(name: str, config: str, templates_env: Environment | None = None) WebPublication[source]

read publication info from config block

generate_paths(dir_prefix: str, vrd_prefix: str, url_prefix: str)[source]

generate directory path, vrd filepath, url for named publication

is_exist() bool[source]

directory and vrd file exists

is_file_infobase()[source]
is_ok_to_create() bool[source]

can create directory, vrd file

is_valid() bool[source]

is directory path, vrd filepath, url, name valid

remove(force: bool = False)[source]

remove all

remove_directory(force: bool = False)[source]
remove_vrd()[source]
to_config() str[source]

get config block from publication info

Module contents