diff options
Diffstat (limited to 'Demo')
-rw-r--r-- | Demo/pdist/FSProxy.py | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/Demo/pdist/FSProxy.py b/Demo/pdist/FSProxy.py index 510ac76..47fa8f9 100644 --- a/Demo/pdist/FSProxy.py +++ b/Demo/pdist/FSProxy.py @@ -23,12 +23,7 @@ from stat import * import time import fnmatch -if os.name == 'mac': - import macfs - maxnamelen = 31 -else: - macfs = None - maxnamelen = 255 +maxnamelen = 255 skipnames = (os.curdir, os.pardir) @@ -63,16 +58,10 @@ class FSProxyLocal: return ignore def _hidden(self, name): - if os.name == 'mac': - return name[0] == '(' and name[-1] == ')' - else: - return name[0] == '.' + return name[0] == '.' def _hide(self, name): - if os.name == 'mac': - return '(%s)' % name - else: - return '.%s' % name + return '.%s' % name def visible(self, name): if len(name) > maxnamelen: return 0 @@ -81,18 +70,8 @@ class FSProxyLocal: if self._hidden(name): return 0 head, tail = os.path.split(name) if head or not tail: return 0 - if macfs: - if os.path.exists(name) and not os.path.isdir(name): - try: - fs = macfs.FSSpec(name) - c, t = fs.GetCreatorType() - if t != 'TEXT': return 0 - except macfs.error as msg: - print("***", name, msg) - return 0 - else: - if os.path.islink(name): return 0 - if '\0' in open(name, 'rb').read(512): return 0 + if os.path.islink(name): return 0 + if '\0' in open(name, 'rb').read(512): return 0 for ign in self._ignore: if fnmatch.fnmatch(name, ign): return 0 return 1 |