1
0
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:
Ilya Kreymer 2019-04-03 12:32:09 -07:00 committed by John Berlin
parent e04adea7a8
commit ce10d9af7c
No known key found for this signature in database
GPG Key ID: 6EF5E4B442011B02
2 changed files with 11 additions and 0 deletions

View File

@ -22,6 +22,9 @@ class ACLManager(CollectionsManager):
DEFAULT_FILE = 'access-rules.aclj'
def __init__(self, r):
"""
:param r: Parsed result from ArgumentParser
"""
self.rules = []
coll_name = r.coll_name
@ -32,6 +35,13 @@ class ACLManager(CollectionsManager):
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 os.path.isfile(self.target):
self.acl_file = self.target

View File

@ -434,6 +434,7 @@ Create manage file based web archive collections
from pywb.manager.aclmanager import ACLManager
def do_acl(r):
acl = ACLManager(r)
acl.process(r)
acl_help = 'Configure Access Control Lists (ACL) for a collection'
acl = subparsers.add_parser('acl', help=acl_help)