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
e0dd1077
Commit
e0dd1077
authored
Sep 07, 2008
by
willmcgugan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some enhancements
parent
42961816
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletions
+17
-1
fs/fs.py
+16
-1
fs/tests.py
+1
-0
No files found.
fs/fs.py
View file @
e0dd1077
...
@@ -335,7 +335,22 @@ class FS(object):
...
@@ -335,7 +335,22 @@ class FS(object):
return
"OS file, maps to
%
s"
%
sys_path
return
"OS file, maps to
%
s"
%
sys_path
def
open
(
self
,
path
,
mode
=
"r"
,
**
kwargs
):
def
open
(
self
,
path
,
mode
=
"r"
,
**
kwargs
):
raise
UNSUPPORTED_ERROR
(
"UNSUPPORTED"
)
raise
UnsupportedError
(
"UNSUPPORTED"
)
def
getcontents
(
self
,
path
):
"""Returns the contents of a file as a string.
path -- path of file to read.
"""
f
=
None
try
:
f
=
self
.
open
(
path
,
"rb"
)
contents
=
f
.
read
()
return
contents
finally
:
if
f
is
not
None
:
f
.
close
()
def
opendir
(
self
,
path
):
def
opendir
(
self
,
path
):
if
not
self
.
exists
(
path
):
if
not
self
.
exists
(
path
):
...
...
fs/tests.py
View file @
e0dd1077
...
@@ -405,6 +405,7 @@ class TestOSFS(unittest.TestCase):
...
@@ -405,6 +405,7 @@ class TestOSFS(unittest.TestCase):
word
=
f7
.
read
(
7
)
word
=
f7
.
read
(
7
)
self
.
assertEqual
(
word
,
"complex"
)
self
.
assertEqual
(
word
,
"complex"
)
f7
.
close
()
f7
.
close
()
self
.
assertEqual
(
self
.
fs
.
getcontents
(
"a.txt"
),
all_strings
)
class
TestSubFS
(
TestOSFS
):
class
TestSubFS
(
TestOSFS
):
...
...
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