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
61eb97ee
Commit
61eb97ee
authored
Jul 30, 2008
by
willmcgugan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some tweaks
parent
6a888fbc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
fs/memoryfs.py
+3
-1
fs/mountfs.py
+14
-1
No files found.
fs/memoryfs.py
View file @
61eb97ee
...
@@ -181,8 +181,10 @@ class MemoryFS(FS):
...
@@ -181,8 +181,10 @@ class MemoryFS(FS):
if
self
.
isdir
(
path
):
if
self
.
isdir
(
path
):
return
"Memory dir"
return
"Memory dir"
el
se
:
el
if
self
.
isfile
(
path
)
:
return
"Memory file object"
return
"Memory file object"
else
:
return
"No description available"
def
isdir
(
self
,
path
):
def
isdir
(
self
,
path
):
...
...
fs/mountfs.py
View file @
61eb97ee
...
@@ -57,6 +57,16 @@ class MountFS(FS):
...
@@ -57,6 +57,16 @@ class MountFS(FS):
return
self
,
path
return
self
,
path
def
desc
(
self
,
path
):
fs
,
delegate_path
=
self
.
_delegate
(
path
)
if
fs
is
self
:
return
"Mount dir"
return
"Mounted dir, maps to path
%
s on
%
s"
%
(
delegate_path
,
str
(
fs
))
def
isdir
(
self
,
path
):
def
isdir
(
self
,
path
):
fs
,
delegate_path
=
self
.
_delegate
(
path
)
fs
,
delegate_path
=
self
.
_delegate
(
path
)
...
@@ -86,7 +96,8 @@ class MountFS(FS):
...
@@ -86,7 +96,8 @@ class MountFS(FS):
self
.
mem_fs
.
mkdir
(
path
,
recursive
=
True
)
self
.
mem_fs
.
mkdir
(
path
,
recursive
=
True
)
mount_filename
=
pathjoin
(
path
,
'.mount'
)
mount_filename
=
pathjoin
(
path
,
'.mount'
)
mount
=
self
.
mem_fs
.
open
(
mount_filename
,
'w'
)
mount
=
self
.
mem_fs
.
open
(
mount_filename
,
'w'
)
mount
.
fs
=
fs
mount
.
name
=
name
mount
.
fs
=
fs
self
.
mounts
[
name
]
=
(
path
,
fs
)
self
.
mounts
[
name
]
=
(
path
,
fs
)
...
@@ -104,6 +115,7 @@ if __name__ == "__main__":
...
@@ -104,6 +115,7 @@ if __name__ == "__main__":
#print mountfs.listdir('1/2/Memroot/B/C')
#print mountfs.listdir('1/2/Memroot/B/C')
print
mountfs
.
desc
(
'1/2/Memroot/B'
)
print_fs
(
mountfs
)
print_fs
(
mountfs
)
#print mountfs._delegate('1/2/Memroot/B')
#print mountfs._delegate('1/2/Memroot/B')
\ No newline at end of file
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