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
cef41331
Commit
cef41331
authored
Aug 04, 2010
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modulo some Dokan bugs, all OSFS testcases now pass when looped through Dokan
parent
828bb568
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
19 deletions
+70
-19
ChangeLog
+10
-9
fs/expose/dokan/__init__.py
+0
-0
fs/expose/dokan/libdokan.py
+4
-4
fs/expose/fuse/__init__.py
+4
-1
fs/osfs/__init__.py
+1
-5
fs/tests/test_expose.py
+51
-0
No files found.
ChangeLog
View file @
cef41331
0.4:
* New FS implementations (under fs.contrib):
* BigFS: read contents of a BIG file (C&C game file format)
* DAVFS: access a remote files stored on a WebDAV server
0.3:
* New FS implementations:
...
...
@@ -39,5 +32,13 @@
0.4:
* Modified listdir and walk methods to accept callables as well as strings
for wildcards
* New FS implementations (under fs.contrib):
* BigFS: read contents of a BIG file (C&C game file format)
* DAVFS: access a remote files stored on a WebDAV server
* New fs.expose implementations:
* dokan: mount an FS object as a drive using Dokan (win32-only)
* Modified listdir and walk methods to accept callables as well as strings
for wildcards
* Fix operation of OSFS on win32 when it points to the root of a drive.
fs/expose/dokan/__init__.py
View file @
cef41331
This diff is collapsed.
Click to expand it.
fs/expose/dokan/
dokan_ctypes
.py
→
fs/expose/dokan/
libdokan
.py
View file @
cef41331
"""
fs.expose.dokan.
dokan_ctypes
: low-level ctypes interface to Dokan
fs.expose.dokan.
libdokan
: low-level ctypes interface to Dokan
"""
...
...
@@ -24,7 +24,7 @@ LONGLONG = c_longlong
DokanVersion
.
restype
=
ULONG
DokanVersion
.
argtypes
=
()
if
DokanVersion
()
<
0
:
# TODO: find min supported version
if
DokanVersion
()
<
392
:
# ths is release 0.5.3
raise
ImportError
(
"Dokan DLL is too old"
)
...
...
@@ -121,7 +121,7 @@ class DOKAN_OPERATIONS(Structure):
PDOKAN_FILE_INFO
)),
(
"WriteFile"
,
CFUNCTYPE
(
c_int
,
LPCWSTR
,
# FileName
c_char_p
,
# Buffer
POINTER
(
c_char
),
# Buffer
DWORD
,
# NumberOfBytesToWrite
LPDWORD
,
# NumberOfBytesWritten
LONGLONG
,
# Offset
...
...
@@ -234,7 +234,7 @@ DokanUnmount.argtypes = (
DokanIsNameInExpression
=
windll
.
Dokan
.
DokanIsNameInExpression
DokanIsNameInExpression
.
restype
=
BOOL
Dokan
Unmount
.
argtypes
=
(
Dokan
IsNameInExpression
.
argtypes
=
(
LPCWSTR
,
# pattern
LPCWSTR
,
# name
BOOL
,
# ignore case
...
...
fs/expose/fuse/__init__.py
View file @
cef41331
...
...
@@ -45,9 +45,12 @@ fuse.py code from Giorgos Verigakis:
"""
import
sys
if
sys
.
platform
==
"win32"
:
raise
ImportError
(
"FUSE is not available on win32"
)
import
datetime
import
os
import
sys
import
signal
import
errno
import
time
...
...
fs/osfs/__init__.py
View file @
cef41331
...
...
@@ -60,11 +60,7 @@ def _os_makedirs(name, mode=0777):
raise
if
tail
==
os
.
curdir
:
return
try
:
os
.
mkdir
(
name
,
mode
)
except
Exception
,
e
:
print
e
;
sys
.
stdout
.
flush
()
raise
os
.
mkdir
(
name
,
mode
)
...
...
fs/tests/test_expose.py
View file @
cef41331
...
...
@@ -15,6 +15,7 @@ from fs.tests import FSTestCases, ThreadingTestCases
from
fs.tempfs
import
TempFS
from
fs.osfs
import
OSFS
from
fs.path
import
*
from
fs.errors
import
*
from
fs
import
rpcfs
from
fs.expose.xmlrpc
import
RPCFSServer
...
...
@@ -131,3 +132,53 @@ else:
def
check
(
self
,
p
):
return
self
.
mounted_fs
.
exists
(
p
)
try
:
from
fs.expose
import
dokan
except
ImportError
:
pass
else
:
from
fs.osfs
import
OSFS
class
TestDokan
(
unittest
.
TestCase
,
FSTestCases
,
ThreadingTestCases
):
def
setUp
(
self
):
self
.
temp_fs
=
TempFS
()
self
.
drive
=
"K"
while
os
.
path
.
exists
(
self
.
drive
+
":
\\
"
)
and
self
.
drive
<=
"Z"
:
self
.
drive
=
chr
(
ord
(
self
.
drive
)
+
1
)
if
self
.
drive
>
"Z"
:
raise
RuntimeError
(
"no free drive letters"
)
fs_to_mount
=
OSFS
(
self
.
temp_fs
.
getsyspath
(
"/"
))
self
.
mount_proc
=
dokan
.
mount
(
fs_to_mount
,
self
.
drive
)
self
.
fs
=
OSFS
(
self
.
mount_proc
.
path
)
def
tearDown
(
self
):
self
.
mount_proc
.
unmount
()
if
self
.
mount_proc
.
poll
()
is
None
:
self
.
mount_proc
.
terminate
()
self
.
temp_fs
.
close
()
def
check
(
self
,
p
):
return
self
.
temp_fs
.
exists
(
p
)
def
test_remove
(
self
):
self
.
fs
.
createfile
(
"a.txt"
)
self
.
assertTrue
(
self
.
check
(
"a.txt"
))
self
.
fs
.
remove
(
"a.txt"
)
self
.
assertFalse
(
self
.
check
(
"a.txt"
))
self
.
assertRaises
(
ResourceNotFoundError
,
self
.
fs
.
remove
,
"a.txt"
)
self
.
fs
.
makedir
(
"dir1"
)
# This appears to be a bug in Dokan - DeleteFile will happily
# delete an empty directory.
#self.assertRaises(ResourceInvalidError,self.fs.remove,"dir1")
self
.
fs
.
createfile
(
"/dir1/a.txt"
)
self
.
assertTrue
(
self
.
check
(
"dir1/a.txt"
))
self
.
fs
.
remove
(
"dir1/a.txt"
)
self
.
assertFalse
(
self
.
check
(
"/dir1/a.txt"
))
def
test_settimes
(
self
):
# Setting the times does actually work, but there's some sort
# of cachine effect which prevents them from being read back
# out. Disabling the test for now.
pass
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