summaryrefslogtreecommitdiff
path: root/fs/tempfs.py
diff options
context:
space:
mode:
authorgcode@loowis.durge.org <gcode@loowis.durge.org@67cdc799-7952-0410-af00-57a81ceafa0f>2012-12-23 02:37:32 +0000
committergcode@loowis.durge.org <gcode@loowis.durge.org@67cdc799-7952-0410-af00-57a81ceafa0f>2012-12-23 02:37:32 +0000
commit2c113c7f363525a6ffd4ead62bda15dad15e985a (patch)
tree22f38e4584954b217e8b29d79f22c78ba345ee19 /fs/tempfs.py
parentbdf95abfb5a2e5102db8bb89d765ef0484b48296 (diff)
downloadpyfilesystem-git-2c113c7f363525a6ffd4ead62bda15dad15e985a.tar.gz
Change the way TempFS's _meta dict gets built so that it 'inherits' default values from OSFS's _meta (eliminates duplicate code)
Diffstat (limited to 'fs/tempfs.py')
-rw-r--r--fs/tempfs.py23
1 files changed, 5 insertions, 18 deletions
diff --git a/fs/tempfs.py b/fs/tempfs.py
index 8b5ec03..bc7d75f 100644
--- a/fs/tempfs.py
+++ b/fs/tempfs.py
@@ -22,24 +22,11 @@ class TempFS(OSFS):
"""Create a Filesystem in a temporary directory (with tempfile.mkdtemp),
and removes it when the TempFS object is cleaned up."""
- _meta = { 'thread_safe' : True,
- 'virtual' : False,
- 'read_only' : False,
- 'unicode_paths' : os.path.supports_unicode_filenames,
- 'case_insensitive_paths' : os.path.normcase('Aa') == 'aa',
- 'pickle_contents': False,
- 'network' : False,
- 'atomic.move' : True,
- 'atomic.copy' : True,
- 'atomic.makedir' : True,
- 'atomic.rename' : True,
- 'atomic.setcontents' : False
- }
-
- if platform.system() == 'Windows':
- _meta["invalid_path_chars"] = ''.join(chr(n) for n in xrange(31)) + '\\:*?"<>|'
- else:
- _meta["invalid_path_chars"] = '\0'
+ _meta = dict(OSFS._meta)
+ _meta['pickle_contents'] = False
+ _meta['network'] = False
+ _meta['atomic.move'] = True
+ _meta['atomic.copy'] = True
def __init__(self, identifier=None, temp_dir=None, dir_mode=0700, thread_synchronize=_thread_synchronize_default):
"""Creates a temporary Filesystem