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
e91c3e81
Commit
e91c3e81
authored
Sep 06, 2010
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some corner cases in osfs/watch_win32.py
parent
d7759718
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
5 deletions
+18
-5
fs/__init__.py
+1
-1
fs/base.py
+1
-0
fs/errors.py
+2
-0
fs/osfs/watch_win32.py
+13
-4
fs/tempfs.py
+1
-0
No files found.
fs/__init__.py
View file @
e91c3e81
...
@@ -15,7 +15,7 @@ implementations of this interface such as:
...
@@ -15,7 +15,7 @@ implementations of this interface such as:
"""
"""
__version__
=
"0.
3.0
"
__version__
=
"0.
4.0a1
"
__author__
=
"Will McGugan (will@willmcgugan.com)"
__author__
=
"Will McGugan (will@willmcgugan.com)"
# 'base' imports * from 'path' and 'errors', so their
# 'base' imports * from 'path' and 'errors', so their
...
...
fs/base.py
View file @
e91c3e81
...
@@ -424,6 +424,7 @@ class FS(object):
...
@@ -424,6 +424,7 @@ class FS(object):
"""
"""
raise
UnsupportedError
(
"rename resource"
)
raise
UnsupportedError
(
"rename resource"
)
@convert_os_errors
def
settimes
(
self
,
path
,
accessed_time
=
None
,
modified_time
=
None
):
def
settimes
(
self
,
path
,
accessed_time
=
None
,
modified_time
=
None
):
"""Set the accessed time and modified time of a file
"""Set the accessed time and modified time of a file
...
...
fs/errors.py
View file @
e91c3e81
...
@@ -233,6 +233,8 @@ def convert_os_errors(func):
...
@@ -233,6 +233,8 @@ def convert_os_errors(func):
raise
StorageSpaceError
(
opname
,
details
=
e
),
None
,
tb
raise
StorageSpaceError
(
opname
,
details
=
e
),
None
,
tb
if
e
.
errno
==
errno
.
EPERM
:
if
e
.
errno
==
errno
.
EPERM
:
raise
PermissionDeniedError
(
opname
,
details
=
e
),
None
,
tb
raise
PermissionDeniedError
(
opname
,
details
=
e
),
None
,
tb
if
e
.
errno
==
errno
.
ENOSYS
:
raise
UnsupportedError
(
opname
,
details
=
e
),
None
,
tb
if
e
.
errno
==
errno
.
EACCES
:
if
e
.
errno
==
errno
.
EACCES
:
if
sys
.
platform
==
"win32"
:
if
sys
.
platform
==
"win32"
:
if
e
.
args
[
0
]
and
e
.
args
[
0
]
==
32
:
if
e
.
args
[
0
]
and
e
.
args
[
0
]
==
32
:
...
...
fs/osfs/watch_win32.py
View file @
e91c3e81
"""
"""
fs.osfs.watch_win32
fs.osfs.watch_win32
=============
=============
======
Change watcher support for OSFS, using ReadDirectoryChangesW on win32.
Change watcher support for OSFS, using ReadDirectoryChangesW on win32.
...
@@ -359,7 +359,11 @@ class WatchThread(threading.Thread):
...
@@ -359,7 +359,11 @@ class WatchThread(threading.Thread):
traceback
.
print_exc
()
traceback
.
print_exc
()
else
:
else
:
if
iocpkey
.
value
>
1
:
if
iocpkey
.
value
>
1
:
try
:
w
=
self
.
watched_directories
[
iocpkey
.
value
]
w
=
self
.
watched_directories
[
iocpkey
.
value
]
except
KeyError
:
pass
else
:
w
.
complete
(
nbytes
.
value
)
w
.
complete
(
nbytes
.
value
)
w
.
post
()
w
.
post
()
elif
not
self
.
closed
:
elif
not
self
.
closed
:
...
@@ -405,11 +409,13 @@ class OSFSWatchMixin(WatchableFSMixin):
...
@@ -405,11 +409,13 @@ class OSFSWatchMixin(WatchableFSMixin):
try
:
try
:
path
=
self
.
unsyspath
(
path
)
path
=
self
.
unsyspath
(
path
)
except
ValueError
:
except
ValueError
:
raise
pass
else
:
else
:
if
event_class
in
(
MOVED_SRC
,
MOVED_DST
)
and
args
and
args
[
0
]:
args
=
(
self
.
unsyspath
(
args
[
0
]),)
+
args
[
1
:]
event
=
event_class
(
self
,
path
,
*
args
,
**
kwds
)
event
=
event_class
(
self
,
path
,
*
args
,
**
kwds
)
w
.
handle_event
(
event
)
w
.
handle_event
(
event
)
w
.
_watch_obj
=
wt
.
add_watcher
(
handle_event
,
syspath
,
w
.
events
,
w
.
recursive
)
w
.
_watch_obj
s
=
wt
.
add_watcher
(
handle_event
,
syspath
,
w
.
events
,
w
.
recursive
)
return
w
return
w
@convert_os_errors
@convert_os_errors
...
@@ -420,7 +426,8 @@ class OSFSWatchMixin(WatchableFSMixin):
...
@@ -420,7 +426,8 @@ class OSFSWatchMixin(WatchableFSMixin):
else
:
else
:
watchers
=
self
.
_find_watchers
(
watcher_or_callback
)
watchers
=
self
.
_find_watchers
(
watcher_or_callback
)
for
watcher
in
watchers
:
for
watcher
in
watchers
:
wt
.
del_watcher
(
watcher
.
_watch_obj
)
for
wobj
in
watcher
.
_watch_objs
:
wt
.
del_watcher
(
wobj
)
super
(
OSFSWatchMixin
,
self
)
.
del_watcher
(
watcher
)
super
(
OSFSWatchMixin
,
self
)
.
del_watcher
(
watcher
)
if
not
wt
.
watched_directories
:
if
not
wt
.
watched_directories
:
self
.
__shutdown_watch_thread
()
self
.
__shutdown_watch_thread
()
...
@@ -451,6 +458,8 @@ class OSFSWatchMixin(WatchableFSMixin):
...
@@ -451,6 +458,8 @@ class OSFSWatchMixin(WatchableFSMixin):
OSFSWatchMixin
.
__watch_thread
.
close
()
OSFSWatchMixin
.
__watch_thread
.
close
()
except
EnvironmentError
:
except
EnvironmentError
:
pass
pass
else
:
OSFSWatchMixin
.
__watch_thread
.
join
()
OSFSWatchMixin
.
__watch_thread
=
None
OSFSWatchMixin
.
__watch_thread
=
None
finally
:
finally
:
self
.
__watch_lock
.
release
()
self
.
__watch_lock
.
release
()
...
...
fs/tempfs.py
View file @
e91c3e81
...
@@ -47,6 +47,7 @@ class TempFS(OSFS):
...
@@ -47,6 +47,7 @@ class TempFS(OSFS):
Note that once this method has been called, the FS object may
Note that once this method has been called, the FS object may
no longer be used.
no longer be used.
"""
"""
super
(
TempFS
,
self
)
.
close
()
# Depending on how resources are freed by the OS, there could
# Depending on how resources are freed by the OS, there could
# be some transient errors when freeing a TempFS soon after it
# be some transient errors when freeing a TempFS soon after it
# was used. If they occur, do a small sleep and try again.
# was used. If they occur, do a small sleep and try again.
...
...
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