recipients in manager
This commit is contained in:
@@ -47,7 +47,7 @@ def file_size_human(num):
|
|||||||
|
|
||||||
def list_shares(shares,opts):
|
def list_shares(shares,opts):
|
||||||
table = []
|
table = []
|
||||||
table.append(('Name', 'Path','Public','Password','PassHash','Upload','Overwrite','Direct','Expire','Description'))
|
table.append(('Name', 'Path','Public','Password','PassHash','Upload','Overwrite','Direct','Expire','Recipient','Description'))
|
||||||
for share in shares:
|
for share in shares:
|
||||||
public = get_or_no('public',share, False)
|
public = get_or_no('public',share, False)
|
||||||
passhash = '-'
|
passhash = '-'
|
||||||
@@ -76,6 +76,7 @@ def list_shares(shares,opts):
|
|||||||
overwrite,
|
overwrite,
|
||||||
direct,
|
direct,
|
||||||
expire,
|
expire,
|
||||||
|
get_or_no('recipient', share, "")[0:20],
|
||||||
description
|
description
|
||||||
))
|
))
|
||||||
print(tabulate(table, headers = "firstrow"))
|
print(tabulate(table, headers = "firstrow"))
|
||||||
@@ -121,7 +122,8 @@ def add_share(shares, config, opts):
|
|||||||
'upload': opts.upload,
|
'upload': opts.upload,
|
||||||
'overwrite': opts.overwrite,
|
'overwrite': opts.overwrite,
|
||||||
'direct_links': opts.direct,
|
'direct_links': opts.direct,
|
||||||
'description': opts.description
|
'description': opts.description,
|
||||||
|
'recipient': opts.recipient
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.password:
|
if opts.password:
|
||||||
@@ -178,6 +180,8 @@ def modify_share(shares, config, opts):
|
|||||||
share[attr] = getattr(opts,attr) == 'true'
|
share[attr] = getattr(opts,attr) == 'true'
|
||||||
if opts.description != None:
|
if opts.description != None:
|
||||||
share['description'] = opts.description
|
share['description'] = opts.description
|
||||||
|
if opts.recipient != None:
|
||||||
|
share['recipient'] = opts.recipient
|
||||||
# REMOVE password
|
# REMOVE password
|
||||||
if opts.password == "":
|
if opts.password == "":
|
||||||
if 'pass_plain' in share:
|
if 'pass_plain' in share:
|
||||||
@@ -407,6 +411,9 @@ def parse_options():
|
|||||||
parser_add.add_argument('-e','--expire', action="store", dest="expire", default = False,
|
parser_add.add_argument('-e','--expire', action="store", dest="expire", default = False,
|
||||||
help = "expire date in format '%%Y-%%m-%%d %%H:%%M' ex. '2018-12-24 21:00'"
|
help = "expire date in format '%%Y-%%m-%%d %%H:%%M' ex. '2018-12-24 21:00'"
|
||||||
)
|
)
|
||||||
|
parser_add.add_argument('-r','--recipient', action="store", dest="recipient", default = "",
|
||||||
|
help= "Recipient for notifications (if enabled)"
|
||||||
|
)
|
||||||
parser_add.add_argument('-w','--write', action="store_true", dest="write", default = False,
|
parser_add.add_argument('-w','--write', action="store_true", dest="write", default = False,
|
||||||
help = "Write changes to the shares.json file"
|
help = "Write changes to the shares.json file"
|
||||||
)
|
)
|
||||||
@@ -432,6 +439,9 @@ def parse_options():
|
|||||||
parser_modify.add_argument('-e','--expire', action="store", dest="expire", default = False,
|
parser_modify.add_argument('-e','--expire', action="store", dest="expire", default = False,
|
||||||
help = "expire date in format '%%Y-%%m-%%d %%H:%%M' ex. '2018-12-24 21:00'. Set as empty string to remove expiration."
|
help = "expire date in format '%%Y-%%m-%%d %%H:%%M' ex. '2018-12-24 21:00'. Set as empty string to remove expiration."
|
||||||
)
|
)
|
||||||
|
parser_modify.add_argument('-r','--recipient', action="store", dest="recipient", default = None,
|
||||||
|
help= "Recipient for notifications (if enabled)"
|
||||||
|
)
|
||||||
parser_modify.add_argument('-w','--write', action="store_true", dest="write", default = False,
|
parser_modify.add_argument('-w','--write', action="store_true", dest="write", default = False,
|
||||||
help = "Write changes to the shares.json file"
|
help = "Write changes to the shares.json file"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user