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
17b72215
Commit
17b72215
authored
Mar 11, 2011
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some python2.5 compatability fixes; thanks Andrew Scheller
parent
a3a4bd92
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
7 deletions
+20
-7
fs/expose/sftp.py
+2
-0
fs/expose/wsgi/wsgi.py
+2
-3
fs/ftpfs.py
+1
-1
fs/osfs/watch_inotify.py
+4
-0
fs/path.py
+2
-2
fs/wrapfs/lazyfs.py
+9
-1
No files found.
fs/expose/sftp.py
View file @
17b72215
...
@@ -24,6 +24,8 @@ is, you probably don't want to use it.
...
@@ -24,6 +24,8 @@ is, you probably don't want to use it.
"""
"""
from
__future__
import
with_statement
import
os
import
os
import
stat
as
statinfo
import
stat
as
statinfo
import
time
import
time
...
...
fs/expose/wsgi/wsgi.py
View file @
17b72215
import
json
import
urlparse
import
urlparse
import
mimetypes
import
mimetypes
...
@@ -144,4 +144,4 @@ def serve_fs(fs, indexes=True):
...
@@ -144,4 +144,4 @@ def serve_fs(fs, indexes=True):
"""Serves an FS object via WSGI"""
"""Serves an FS object via WSGI"""
application
=
WSGIServer
(
fs
,
indexes
)
application
=
WSGIServer
(
fs
,
indexes
)
return
application
return
application
\ No newline at end of file
fs/ftpfs.py
View file @
17b72215
...
@@ -957,7 +957,7 @@ class FTPFS(FS):
...
@@ -957,7 +957,7 @@ class FTPFS(FS):
def
_open_ftp
(
self
):
def
_open_ftp
(
self
):
try
:
try
:
ftp
=
FTP
()
ftp
=
FTP
()
if
self
.
default_timeout
:
if
self
.
default_timeout
or
sys
.
version_info
<
(
2
,
6
,)
:
ftp
.
connect
(
self
.
host
,
self
.
port
)
ftp
.
connect
(
self
.
host
,
self
.
port
)
else
:
else
:
ftp
.
connect
(
self
.
host
,
self
.
port
,
self
.
timeout
)
ftp
.
connect
(
self
.
host
,
self
.
port
,
self
.
timeout
)
...
...
fs/osfs/watch_inotify.py
View file @
17b72215
...
@@ -24,6 +24,10 @@ except Exception, e:
...
@@ -24,6 +24,10 @@ except Exception, e:
if
isinstance
(
e
,
ImportError
):
if
isinstance
(
e
,
ImportError
):
raise
raise
raise
ImportError
(
"could not import pyinotify"
)
raise
ImportError
(
"could not import pyinotify"
)
try
:
pyinotify
.
WatchManager
.
get_fd
except
AttributeError
:
raise
ImportError
(
"pyinotify version is too old"
)
class
OSFSWatchMixin
(
WatchableFSMixin
):
class
OSFSWatchMixin
(
WatchableFSMixin
):
...
...
fs/path.py
View file @
17b72215
...
@@ -573,8 +573,8 @@ def iswildcard(path):
...
@@ -573,8 +573,8 @@ def iswildcard(path):
"""
"""
assert
path
is
not
None
assert
path
is
not
None
base_chars
=
frozenset
(
basename
(
path
))
base_chars
=
frozenset
(
basename
(
path
))
return
not
base_chars
.
isdisjoint
(
_wild_chars
)
return
bool
(
base_chars
.
intersection
(
_wild_chars
))
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
print
recursepath
(
'a/b/c'
)
print
recursepath
(
'a/b/c'
)
fs/wrapfs/lazyfs.py
View file @
17b72215
...
@@ -36,7 +36,15 @@ class LazyFS(WrapFS):
...
@@ -36,7 +36,15 @@ class LazyFS(WrapFS):
try
:
try
:
wrapped_fs
=
self
.
__dict__
[
"wrapped_fs"
]
wrapped_fs
=
self
.
__dict__
[
"wrapped_fs"
]
except
KeyError
:
except
KeyError
:
return
u"<LazyFS:
%
s>"
%
(
self
.
_fsclass
,)
# It appears that python2.5 has trouble printing out
# classes that define a __unicode__ method.
try
:
return
u"<LazyFS:
%
s>"
%
(
self
.
_fsclass
,)
except
TypeError
:
try
:
return
u"<LazyFS:
%
s>"
%
(
self
.
_fsclass
.
__name__
,)
except
AttributeError
:
return
u"<LazyFS: <unprintable>>"
else
:
else
:
return
u"<LazyFS:
%
s>"
%
(
wrapped_fs
,)
return
u"<LazyFS:
%
s>"
%
(
wrapped_fs
,)
...
...
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