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
4b97c220
Commit
4b97c220
authored
Mar 08, 2011
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix handling of callable wildcards in RPCFS
parent
9b689b6b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
fs/base.py
+2
-2
fs/rpcfs.py
+15
-3
No files found.
fs/base.py
View file @
4b97c220
...
@@ -830,8 +830,6 @@ class FS(object):
...
@@ -830,8 +830,6 @@ class FS(object):
else
:
else
:
return
self
.
listdir
(
path
,
*
args
,
**
kwargs
)
return
self
.
listdir
(
path
,
*
args
,
**
kwargs
)
if
search
==
"breadth"
:
if
wildcard
is
None
:
if
wildcard
is
None
:
wildcard
=
lambda
f
:
True
wildcard
=
lambda
f
:
True
elif
not
callable
(
wildcard
):
elif
not
callable
(
wildcard
):
...
@@ -844,6 +842,8 @@ class FS(object):
...
@@ -844,6 +842,8 @@ class FS(object):
dir_wildcard_re
=
re
.
compile
(
fnmatch
.
translate
(
dir_wildcard
))
dir_wildcard_re
=
re
.
compile
(
fnmatch
.
translate
(
dir_wildcard
))
dir_wildcard
=
lambda
fn
:
bool
(
dir_wildcard_re
.
match
(
fn
))
dir_wildcard
=
lambda
fn
:
bool
(
dir_wildcard_re
.
match
(
fn
))
if
search
==
"breadth"
:
dirs
=
[
path
]
dirs
=
[
path
]
while
dirs
:
while
dirs
:
current_path
=
dirs
.
pop
()
current_path
=
dirs
.
pop
()
...
...
fs/rpcfs.py
View file @
4b97c220
...
@@ -210,9 +210,21 @@ class RPCFS(FS):
...
@@ -210,9 +210,21 @@ class RPCFS(FS):
return
self
.
proxy
.
isfile
(
path
)
return
self
.
proxy
.
isfile
(
path
)
def
listdir
(
self
,
path
=
"./"
,
wildcard
=
None
,
full
=
False
,
absolute
=
False
,
dirs_only
=
False
,
files_only
=
False
):
def
listdir
(
self
,
path
=
"./"
,
wildcard
=
None
,
full
=
False
,
absolute
=
False
,
dirs_only
=
False
,
files_only
=
False
):
path
=
self
.
encode_path
(
path
)
enc_path
=
self
.
encode_path
(
path
)
entries
=
self
.
proxy
.
listdir
(
path
,
wildcard
,
full
,
absolute
,
dirs_only
,
files_only
)
if
not
callable
(
wildcard
):
return
[
self
.
decode_path
(
e
)
for
e
in
entries
]
entries
=
self
.
proxy
.
listdir
(
enc_path
,
wildcard
,
full
,
absolute
,
dirs_only
,
files_only
)
entries
=
[
self
.
decode_path
(
e
)
for
e
in
entries
]
else
:
entries
=
self
.
proxy
.
listdir
(
enc_path
,
None
,
False
,
False
,
dirs_only
,
files_only
)
entries
=
[
self
.
decode_path
(
e
)
for
e
in
entries
]
entries
=
[
e
for
e
in
entries
if
wildcard
(
e
)]
if
full
:
entries
=
[
relpath
(
pathjoin
(
path
,
e
))
for
e
in
entries
]
elif
absolute
:
entries
=
[
abspath
(
pathjoin
(
path
,
e
))
for
e
in
entries
]
return
entries
def
makedir
(
self
,
path
,
recursive
=
False
,
allow_recreate
=
False
):
def
makedir
(
self
,
path
,
recursive
=
False
,
allow_recreate
=
False
):
path
=
self
.
encode_path
(
path
)
path
=
self
.
encode_path
(
path
)
...
...
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