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
29c816b8
Commit
29c816b8
authored
Jan 07, 2010
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix typo "syncronise" => "synchronize"
parent
5391ab4b
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
17 deletions
+17
-17
fs/__init__.py
+5
-5
fs/base.py
+1
-1
fs/memoryfs.py
+2
-2
fs/mountfs.py
+2
-2
fs/multifs.py
+2
-2
fs/osfs.py
+3
-3
fs/tempfs.py
+2
-2
No files found.
fs/__init__.py
View file @
29c816b8
...
@@ -26,19 +26,19 @@ from base import *
...
@@ -26,19 +26,19 @@ from base import *
import
errors
import
errors
import
path
import
path
_thread_syncronize_default
=
True
_thread_sync
h
ronize_default
=
True
def
set_thread_syncronize_default
(
sync
):
def
set_thread_sync
h
ronize_default
(
sync
):
"""Sets the default thread synctonisation flag.
"""Sets the default thread synctonisation flag.
FS objects are made thread-safe through the use of a per-FS threading Lock
FS objects are made thread-safe through the use of a per-FS threading Lock
object. Since this can introduce an small overhead it can be disabled with
object. Since this can introduce an small overhead it can be disabled with
this function if the code is single-threaded.
this function if the code is single-threaded.
:param sync: Set wether to use thread syncronization for new FS objects
:param sync: Set wether to use thread sync
h
ronization for new FS objects
"""
"""
global
_thread_syncronization_default
global
_thread_sync
h
ronization_default
_thread_syncronization_default
=
sync
_thread_sync
h
ronization_default
=
sync
# Store some identifiers in the fs namespace
# Store some identifiers in the fs namespace
import
os
import
os
...
...
fs/base.py
View file @
29c816b8
...
@@ -132,7 +132,7 @@ class FS(object):
...
@@ -132,7 +132,7 @@ class FS(object):
"""The base class for Filesystem objects.
"""The base class for Filesystem objects.
:param thread_synconize: If True, a lock object will be created for the object, otherwise a dummy lock will be used.
:param thread_synconize: If True, a lock object will be created for the object, otherwise a dummy lock will be used.
:type thread_syncronize: bool
:type thread_sync
h
ronize: bool
"""
"""
self
.
closed
=
False
self
.
closed
=
False
if
thread_synchronize
:
if
thread_synchronize
:
...
...
fs/memoryfs.py
View file @
29c816b8
...
@@ -12,7 +12,7 @@ File objects returned by MemoryFS.objects use StringIO objects for storage.
...
@@ -12,7 +12,7 @@ File objects returned by MemoryFS.objects use StringIO objects for storage.
import
datetime
import
datetime
from
fs.path
import
iteratepath
from
fs.path
import
iteratepath
from
fs.base
import
*
from
fs.base
import
*
from
fs
import
_thread_syncronize_default
from
fs
import
_thread_sync
h
ronize_default
try
:
try
:
from
cStringIO
import
StringIO
from
cStringIO
import
StringIO
...
@@ -180,7 +180,7 @@ class MemoryFS(FS):
...
@@ -180,7 +180,7 @@ class MemoryFS(FS):
return
self
.
dir_entry_factory
(
*
args
,
**
kwargs
)
return
self
.
dir_entry_factory
(
*
args
,
**
kwargs
)
def
__init__
(
self
,
file_factory
=
None
):
def
__init__
(
self
,
file_factory
=
None
):
super
(
MemoryFS
,
self
)
.
__init__
(
thread_synchronize
=
_thread_syncronize_default
)
super
(
MemoryFS
,
self
)
.
__init__
(
thread_synchronize
=
_thread_sync
h
ronize_default
)
self
.
dir_entry_factory
=
DirEntry
self
.
dir_entry_factory
=
DirEntry
self
.
file_factory
=
file_factory
or
MemoryFile
self
.
file_factory
=
file_factory
or
MemoryFile
...
...
fs/mountfs.py
View file @
29c816b8
...
@@ -8,7 +8,7 @@ Contains MountFS class which is a virtual Filesystem which can have other Filesy
...
@@ -8,7 +8,7 @@ Contains MountFS class which is a virtual Filesystem which can have other Filesy
from
fs.base
import
*
from
fs.base
import
*
from
fs.objecttree
import
ObjectTree
from
fs.objecttree
import
ObjectTree
from
fs
import
_thread_syncronize_default
from
fs
import
_thread_sync
h
ronize_default
class
DirMount
(
object
):
class
DirMount
(
object
):
...
@@ -34,7 +34,7 @@ class MountFS(FS):
...
@@ -34,7 +34,7 @@ class MountFS(FS):
DirMount
=
DirMount
DirMount
=
DirMount
FileMount
=
FileMount
FileMount
=
FileMount
def
__init__
(
self
,
thread_synchronize
=
_thread_syncronize_default
):
def
__init__
(
self
,
thread_synchronize
=
_thread_sync
h
ronize_default
):
FS
.
__init__
(
self
,
thread_synchronize
=
thread_synchronize
)
FS
.
__init__
(
self
,
thread_synchronize
=
thread_synchronize
)
self
.
mount_tree
=
ObjectTree
()
self
.
mount_tree
=
ObjectTree
()
...
...
fs/multifs.py
View file @
29c816b8
...
@@ -26,7 +26,7 @@ it will look for it in *templates/index.html*.
...
@@ -26,7 +26,7 @@ it will look for it in *templates/index.html*.
from
fs.base
import
FS
,
FSError
,
synchronize
from
fs.base
import
FS
,
FSError
,
synchronize
from
fs.path
import
*
from
fs.path
import
*
from
fs
import
_thread_syncronize_default
from
fs
import
_thread_sync
h
ronize_default
class
MultiFS
(
FS
):
class
MultiFS
(
FS
):
...
@@ -39,7 +39,7 @@ class MultiFS(FS):
...
@@ -39,7 +39,7 @@ class MultiFS(FS):
"""
"""
def
__init__
(
self
):
def
__init__
(
self
):
FS
.
__init__
(
self
,
thread_synchronize
=
_thread_syncronize_default
)
FS
.
__init__
(
self
,
thread_synchronize
=
_thread_sync
h
ronize_default
)
self
.
fs_sequence
=
[]
self
.
fs_sequence
=
[]
self
.
fs_lookup
=
{}
self
.
fs_lookup
=
{}
...
...
fs/osfs.py
View file @
29c816b8
...
@@ -19,7 +19,7 @@ import errno
...
@@ -19,7 +19,7 @@ import errno
from
fs.base
import
*
from
fs.base
import
*
from
fs.path
import
*
from
fs.path
import
*
from
fs
import
_thread_syncronize_default
from
fs
import
_thread_sync
h
ronize_default
try
:
try
:
import
xattr
import
xattr
...
@@ -41,14 +41,14 @@ class OSFS(FS):
...
@@ -41,14 +41,14 @@ class OSFS(FS):
methods in the os and os.path modules.
methods in the os and os.path modules.
"""
"""
def
__init__
(
self
,
root_path
,
dir_mode
=
0700
,
thread_synchronize
=
_thread_syncronize_default
,
encoding
=
None
):
def
__init__
(
self
,
root_path
,
dir_mode
=
0700
,
thread_synchronize
=
_thread_sync
h
ronize_default
,
encoding
=
None
):
"""
"""
Creates an FS object that represents the OS Filesystem under a given root path
Creates an FS object that represents the OS Filesystem under a given root path
:param root_path: The root OS path
:param root_path: The root OS path
:param dir_mode: srt
:param dir_mode: srt
:param thread_syncronize: If True, this object will be thread-safe by use of a threading.Lock object
:param thread_sync
h
ronize: If True, this object will be thread-safe by use of a threading.Lock object
:param encoding: The encoding method for path strings
:param encoding: The encoding method for path strings
"""
"""
...
...
fs/tempfs.py
View file @
29c816b8
...
@@ -12,14 +12,14 @@ import tempfile
...
@@ -12,14 +12,14 @@ import tempfile
from
fs.osfs
import
OSFS
from
fs.osfs
import
OSFS
from
fs.errors
import
*
from
fs.errors
import
*
from
fs
import
_thread_syncronize_default
from
fs
import
_thread_sync
h
ronize_default
class
TempFS
(
OSFS
):
class
TempFS
(
OSFS
):
"""Create a Filesystem in a tempory directory (with tempfile.mkdtemp),
"""Create a Filesystem in a tempory directory (with tempfile.mkdtemp),
and removes it when the TempFS object is cleaned up."""
and removes it when the TempFS object is cleaned up."""
def
__init__
(
self
,
identifier
=
None
,
temp_dir
=
None
,
dir_mode
=
0700
,
thread_synchronize
=
_thread_syncronize_default
):
def
__init__
(
self
,
identifier
=
None
,
temp_dir
=
None
,
dir_mode
=
0700
,
thread_synchronize
=
_thread_sync
h
ronize_default
):
"""Creates a temporary Filesystem
"""Creates a temporary Filesystem
identifier -- A string that is included in the name of the temporary directory,
identifier -- A string that is included in the name of the temporary directory,
...
...
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