mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
docstrings: add docstrings, remove duplicate call, cleanup ACLManager init
This commit is contained in:
parent
e04adea7a8
commit
ce10d9af7c
@ -22,6 +22,9 @@ class ACLManager(CollectionsManager):
|
|||||||
DEFAULT_FILE = 'access-rules.aclj'
|
DEFAULT_FILE = 'access-rules.aclj'
|
||||||
|
|
||||||
def __init__(self, r):
|
def __init__(self, r):
|
||||||
|
"""
|
||||||
|
:param r: Parsed result from ArgumentParser
|
||||||
|
"""
|
||||||
self.rules = []
|
self.rules = []
|
||||||
|
|
||||||
coll_name = r.coll_name
|
coll_name = r.coll_name
|
||||||
@ -32,6 +35,13 @@ class ACLManager(CollectionsManager):
|
|||||||
|
|
||||||
super(ACLManager, self).__init__(coll_name, must_exist=False)
|
super(ACLManager, self).__init__(coll_name, must_exist=False)
|
||||||
|
|
||||||
|
def process(self, r):
|
||||||
|
"""
|
||||||
|
Process acl command
|
||||||
|
:param r: Parsed result from ArgumentParser
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
|
||||||
# if target exists as a file, use that
|
# if target exists as a file, use that
|
||||||
if os.path.isfile(self.target):
|
if os.path.isfile(self.target):
|
||||||
self.acl_file = self.target
|
self.acl_file = self.target
|
||||||
|
@ -434,6 +434,7 @@ Create manage file based web archive collections
|
|||||||
from pywb.manager.aclmanager import ACLManager
|
from pywb.manager.aclmanager import ACLManager
|
||||||
def do_acl(r):
|
def do_acl(r):
|
||||||
acl = ACLManager(r)
|
acl = ACLManager(r)
|
||||||
|
acl.process(r)
|
||||||
|
|
||||||
acl_help = 'Configure Access Control Lists (ACL) for a collection'
|
acl_help = 'Configure Access Control Lists (ACL) for a collection'
|
||||||
acl = subparsers.add_parser('acl', help=acl_help)
|
acl = subparsers.add_parser('acl', help=acl_help)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user