diff --git a/utils/flees-manager.py b/utils/flees-manager.py index 7c8eacb..cc8d156 100755 --- a/utils/flees-manager.py +++ b/utils/flees-manager.py @@ -47,7 +47,7 @@ def file_size_human(num): def list_shares(shares,opts): 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: public = get_or_no('public',share, False) passhash = '-' @@ -76,6 +76,7 @@ def list_shares(shares,opts): overwrite, direct, expire, + get_or_no('recipient', share, "")[0:20], description )) print(tabulate(table, headers = "firstrow")) @@ -121,7 +122,8 @@ def add_share(shares, config, opts): 'upload': opts.upload, 'overwrite': opts.overwrite, 'direct_links': opts.direct, - 'description': opts.description + 'description': opts.description, + 'recipient': opts.recipient } if opts.password: @@ -178,6 +180,8 @@ def modify_share(shares, config, opts): share[attr] = getattr(opts,attr) == 'true' if opts.description != None: share['description'] = opts.description + if opts.recipient != None: + share['recipient'] = opts.recipient # REMOVE password if opts.password == "": if 'pass_plain' in share: @@ -407,6 +411,9 @@ def parse_options(): 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'" ) + 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, 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, 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, help = "Write changes to the shares.json file" )