pywb.manager package¶
Submodules¶
pywb.manager.aclmanager module¶
-
class
pywb.manager.aclmanager.
ACLManager
(r)[source]¶ Bases:
pywb.manager.manager.CollectionsManager
-
DEFAULT_FILE
= 'access-rules.aclj'¶
-
SURT_RX
= re.compile('([^:.]+[,)])+')¶
-
VALID_ACCESS
= ('allow', 'block', 'exclude', 'allow_ignore_embargo')¶
-
add_excludes
(r)[source]¶ Import old-style excludes, in url-per-line format
Parameters: r (argparse.Namespace) – Parsed result from ArgumentParser
-
add_rule
(r)[source]¶ Adds a rule the ACL manager
Parameters: r (argparse.Namespace) – The argparse namespace representing the rule to be added Return type: None
-
find_match
(r)[source]¶ Finds a matching acl rule
Parameters: r (argparse.Namespace) – Parsed result from ArgumentParser Return type: None
-
classmethod
init_parser
(parser)[source]¶ Initializes an argument parser for acl commands
Parameters: parser (argparse.ArgumentParser) – The parser to be initialized Return type: None
-
is_valid_auto_coll
(coll_name)[source]¶ Returns T/F indicating if the supplied collection name is a valid collection
Parameters: coll_name – The collection name to check Returns: T/F indicating a valid collection Return type: bool
-
list_rules
(r)[source]¶ Print the acl rules to the stdout
Parameters: r (argparse.Namespace|None) – Not used Return type: None
-
load_acl
(must_exist=True)[source]¶ Loads the access control list
Parameters: must_exist (bool) – Does the acl file have to exist Returns: T/F indicating load success Return type: bool
-
print_rule
(rule)[source]¶ Prints the supplied rule to the std out
Parameters: rule (CDXObject) – The rule to be printed Return type: None
-
process
(r)[source]¶ Process acl command
Parameters: r (argparse.Namespace) – Parsed result from ArgumentParser Return type: None
-
remove_rule
(r)[source]¶ Removes a rule from the acl file
Parameters: r (argparse.Namespace) – Parsed result from ArgumentParser Return type: None
-
save_acl
(r=None)[source]¶ Save the contents of the rules as cdxj entries to the access control list file
Parameters: r (argparse.Namespace|None) – Not used Return type: None
-
to_key
(url_or_surt, exact_match=False)[source]¶ If ‘url_or_surt’ already a SURT, use as is If exact match, add the exact match suffix
Parameters: Return type:
-
validate
(log=False, correct=False)[source]¶ Validates the acl rules returning T/F if the list should be saved
Parameters: Return type:
-
pywb.manager.autoindex module¶
pywb.manager.locmanager module¶
pywb.manager.manager module¶
-
class
pywb.manager.manager.
CollectionsManager
(coll_name, colls_dir=None, must_exist=True)[source]¶ Bases:
object
This utility is designed to simplify the creation and management of web archive collections
It may be used via cmdline to setup and maintain the directory structure expected by pywb
-
COLLS_DIR
= 'collections'¶
-
COLL_RX
= re.compile('^[\\w][-\\w]*$')¶
-
DEF_INDEX_FILE
= 'index.cdxj'¶
-