Skip to content
Snippets Groups Projects
Commit 4d4342d4 authored by Mike Bayer's avatar Mike Bayer
Browse files

- fix to module_directory path generation when the path is "./"

  [ticket:34]
parent 53d8ed47
No related branches found
No related tags found
No related merge requests found
0.1.6
- fix to module_directory path generation when the path is "./"
[ticket:34]
0.1.5
- AST expression generation - added in just about everything
expression-wise from the AST module [ticket:26]
......
......@@ -59,7 +59,7 @@ class Template(object):
u = self.uri
if u[0] == '/':
u = u[1:]
path = os.path.normpath(os.path.join(module_directory.replace('/', os.path.sep), u + ".py"))
path = os.path.abspath(os.path.join(module_directory.replace('/', os.path.sep), u + ".py"))
else:
path = None
if path is not None:
......
......@@ -250,8 +250,8 @@ class ModuleDirTest(unittest.TestCase):
file('./test_htdocs/subdir/modtest.html', 'w').write("""this is a test""")
t = Template(filename='./test_htdocs/modtest.html', module_directory='./test_htdocs/modules')
t2 = Template(filename='./test_htdocs/subdir/modtest.html', module_directory='./test_htdocs/modules')
assert t.module.__file__ == os.path.normpath('./test_htdocs/modules/test_htdocs/modtest.html.py')
assert t2.module.__file__ == os.path.normpath('./test_htdocs/modules/test_htdocs/subdir/modtest.html.py')
assert t.module.__file__ == os.path.abspath('./test_htdocs/modules/test_htdocs/modtest.html.py')
assert t2.module.__file__ == os.path.abspath('./test_htdocs/modules/test_htdocs/subdir/modtest.html.py')
def test_callable(self):
file('./test_htdocs/modtest.html', 'w').write("""this is a test""")
file('./test_htdocs/subdir/modtest.html', 'w').write("""this is a test""")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment