Skip to content

Commit

Permalink
Merge pull request #1664 from edacval/fix-1646
Browse files Browse the repository at this point in the history
[seaf-cli ] Pass args to helper function
  • Loading branch information
freeplant committed May 27, 2016
2 parents e2ffb27 + d1a8cd0 commit 94a75d8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions app/seaf-cli
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def _config_valid(conf):
return True


def _conf_dir():
def _conf_dir(args):
''' Determine and return the value of conf_dir '''
conf_dir = DEFAULT_CONF_DIR
if args.confdir:
Expand Down Expand Up @@ -277,7 +277,7 @@ def seaf_start_all(args):
def seaf_start_ccnet(args):
''' Start ccnet daemon '''

conf_dir = _conf_dir()
conf_dir = _conf_dir(args)

print "Starting ccnet daemon ..."

Expand All @@ -291,7 +291,7 @@ def seaf_start_ccnet(args):
def seaf_start_seafile(args):
''' start seafile daemon '''

conf_dir = _conf_dir()
conf_dir = _conf_dir(args)

print "Starting seafile daemon ..."

Expand All @@ -306,7 +306,7 @@ def seaf_start_seafile(args):
def seaf_stop(args):
'''Stop seafile daemon '''

conf_dir = _conf_dir()
conf_dir = _conf_dir(args)

pool = ccnet.ClientPool(conf_dir)
client = pool.get_client()
Expand All @@ -320,7 +320,7 @@ def seaf_stop(args):
def seaf_list(args):
'''List local libraries'''

conf_dir = _conf_dir()
conf_dir = _conf_dir(args)

pool = ccnet.ClientPool(conf_dir)
seafile_rpc = seafile.RpcClient(pool, req_pool=False)
Expand All @@ -334,7 +334,7 @@ def seaf_list(args):
def seaf_list_remote(args):
'''List remote libraries'''

conf_dir = _conf_dir()
conf_dir = _conf_dir(args)

url = args.server
if not url:
Expand Down Expand Up @@ -380,7 +380,7 @@ def get_base_url(url):
def seaf_download(args):
'''Download a library from seafile server '''

conf_dir = _conf_dir()
conf_dir = _conf_dir(args)

repo = args.library
if not repo:
Expand Down Expand Up @@ -453,7 +453,7 @@ def seaf_download_by_name(args):
'''Download a library defined by name from seafile server'''
id = None

conf_dir = _conf_dir()
conf_dir = _conf_dir(args)

libraryname = args.libraryname
if not libraryname:
Expand Down Expand Up @@ -497,7 +497,7 @@ def seaf_download_by_name(args):
def seaf_sync(args):
''' synchronize a library from seafile server '''

conf_dir = _conf_dir()
conf_dir = _conf_dir(args)

repo = args.library
if not repo:
Expand Down Expand Up @@ -571,7 +571,7 @@ def seaf_sync(args):
def seaf_desync(args):
'''Desynchronize a library from seafile server'''

conf_dir = _conf_dir()
conf_dir = _conf_dir(args)

repo_path = args.folder
if not repo_path:
Expand Down Expand Up @@ -599,7 +599,7 @@ def seaf_desync(args):
def seaf_config(args):
'''Configure the seafile client'''

conf_dir = _conf_dir()
conf_dir = _conf_dir(args)

config_key = args.key
if not config_key:
Expand All @@ -623,7 +623,7 @@ def seaf_config(args):
def seaf_status(args):
'''Show status'''

conf_dir = _conf_dir()
conf_dir = _conf_dir(args)

pool = ccnet.ClientPool(conf_dir)
ccnet_rpc = ccnet.CcnetRpcClient(pool, req_pool=False)
Expand Down

0 comments on commit 94a75d8

Please sign in to comment.