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
db7cbe5e
Commit
db7cbe5e
authored
Mar 08, 2011
by
willmcgugan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix to workaround issue sending callables over xmlrpc
parent
451b1d6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
fs/base.py
+18
-15
No files found.
fs/base.py
View file @
db7cbe5e
...
@@ -791,7 +791,7 @@ class FS(object):
...
@@ -791,7 +791,7 @@ class FS(object):
:rtype: an FS object
:rtype: an FS object
"""
"""
from
fs.wrapfs.subfs
import
SubFS
from
fs.wrapfs.subfs
import
SubFS
if
not
self
.
exists
(
path
):
if
not
self
.
exists
(
path
):
raise
ResourceNotFoundError
(
path
)
raise
ResourceNotFoundError
(
path
)
...
@@ -819,19 +819,7 @@ class FS(object):
...
@@ -819,19 +819,7 @@ class FS(object):
:param ignore_errors: ignore any errors reading the directory
:param ignore_errors: ignore any errors reading the directory
"""
"""
if
wildcard
is
None
:
wildcard
=
lambda
f
:
True
elif
not
callable
(
wildcard
):
wildcard_re
=
re
.
compile
(
fnmatch
.
translate
(
wildcard
))
wildcard
=
lambda
fn
:
bool
(
wildcard_re
.
match
(
fn
))
if
dir_wildcard
is
None
:
dir_wildcard
=
lambda
f
:
True
elif
not
callable
(
dir_wildcard
):
dir_wildcard_re
=
re
.
compile
(
fnmatch
.
translate
(
dir_wildcard
))
dir_wildcard
=
lambda
fn
:
bool
(
dir_wildcard_re
.
match
(
fn
))
def
listdir
(
path
,
*
args
,
**
kwargs
):
def
listdir
(
path
,
*
args
,
**
kwargs
):
if
ignore_errors
:
if
ignore_errors
:
...
@@ -844,6 +832,18 @@ class FS(object):
...
@@ -844,6 +832,18 @@ class FS(object):
if
search
==
"breadth"
:
if
search
==
"breadth"
:
if
wildcard
is
None
:
wildcard
=
lambda
f
:
True
elif
not
callable
(
wildcard
):
wildcard_re
=
re
.
compile
(
fnmatch
.
translate
(
wildcard
))
wildcard
=
lambda
fn
:
bool
(
wildcard_re
.
match
(
fn
))
if
dir_wildcard
is
None
:
dir_wildcard
=
lambda
f
:
True
elif
not
callable
(
dir_wildcard
):
dir_wildcard_re
=
re
.
compile
(
fnmatch
.
translate
(
dir_wildcard
))
dir_wildcard
=
lambda
fn
:
bool
(
dir_wildcard_re
.
match
(
fn
))
dirs
=
[
path
]
dirs
=
[
path
]
while
dirs
:
while
dirs
:
current_path
=
dirs
.
pop
()
current_path
=
dirs
.
pop
()
...
@@ -873,7 +873,7 @@ class FS(object):
...
@@ -873,7 +873,7 @@ class FS(object):
except
ResourceNotFoundError
:
except
ResourceNotFoundError
:
# Could happen if another thread / process deletes something whilst we are walking
# Could happen if another thread / process deletes something whilst we are walking
pass
pass
yield
(
recurse_path
,
self
.
listdir
(
recurse_path
,
wildcard
=
wildcard
,
files_only
=
True
))
yield
(
recurse_path
,
listdir
(
recurse_path
,
wildcard
=
wildcard
,
files_only
=
True
))
for
p
in
recurse
(
path
):
for
p
in
recurse
(
path
):
yield
p
yield
p
...
@@ -1230,3 +1230,5 @@ def flags_to_mode(flags):
...
@@ -1230,3 +1230,5 @@ def flags_to_mode(flags):
if
flags
&
os
.
O_EXCL
:
if
flags
&
os
.
O_EXCL
:
mode
+=
"x"
mode
+=
"x"
return
mode
return
mode
\ No newline at end of file
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