Commit d874ccae authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 791fd2da
......@@ -263,7 +263,9 @@ setup(
# TODO install wcfs exe along wcfs/ py package.
entry_points= {'console_scripts': [
# start wcfs
# start wcfs for zurl
# XXX name -> wcfs_serve? (it is confusing to have 2
# wcfs with different behaviour)
'wcfs = wendelin.wcfs:main',
# demo to test
......
......@@ -60,10 +60,11 @@ class Conn(object):
#
# it is an error if wcfs was already started.
#
# XXX optv
# if exec_ is True, wcfs is not spawned, but executed into.
#
# serve(zurl, exec_=False).
def serve(zurl, exec_=False):
def serve(zurl, optv, exec_=False):
mntpt = _mntpt_4zurl(zurl)
# try opening .wcfs - it is an error if we can do it.
......@@ -79,7 +80,7 @@ def serve(zurl, exec_=False):
# seems to be ok to start
# XXX race window if something starts after ^^^ check
argv = [_wcfs_exe(), zurl, mntpt]
argv = [_wcfs_exe()] + list(optv) + [zurl, mntpt]
if not exec_:
subprocess.check_call(argv, close_fds=True)
else:
......@@ -122,6 +123,7 @@ def join(zurl, autostart=_default_autostart()):
# start wcfs with telling it to automatically exit when there is no client activity.
# XXX extra opts -> join args -> test + -v=1 if running py.test -v
# XXX ^^^ check log level?
return _start(zurl, "-autoexit", '-d', '-alsologtostderr', '-v=1')
......@@ -186,7 +188,6 @@ def _start(zurl, *optv):
if e.errno != ENOENT:
raise
else:
# TODO read .wcfs and verify it = zurl
res = f
dotwcfs = f.read()
if dotwcfs != zurl:
......@@ -289,6 +290,10 @@ def _mkdir_p(path):
# if called as main just -> serve(argv[1])
# if called as main just -> serve()
def main():
serve(sys.argv[1], exec_=True)
argv = sys.argv[1:]
# XXX usage
zurl = argv[-1] # -a -b zurl -> zurl
optv = argv[:-1] # -a -b zurl -> -a -b
serve(zurl, optv, exec_=True)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment