Commit 69ab86f7 by willmcgugan

Added "thread_safe" meta value

parent ca009f83
...@@ -178,7 +178,7 @@ class FS(object): ...@@ -178,7 +178,7 @@ class FS(object):
""" """
pass pass
# Depricating cache_hint in favour of no underscore version, for consistency # Deprecating cache_hint in favour of no underscore version, for consistency
cache_hint = cachehint cache_hint = cachehint
def close(self): def close(self):
...@@ -225,6 +225,7 @@ class FS(object): ...@@ -225,6 +225,7 @@ class FS(object):
following are common: following are common:
* *read_only* True if the file system cannot be modified * *read_only* True if the file system cannot be modified
* *thread_safe* True if the implementation is thread safe
* *network* True if the file system requires network access * *network* True if the file system requires network access
* *unicode_paths* True if the file system supports unicode paths * *unicode_paths* True if the file system supports unicode paths
* *case_insensitive_paths* True if the file system ignores the case of paths * *case_insensitive_paths* True if the file system ignores the case of paths
......
...@@ -802,7 +802,8 @@ class _DirCache(dict): ...@@ -802,7 +802,8 @@ class _DirCache(dict):
class FTPFS(FS): class FTPFS(FS):
_meta = { 'network' : True, _meta = { 'thread_safe' : True,
'network' : True,
'virtual': False, 'virtual': False,
'read_only' : False, 'read_only' : False,
'unicode_paths' : True, 'unicode_paths' : True,
......
...@@ -235,16 +235,17 @@ class MemoryFS(FS): ...@@ -235,16 +235,17 @@ class MemoryFS(FS):
""" """
_meta = { 'network' : False, _meta = {'thread_safe' : True,
'virtual': False, 'network' : False,
'read_only' : False, 'virtual': False,
'unicode_paths' : True, 'read_only' : False,
'case_insensitive_paths' : False, 'unicode_paths' : True,
'atomic.move' : False, 'case_insensitive_paths' : False,
'atomic.copy' : False, 'atomic.move' : False,
'atomic.makedir' : True, 'atomic.copy' : False,
'atomic.rename' : True, 'atomic.makedir' : True,
'atomic.setcontents' : False, 'atomic.rename' : True,
'atomic.setcontents' : False,
} }
def _make_dir_entry(self, *args, **kwargs): def _make_dir_entry(self, *args, **kwargs):
......
...@@ -74,7 +74,8 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS): ...@@ -74,7 +74,8 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS):
methods in the os and os.path modules. methods in the os and os.path modules.
""" """
_meta = { 'network' : False, _meta = { 'thread_safe' : True,
'network' : False,
'virtual' : False, 'virtual' : False,
'read_only' : False, 'read_only' : False,
'unicode_paths' : os.path.supports_unicode_filenames, 'unicode_paths' : os.path.supports_unicode_filenames,
......
...@@ -8,7 +8,6 @@ class from the :mod:`fs.expose.xmlrpc` module. ...@@ -8,7 +8,6 @@ class from the :mod:`fs.expose.xmlrpc` module.
""" """
import sys
import xmlrpclib import xmlrpclib
import socket import socket
...@@ -92,8 +91,9 @@ class RPCFS(FS): ...@@ -92,8 +91,9 @@ class RPCFS(FS):
""" """
_meta = { 'virtual': False, _meta = {'thread_safe' : True,
'network' : True, 'virtual': False,
'network' : True,
} }
def __init__(self, uri, transport=None): def __init__(self, uri, transport=None):
......
...@@ -57,7 +57,8 @@ class S3FS(FS): ...@@ -57,7 +57,8 @@ class S3FS(FS):
or flushed. or flushed.
""" """
_meta = { 'virtual': False, _meta = { 'thread_safe' : True,
'virtual': False,
'read_only' : False, 'read_only' : False,
'unicode_paths' : True, 'unicode_paths' : True,
'case_insensitive_paths' : False, 'case_insensitive_paths' : False,
......
...@@ -52,7 +52,8 @@ class SFTPFS(FS): ...@@ -52,7 +52,8 @@ class SFTPFS(FS):
""" """
_meta = { 'virtual': False, _meta = { 'thread_safe' : True,
'virtual': False,
'read_only' : False, 'read_only' : False,
'unicode_paths' : True, 'unicode_paths' : True,
'case_insensitive_paths' : False, 'case_insensitive_paths' : False,
......
...@@ -21,7 +21,8 @@ class TempFS(OSFS): ...@@ -21,7 +21,8 @@ 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."""
_meta = { 'virtual' : False, _meta = { 'thread_safe' : True,
'virtual' : False,
'read_only' : False, 'read_only' : False,
'unicode_paths' : os.path.supports_unicode_filenames, 'unicode_paths' : os.path.supports_unicode_filenames,
'case_insensitive_paths' : os.path.normcase('Aa') == 'aa', 'case_insensitive_paths' : os.path.normcase('Aa') == 'aa',
......
...@@ -72,7 +72,8 @@ class ZipFS(FS): ...@@ -72,7 +72,8 @@ class ZipFS(FS):
"""A FileSystem that represents a zip file.""" """A FileSystem that represents a zip file."""
_meta = { 'virtual' : False, _meta = { 'thread_safe' : True,
'virtual' : False,
'read_only' : False, 'read_only' : False,
'unicode_paths' : True, 'unicode_paths' : True,
'case_insensitive_paths' : False, 'case_insensitive_paths' : False,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment