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
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
from
ZODB.FileStorage
import
FileStorage
# WCFS represents connection to wcfs server.
# XXX name -> Connection ?
class
WCFS
(
object
):
# XXX + .zurl?
# Conn represents connection to wcfs server.
class
Conn
(
object
):
# .mountpoint path to mountpoint
# ._fwcfs /.wcfs opened to keep the server from going away (at least cleanly)
...
...
@@ -88,7 +86,7 @@ def serve(zurl, exec_=False):
# otherwise it starts wcfs for zurl if autostart is True or (None and system
# default for autostart is True). XXX
#
# join(zurl) ->
WCFS
.
# join(zurl) ->
Conn
.
def
join
(
zurl
,
autostart
=
None
):
mntpt
=
_mntpt_4zurl
(
zurl
)
...
...
@@ -101,7 +99,7 @@ def join(zurl, autostart=None):
raise
else
:
# already have it
return
WCFS
(
mntpt
,
f
)
return
Conn
(
mntpt
,
f
)
# XXX autostart=None processing
if
not
autostart
:
...
...
@@ -111,7 +109,7 @@ def join(zurl, autostart=None):
# _start starts wcfs server for ZODB @ zurl.
#
# _start(zurl) ->
WCFS
# _start(zurl) ->
Conn
def
_start
(
zurl
):
mntpt
=
_mntpt_4zurl
(
zurl
)
log
.
info
(
"wcfs: starting for %s ..."
,
zurl
)
...
...
@@ -205,10 +203,10 @@ def _start(zurl):
if
_
==
1
:
if
isinstance
(
_rx
,
file
):
# mounted ok - return
WCFS
object
# mounted ok - return
Conn
object
f
=
_rx
startedok
.
close
()
return
WCFS
(
mntpt
,
f
)
return
Conn
(
mntpt
,
f
)
# waitmounted error
err
=
_rx
...
...
wcfs/wcfs_test.py
View file @
89546f76
...
...
@@ -42,11 +42,11 @@ def setup_module():
def
teardown_module
():
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
):
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
):
mounted
=
not
subprocess
.
call
([
"mountpoint"
,
"-q"
,
testmntpt
])
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