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
b69bf455
Commit
b69bf455
authored
Jul 21, 2008
by
willmcgugan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed problem recursion on Windows
parent
cecb6995
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
fs/browsewin.py
+3
-3
fs/fs.py
+17
-5
No files found.
fs/browsewin.py
View file @
b69bf455
...
...
@@ -29,7 +29,7 @@ class BrowseFrame(wx.Frame):
self
.
tree
.
SetItemImage
(
self
.
root_id
,
self
.
fldridx
,
wx
.
TreeItemIcon_Normal
)
self
.
tree
.
SetItemImage
(
self
.
root_id
,
self
.
fldropenidx
,
wx
.
TreeItemIcon_Expanded
)
self
.
Bind
(
wx
.
EVT_TREE_ITEM_EXPAND
ED
,
self
.
OnItemExpanded
)
self
.
Bind
(
wx
.
EVT_TREE_ITEM_EXPAND
ING
,
self
.
OnItemExpanding
)
self
.
expand
(
self
.
root_id
)
...
...
@@ -44,7 +44,6 @@ class BrowseFrame(wx.Frame):
return
if
item_data
[
'expanded'
]:
self
.
tree
.
Expand
(
item_id
)
return
paths
=
self
.
fs
.
listdir
(
path
,
absolute
=
True
)
...
...
@@ -76,9 +75,10 @@ class BrowseFrame(wx.Frame):
self
.
tree
.
Expand
(
item_id
)
def
OnItemExpand
ed
(
self
,
e
):
def
OnItemExpand
ing
(
self
,
e
):
self
.
expand
(
e
.
GetItem
())
e
.
Skip
()
def
browse
(
fs
):
...
...
fs/fs.py
View file @
b69bf455
...
...
@@ -233,7 +233,16 @@ class OSFS(FS):
def
__init__
(
self
,
root_path
):
self
.
root_path
=
os
.
path
.
abspath
(
os
.
path
.
expanduser
(
root_path
))
expanded_path
=
normpath
(
os
.
path
.
expanduser
(
root_path
))
print
expanded_path
if
not
os
.
path
.
exists
(
expanded_path
):
raise
FSError
(
"PATH_NOT_EXIST"
,
"Root path does not exist:
%(path)
s"
,
expanded_path
)
if
not
os
.
path
.
isdir
(
expanded_path
):
raise
FSError
(
"PATH_NOT_DIR"
,
"Root path is not a directory:
%(path)
s"
,
expanded_path
)
self
.
root_path
=
normpath
(
os
.
path
.
abspath
(
expanded_path
))
#print "Root path", self.root_path
def
__str__
(
self
):
...
...
@@ -429,19 +438,22 @@ class MountFS(FS):
if
__name__
==
"__main__"
:
osfs
=
OSFS
(
"~/"
)
print
osfs
#print osfs
print_fs
(
osfs
)
#print osfs.listdir("/projects/fs")
sub_fs
=
osfs
.
open_dir
(
"projects/"
)
#
sub_fs = osfs.open_dir("projects/")
print
sub_fs
#
print sub_fs
sub_fs
.
open
(
'test.txt'
)
#
sub_fs.open('test.txt')
#print sub_fs.listdir(dirs_only=True)
#print sub_fs.listdir()
print_fs
(
sub_fs
,
max_levels
=
2
)
#
print_fs(sub_fs, max_levels=2)
#for f in osfs.listdir():
# print f
...
...
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