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
14ca0ee8
Commit
14ca0ee8
authored
Jun 27, 2009
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better copying behaviour in remote.CacheFS
parent
7de29d32
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
22 deletions
+6
-22
fs/remote.py
+4
-21
fs/tests/test_s3fs.py
+1
-1
fs/wrapfs.py
+1
-0
No files found.
fs/remote.py
View file @
14ca0ee8
...
...
@@ -117,10 +117,10 @@ def cached(func):
raise
else
:
self
.
_cache_set
(
path
,
func
.
__name__
,
args
,
kwds
,(
True
,
res
))
return
res
return
copy
.
copy
(
res
)
else
:
if
not
success
:
raise
copy
.
copy
(
result
)
raise
result
else
:
return
copy
.
copy
(
result
)
return
wrapper
...
...
@@ -180,27 +180,10 @@ class CacheFS(WrapFS):
if
cache
is
None
:
return
# Adjust cached 'listdir' for parent directory.
# Currently we only do this for argment-less listdir() calls.
# There's probably a better way to manage this...
# TODO: account for whether it was added, removed, or unmoved
cache
[
""
]
.
pop
(
"getinfo"
,
None
)
cache
[
""
]
.
pop
(
"getsize"
,
None
)
if
added
:
for
(
key
,
val
)
in
list
(
cache
[
""
]
.
get
(
"listdir"
,{})
.
items
()):
if
key
==
((),()):
val
[
1
][
1
]
.
append
(
basename
(
path
))
else
:
cache
[
""
]
.
pop
(
key
,
None
)
elif
removed
:
for
(
key
,
val
)
in
list
(
cache
[
""
]
.
get
(
"listdir"
,{})
.
items
()):
if
key
==
((),()):
try
:
val
[
1
][
1
]
.
remove
(
basename
(
path
))
except
ValueError
:
pass
else
:
cache
[
""
]
.
pop
(
key
,
None
)
elif
not
unmoved
:
cache
[
""
]
.
pop
(
"listdir"
,
None
)
cache
[
""
]
.
pop
(
"listdir"
,
None
)
# Clear all cached info for the path itself.
cache
[
names
[
-
1
]]
=
{
""
:{}}
...
...
fs/tests/test_s3fs.py
View file @
14ca0ee8
...
...
@@ -17,7 +17,7 @@ from fs import s3fs
class
TestS3FS
(
unittest
.
TestCase
,
FSTestCases
,
ThreadingTestCases
):
# Disable the tests by default
#
__test__ = False
__test__
=
False
bucket
=
"test-s3fs.rfk.id.au"
...
...
fs/wrapfs.py
View file @
14ca0ee8
...
...
@@ -143,6 +143,7 @@ class WrapFS(FS):
entries
=
[]
for
e
in
self
.
wrapped_fs
.
listdir
(
self
.
_encode
(
path
),
**
kwds
):
if
info
:
e
=
e
.
copy
()
e
[
"name"
]
=
self
.
_decode
(
e
[
"name"
])
if
wildcard
is
not
None
and
not
fnmatch
(
e
[
"name"
],
wildcard
):
continue
...
...
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