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
6829f99a
Commit
6829f99a
authored
Sep 10, 2013
by
willmcgugan@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
createfile fixes
parent
cbcad9d0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
2 deletions
+8
-2
fs/base.py
+2
-2
fs/path.py
+2
-0
fs/remote.py
+1
-0
fs/tests/test_remote.py
+3
-0
No files found.
fs/base.py
View file @
6829f99a
...
...
@@ -895,12 +895,12 @@ class FS(object):
:param wipe: if True, the contents of the file will be erased
"""
with
self
.
_lock
:
if
not
wipe
and
self
.
isfile
(
path
):
return
f
=
None
try
:
f
=
self
.
open
(
path
,
'w
'
)
f
=
self
.
open
(
path
,
'wb
'
)
finally
:
if
f
is
not
None
:
f
.
close
()
...
...
fs/path.py
View file @
6829f99a
...
...
@@ -192,6 +192,8 @@ def pathcombine(path1, path2):
'foo/bar/baz'
"""
if
not
path1
:
return
path2
.
lstrip
()
return
"
%
s/
%
s"
%
(
path1
.
rstrip
(
'/'
),
path2
.
lstrip
(
'/'
))
...
...
fs/remote.py
View file @
6829f99a
...
...
@@ -103,6 +103,7 @@ class RemoteFileBuffer(FileWrapper):
# Do not use remote file object
self
.
_eof
=
True
self
.
_rfile
=
None
self
.
_changed
=
True
if
rfile
is
not
None
and
hasattr
(
rfile
,
"close"
):
rfile
.
close
()
super
(
RemoteFileBuffer
,
self
)
.
__init__
(
wrapped_file
,
mode
)
...
...
fs/tests/test_remote.py
View file @
6829f99a
...
...
@@ -30,6 +30,9 @@ class RemoteTempFS(TempFS):
Simple filesystem implementing setfilecontents
for RemoteFileBuffer tests
"""
def
__repr__
(
self
):
return
'<RemoteTempFS:
%
s>'
%
self
.
_temp_dir
def
open
(
self
,
path
,
mode
=
'rb'
,
write_on_flush
=
True
,
**
kwargs
):
if
'a'
in
mode
or
'r'
in
mode
or
'+'
in
mode
:
f
=
super
(
RemoteTempFS
,
self
)
.
open
(
path
,
mode
=
'rb'
,
**
kwargs
)
...
...
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