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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
89546f76
Commit
89546f76
authored
Jun 27, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
eb3a732f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
wcfs/__init__.py
wcfs/__init__.py
+7
-9
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+2
-2
No files found.
wcfs/__init__.py
View file @
89546f76
...
@@ -34,10 +34,8 @@ from golang.gcompat import qq
...
@@ -34,10 +34,8 @@ from golang.gcompat import qq
from
ZODB.FileStorage
import
FileStorage
from
ZODB.FileStorage
import
FileStorage
# WCFS represents connection to wcfs server.
# Conn represents connection to wcfs server.
# XXX name -> Connection ?
class
Conn
(
object
):
class
WCFS
(
object
):
# XXX + .zurl?
# .mountpoint path to mountpoint
# .mountpoint path to mountpoint
# ._fwcfs /.wcfs opened to keep the server from going away (at least cleanly)
# ._fwcfs /.wcfs opened to keep the server from going away (at least cleanly)
...
@@ -88,7 +86,7 @@ def serve(zurl, exec_=False):
...
@@ -88,7 +86,7 @@ def serve(zurl, exec_=False):
# otherwise it starts wcfs for zurl if autostart is True or (None and system
# otherwise it starts wcfs for zurl if autostart is True or (None and system
# default for autostart is True). XXX
# default for autostart is True). XXX
#
#
# join(zurl) ->
WCFS
.
# join(zurl) ->
Conn
.
def
join
(
zurl
,
autostart
=
None
):
def
join
(
zurl
,
autostart
=
None
):
mntpt
=
_mntpt_4zurl
(
zurl
)
mntpt
=
_mntpt_4zurl
(
zurl
)
...
@@ -101,7 +99,7 @@ def join(zurl, autostart=None):
...
@@ -101,7 +99,7 @@ def join(zurl, autostart=None):
raise
raise
else
:
else
:
# already have it
# already have it
return
WCFS
(
mntpt
,
f
)
return
Conn
(
mntpt
,
f
)
# XXX autostart=None processing
# XXX autostart=None processing
if
not
autostart
:
if
not
autostart
:
...
@@ -111,7 +109,7 @@ def join(zurl, autostart=None):
...
@@ -111,7 +109,7 @@ def join(zurl, autostart=None):
# _start starts wcfs server for ZODB @ zurl.
# _start starts wcfs server for ZODB @ zurl.
#
#
# _start(zurl) ->
WCFS
# _start(zurl) ->
Conn
def
_start
(
zurl
):
def
_start
(
zurl
):
mntpt
=
_mntpt_4zurl
(
zurl
)
mntpt
=
_mntpt_4zurl
(
zurl
)
log
.
info
(
"wcfs: starting for %s ..."
,
zurl
)
log
.
info
(
"wcfs: starting for %s ..."
,
zurl
)
...
@@ -205,10 +203,10 @@ def _start(zurl):
...
@@ -205,10 +203,10 @@ def _start(zurl):
if
_
==
1
:
if
_
==
1
:
if
isinstance
(
_rx
,
file
):
if
isinstance
(
_rx
,
file
):
# mounted ok - return
WCFS
object
# mounted ok - return
Conn
object
f
=
_rx
f
=
_rx
startedok
.
close
()
startedok
.
close
()
return
WCFS
(
mntpt
,
f
)
return
Conn
(
mntpt
,
f
)
# waitmounted error
# waitmounted error
err
=
_rx
err
=
_rx
...
...
wcfs/wcfs_test.py
View file @
89546f76
...
@@ -42,11 +42,11 @@ def setup_module():
...
@@ -42,11 +42,11 @@ def setup_module():
def
teardown_module
():
def
teardown_module
():
testdb
.
teardown
()
testdb
.
teardown
()
# make sure we start every test without wcfs server running
# make sure we start every test without wcfs server running
.
def
setup_function
(
f
):
def
setup_function
(
f
):
assert
not
os
.
path
.
exists
(
testmntpt
)
assert
not
os
.
path
.
exists
(
testmntpt
)
# make sure we unmount wcfs after every test
# make sure we unmount wcfs after every test
.
def
teardown_function
(
f
):
def
teardown_function
(
f
):
mounted
=
not
subprocess
.
call
([
"mountpoint"
,
"-q"
,
testmntpt
])
mounted
=
not
subprocess
.
call
([
"mountpoint"
,
"-q"
,
testmntpt
])
if
mounted
:
if
mounted
:
...
...
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