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
bec7b020
Commit
bec7b020
authored
Sep 19, 2008
by
willmcgugan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tidy up
parent
7b27ba8b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
6 deletions
+32
-6
fs/__init__.py
+1
-2
fs/fs.py
+6
-1
fs/memoryfs.py
+7
-0
fs/mountfs.py
+5
-0
fs/multifs.py
+6
-0
fs/osfs.py
+3
-1
fs/tempfs.py
+4
-2
No files found.
fs/__init__.py
View file @
bec7b020
from
fs
import
*
from
fs
import
*
from
helpers
import
*
from
helpers
import
*
__all__
=
[
'browserwin'
,
__all__
=
[
'memoryfs'
,
'memoryfs'
,
'mountfs'
,
'mountfs'
,
'multifs'
,
'multifs'
,
'osfs'
,
'osfs'
,
...
...
fs/fs.py
View file @
bec7b020
...
@@ -732,7 +732,12 @@ class SubFS(FS):
...
@@ -732,7 +732,12 @@ class SubFS(FS):
self
.
sub_dir
=
parent
.
_abspath
(
sub_dir
)
self
.
sub_dir
=
parent
.
_abspath
(
sub_dir
)
def
__str__
(
self
):
def
__str__
(
self
):
return
"<SubFS:
\"
%
s
\"
in
%
s>"
%
(
self
.
sub_dir
,
self
.
parent
)
return
"<SubFS:
%
s in
%
s>"
%
(
self
.
sub_dir
,
self
.
parent
)
__repr__
=
__str__
def
__unicode__
(
self
):
return
unicode
(
self
.
__str__
())
def
desc
(
self
,
path
):
def
desc
(
self
,
path
):
if
self
.
isdir
(
path
):
if
self
.
isdir
(
path
):
...
...
fs/memoryfs.py
View file @
bec7b020
...
@@ -54,6 +54,11 @@ class MemoryFile(object):
...
@@ -54,6 +54,11 @@ class MemoryFile(object):
def
__str__
(
self
):
def
__str__
(
self
):
return
"<MemoryFile in
%
s
%
s>"
%
(
self
.
memory_fs
,
self
.
path
)
return
"<MemoryFile in
%
s
%
s>"
%
(
self
.
memory_fs
,
self
.
path
)
__repr__
=
__str__
def
__unicode__
(
self
):
return
unicode
(
self
.
__str__
())
def
__del__
(
self
):
def
__del__
(
self
):
if
not
self
.
closed
:
if
not
self
.
closed
:
self
.
close
()
self
.
close
()
...
@@ -156,6 +161,8 @@ class MemoryFS(FS):
...
@@ -156,6 +161,8 @@ class MemoryFS(FS):
def
__str__
(
self
):
def
__str__
(
self
):
return
"<MemoryFS>"
return
"<MemoryFS>"
__repr__
=
__str__
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
unicode
(
self
.
__str__
())
return
unicode
(
self
.
__str__
())
...
...
fs/mountfs.py
View file @
bec7b020
...
@@ -28,6 +28,11 @@ class MountFS(FS):
...
@@ -28,6 +28,11 @@ class MountFS(FS):
def
__str__
(
self
):
def
__str__
(
self
):
return
"<MountFS>"
return
"<MountFS>"
__repr__
=
__str__
def
__unicode__
(
self
):
return
unicode
(
self
.
__str__
())
def
_delegate
(
self
,
path
):
def
_delegate
(
self
,
path
):
path
=
normpath
(
path
)
path
=
normpath
(
path
)
head_path
,
object
,
tail_path
=
self
.
mount_tree
.
partialget
(
path
)
head_path
,
object
,
tail_path
=
self
.
mount_tree
.
partialget
(
path
)
...
...
fs/multifs.py
View file @
bec7b020
...
@@ -24,6 +24,12 @@ class MultiFS(FS):
...
@@ -24,6 +24,12 @@ class MultiFS(FS):
finally
:
finally
:
self
.
_lock
.
release
()
self
.
_lock
.
release
()
__repr__
=
__str__
def
__unicode__
(
self
):
return
unicode
(
self
.
__str__
())
def
addfs
(
self
,
name
,
fs
):
def
addfs
(
self
,
name
,
fs
):
"""Adds a filesystem to the MultiFS.
"""Adds a filesystem to the MultiFS.
...
...
fs/osfs.py
View file @
bec7b020
...
@@ -17,7 +17,9 @@ class OSFS(FS):
...
@@ -17,7 +17,9 @@ class OSFS(FS):
self
.
root_path
=
normpath
(
os
.
path
.
abspath
(
expanded_path
))
self
.
root_path
=
normpath
(
os
.
path
.
abspath
(
expanded_path
))
def
__str__
(
self
):
def
__str__
(
self
):
return
"<OSFS
\"
%
s
\"
>"
%
self
.
root_path
return
"<OSFS
%
s>"
%
self
.
root_path
__repr__
=
__str__
def
getsyspath
(
self
,
path
,
allow_none
=
False
):
def
getsyspath
(
self
,
path
,
allow_none
=
False
):
sys_path
=
os
.
path
.
join
(
self
.
root_path
,
makerelative
(
self
.
_resolve
(
path
)))
sys_path
=
os
.
path
.
join
(
self
.
root_path
,
makerelative
(
self
.
_resolve
(
path
)))
...
...
fs/tempfs.py
View file @
bec7b020
...
@@ -21,10 +21,12 @@ class TempFS(OSFS):
...
@@ -21,10 +21,12 @@ class TempFS(OSFS):
OSFS
.
__init__
(
self
,
self
.
_temp_dir
,
thread_syncronize
=
thread_syncronize
)
OSFS
.
__init__
(
self
,
self
.
_temp_dir
,
thread_syncronize
=
thread_syncronize
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'<TempFS: "
%
s">'
%
self
.
_temp_dir
return
'<TempFS:
%
s>'
%
self
.
_temp_dir
__repr__
=
__str__
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
uncode
(
self
.
__str__
())
return
un
i
code
(
self
.
__str__
())
def
_cleanup
(
self
):
def
_cleanup
(
self
):
"""Called by __del__ to remove the temporary directory. Can be called directly,
"""Called by __del__ to remove the temporary directory. Can be called directly,
...
...
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