aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mako
diff options
context:
space:
mode:
authorPhilip Jenvey <pjenvey@underboss.org>2008-04-12 19:15:28 +0000
committerPhilip Jenvey <pjenvey@underboss.org>2008-04-12 19:15:28 +0000
commit65fddbe0235b21a053b977018b2a2bb4f58a9966 (patch)
tree87744fa3fb71a3aaaca79a0cfb7ce37e66ef7e9c /lib/mako
parent2c1d8a6bc995a1505003f4e7c8d183f113663233 (diff)
downloadexternal_python_mako-65fddbe0235b21a053b977018b2a2bb4f58a9966.tar.gz
external_python_mako-65fddbe0235b21a053b977018b2a2bb4f58a9966.tar.bz2
external_python_mako-65fddbe0235b21a053b977018b2a2bb4f58a9966.zip
use os.path.exists instead of os.access F_OK, which is currently broken on google app engine
Diffstat (limited to 'lib/mako')
-rw-r--r--lib/mako/ext/autohandler.py4
-rw-r--r--lib/mako/lookup.py4
-rw-r--r--lib/mako/template.py2
-rw-r--r--lib/mako/util.py2
4 files changed, 6 insertions, 6 deletions
diff --git a/lib/mako/ext/autohandler.py b/lib/mako/ext/autohandler.py
index 4dd6b6c..3025f8e 100644
--- a/lib/mako/ext/autohandler.py
+++ b/lib/mako/ext/autohandler.py
@@ -50,8 +50,8 @@ def autohandler(template, context, name='autohandler'):
def _file_exists(lookup, path):
psub = re.sub(r'^/', '',path)
for d in lookup.directories:
- if os.access(d + '/' + psub, os.F_OK):
+ if os.path.exists(d + '/' + psub):
return True
else:
return False
- \ No newline at end of file
+
diff --git a/lib/mako/lookup.py b/lib/mako/lookup.py
index 290f71d..f720e4c 100644
--- a/lib/mako/lookup.py
+++ b/lib/mako/lookup.py
@@ -66,7 +66,7 @@ class TemplateLookup(TemplateCollection):
u = re.sub(r'^\/+', '', uri)
for dir in self.directories:
srcfile = posixpath.normpath(posixpath.join(dir, u))
- if os.access(srcfile, os.F_OK):
+ if os.path.exists(srcfile):
return self.__load(srcfile, uri)
else:
raise exceptions.TopLevelLookupException("Cant locate template for uri '%s'" % uri)
@@ -120,7 +120,7 @@ class TemplateLookup(TemplateCollection):
def __check(self, uri, template):
if template.filename is None:
return template
- if not os.access(template.filename, os.F_OK):
+ if not os.path.exists(template.filename):
self.__collection.pop(uri, None)
raise exceptions.TemplateLookupException("Cant locate template for uri '%s'" % uri)
elif template.module._modified_time < os.stat(template.filename)[stat.ST_MTIME]:
diff --git a/lib/mako/template.py b/lib/mako/template.py
index aca51cd..6a77570 100644
--- a/lib/mako/template.py
+++ b/lib/mako/template.py
@@ -78,7 +78,7 @@ class Template(object):
if path is not None:
util.verify_directory(os.path.dirname(path))
filemtime = os.stat(filename)[stat.ST_MTIME]
- if not os.access(path, os.F_OK) or os.stat(path)[stat.ST_MTIME] < filemtime:
+ if not os.path.exists(path) or os.stat(path)[stat.ST_MTIME] < filemtime:
_compile_module_file(self, file(filename).read(), filename, path)
module = imp.load_source(self.module_id, path, file(path))
del sys.modules[self.module_id]
diff --git a/lib/mako/util.py b/lib/mako/util.py
index 35b5a0d..e1f3f85 100644
--- a/lib/mako/util.py
+++ b/lib/mako/util.py
@@ -35,7 +35,7 @@ def verify_directory(dir):
tries = 0
- while not os.access(dir, os.F_OK):
+ while not os.path.exists(dir):
try:
tries += 1
os.makedirs(dir, 0750)