Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
a9aecf14
Commit
a9aecf14
authored
Feb 24, 2011
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuse: replace debugging prints with logger
parent
20ad1a03
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
10 deletions
+24
-10
fs/__init__.py
+1
-1
fs/expose/fuse/__init__.py
+23
-9
No files found.
fs/__init__.py
View file @
a9aecf14
...
@@ -15,7 +15,7 @@ implementations of this interface such as:
...
@@ -15,7 +15,7 @@ implementations of this interface such as:
"""
"""
__version__
=
"0.4.0a1
1
"
__version__
=
"0.4.0a1
2
"
__author__
=
"Will McGugan (will@willmcgugan.com)"
__author__
=
"Will McGugan (will@willmcgugan.com)"
# 'base' imports * from 'path' and 'errors', so their
# 'base' imports * from 'path' and 'errors', so their
...
...
fs/expose/fuse/__init__.py
View file @
a9aecf14
...
@@ -56,7 +56,10 @@ import errno
...
@@ -56,7 +56,10 @@ import errno
import
time
import
time
import
stat
as
statinfo
import
stat
as
statinfo
import
subprocess
import
subprocess
import
pickle
import
cPickle
import
logging
logger
=
logging
.
getLogger
(
"fs.expose.fuse"
)
from
fs.base
import
flags_to_mode
,
threading
from
fs.base
import
flags_to_mode
,
threading
from
fs.errors
import
*
from
fs.errors
import
*
...
@@ -92,7 +95,14 @@ def handle_fs_errors(func):
...
@@ -92,7 +95,14 @@ def handle_fs_errors(func):
func
=
convert_fs_errors
(
func
)
func
=
convert_fs_errors
(
func
)
@wraps
(
func
)
@wraps
(
func
)
def
wrapper
(
*
args
,
**
kwds
):
def
wrapper
(
*
args
,
**
kwds
):
#logger.debug("CALL %r %s",name,repr(args))
try
:
res
=
func
(
*
args
,
**
kwds
)
res
=
func
(
*
args
,
**
kwds
)
except
Exception
:
#logger.exception("ERR %r %s",name,repr(args))
raise
else
:
#logger.exception("OK %r %s %r",name,repr(args),res)
if
res
is
None
:
if
res
is
None
:
return
0
return
0
return
res
return
res
...
@@ -515,16 +525,20 @@ class MountProcess(subprocess.Popen):
...
@@ -515,16 +525,20 @@ class MountProcess(subprocess.Popen):
def
__init__
(
self
,
fs
,
path
,
fuse_opts
=
{},
nowait
=
False
,
**
kwds
):
def
__init__
(
self
,
fs
,
path
,
fuse_opts
=
{},
nowait
=
False
,
**
kwds
):
self
.
path
=
path
self
.
path
=
path
if
nowait
or
kwds
.
get
(
"close_fds"
,
False
):
if
nowait
or
kwds
.
get
(
"close_fds"
,
False
):
cmd
=
'from fs.expose.fuse import MountProcess; '
cmd
=
'import cPickle; '
cmd
=
cmd
+
'MountProcess._do_mount_nowait(
%
s)'
cmd
=
cmd
+
'data = cPickle.loads(
%
s); '
cmd
=
cmd
%
(
repr
(
pickle
.
dumps
((
fs
,
path
,
fuse_opts
),
-
1
)),)
cmd
=
cmd
+
'from fs.expose.fuse import MountProcess; '
cmd
=
cmd
+
'MountProcess._do_mount_nowait(data)'
cmd
=
cmd
%
(
repr
(
cPickle
.
dumps
((
fs
,
path
,
fuse_opts
),
-
1
)),)
cmd
=
[
sys
.
executable
,
"-c"
,
cmd
]
cmd
=
[
sys
.
executable
,
"-c"
,
cmd
]
super
(
MountProcess
,
self
)
.
__init__
(
cmd
,
**
kwds
)
super
(
MountProcess
,
self
)
.
__init__
(
cmd
,
**
kwds
)
else
:
else
:
(
r
,
w
)
=
os
.
pipe
()
(
r
,
w
)
=
os
.
pipe
()
cmd
=
'from fs.expose.fuse import MountProcess; '
cmd
=
'import cPickle; '
cmd
=
cmd
+
'MountProcess._do_mount_wait(
%
s)'
cmd
=
cmd
+
'data = cPickle.loads(
%
s); '
cmd
=
cmd
%
(
repr
(
pickle
.
dumps
((
fs
,
path
,
fuse_opts
,
r
,
w
),
-
1
)),)
cmd
=
cmd
+
'from fs.expose.fuse import MountProcess; '
cmd
=
cmd
+
'MountProcess._do_mount_wait(data)'
cmd
=
cmd
%
(
repr
(
cPickle
.
dumps
((
fs
,
path
,
fuse_opts
,
r
,
w
),
-
1
)),)
cmd
=
[
sys
.
executable
,
"-c"
,
cmd
]
cmd
=
[
sys
.
executable
,
"-c"
,
cmd
]
super
(
MountProcess
,
self
)
.
__init__
(
cmd
,
**
kwds
)
super
(
MountProcess
,
self
)
.
__init__
(
cmd
,
**
kwds
)
os
.
close
(
w
)
os
.
close
(
w
)
...
@@ -560,7 +574,7 @@ class MountProcess(subprocess.Popen):
...
@@ -560,7 +574,7 @@ class MountProcess(subprocess.Popen):
@staticmethod
@staticmethod
def
_do_mount_nowait
(
data
):
def
_do_mount_nowait
(
data
):
"""Perform the specified mount, return without waiting."""
"""Perform the specified mount, return without waiting."""
(
fs
,
path
,
opts
)
=
pickle
.
loads
(
data
)
(
fs
,
path
,
opts
)
=
data
opts
[
"foreground"
]
=
True
opts
[
"foreground"
]
=
True
def
unmount_callback
():
def
unmount_callback
():
fs
.
close
()
fs
.
close
()
...
@@ -570,7 +584,7 @@ class MountProcess(subprocess.Popen):
...
@@ -570,7 +584,7 @@ class MountProcess(subprocess.Popen):
@staticmethod
@staticmethod
def
_do_mount_wait
(
data
):
def
_do_mount_wait
(
data
):
"""Perform the specified mount, signalling when ready."""
"""Perform the specified mount, signalling when ready."""
(
fs
,
path
,
opts
,
r
,
w
)
=
pickle
.
loads
(
data
)
(
fs
,
path
,
opts
,
r
,
w
)
=
data
os
.
close
(
r
)
os
.
close
(
r
)
opts
[
"foreground"
]
=
True
opts
[
"foreground"
]
=
True
successful
=
[]
successful
=
[]
...
...
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