summaryrefslogtreecommitdiffstats
path: root/Demo/pdist/FSProxy.py
diff options
context:
space:
mode:
Diffstat (limited to 'Demo/pdist/FSProxy.py')
-rwxr-xr-xDemo/pdist/FSProxy.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Demo/pdist/FSProxy.py b/Demo/pdist/FSProxy.py
index dad4015..510ac76 100755
--- a/Demo/pdist/FSProxy.py
+++ b/Demo/pdist/FSProxy.py
@@ -88,7 +88,7 @@ class FSProxyLocal:
c, t = fs.GetCreatorType()
if t != 'TEXT': return 0
except macfs.error as msg:
- print "***", name, msg
+ print("***", name, msg)
return 0
else:
if os.path.islink(name): return 0
@@ -99,12 +99,12 @@ class FSProxyLocal:
def check(self, name):
if not self.visible(name):
- raise os.error, "protected name %s" % repr(name)
+ raise os.error("protected name %s" % repr(name))
def checkfile(self, name):
self.check(name)
if not os.path.isfile(name):
- raise os.error, "not a plain file %s" % repr(name)
+ raise os.error("not a plain file %s" % repr(name))
def pwd(self):
return os.getcwd()
@@ -118,7 +118,7 @@ class FSProxyLocal:
def back(self):
if not self._dirstack:
- raise os.error, "empty directory stack"
+ raise os.error("empty directory stack")
dir, ignore = self._dirstack[-1]
os.chdir(dir)
del self._dirstack[-1]
@@ -128,8 +128,8 @@ class FSProxyLocal:
if pat:
def keep(name, pat = pat):
return fnmatch.fnmatch(name, pat)
- files = filter(keep, files)
- files = filter(self.visible, files)
+ files = list(filter(keep, files))
+ files = list(filter(self.visible, files))
files.sort()
return files
@@ -139,12 +139,12 @@ class FSProxyLocal:
def listfiles(self, pat = None):
files = os.listdir(os.curdir)
- files = filter(os.path.isfile, files)
+ files = list(filter(os.path.isfile, files))
return self._filter(files, pat)
def listsubdirs(self, pat = None):
files = os.listdir(os.curdir)
- files = filter(os.path.isdir, files)
+ files = list(filter(os.path.isdir, files))
return self._filter(files, pat)
def exists(self, name):
@@ -278,7 +278,7 @@ class FSProxyLocal:
def mkdir(self, name):
self.check(name)
- os.mkdir(name, 0777)
+ os.mkdir(name, 0o777)
def rmdir(self, name):
self.check(name)