Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
d874ccae
Commit
d874ccae
authored
Feb 21, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
791fd2da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
setup.py
setup.py
+3
-1
wcfs/__init__.py
wcfs/__init__.py
+10
-5
No files found.
setup.py
View file @
d874ccae
...
...
@@ -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
...
...
wcfs/__init__.py
View file @
d874ccae
...
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment