Issue 201 in auto-sub: Relative template paths broken when

3 views
Skip to first unread message

auto...@googlecode.com

unread,
Jun 25, 2013, 6:59:11 PM6/25/13
to aut...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 201 by basstott...@gmail.com: Relative template paths broken when
http://code.google.com/p/auto-sub/issues/detail?id=201

On my NAS server, the application resides in another directory than the
configuration/caches/db. This causes problems due to current working
directory and file resolving:

HTTP Traceback (most recent call last):
File "/mnt/apps/auto-sub/cherrypy/_cprequest.py", line 656, in respond
response.body = self.handler()
File "/mnt/apps/auto-sub/cherrypy/lib/encoding.py", line 188, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "/mnt/apps/auto-sub/cherrypy/_cpdispatch.py", line 34, in __call__
return self.callable(*self.args, **self.kwargs)
File "/mnt/apps/auto-sub/autosub/WebServer.py", line 260, in index
tmpl = PageTemplate(file="interface/templates/home.tmpl")

File "/usr/local/lib/python2.7/site-packages/Cheetah-2.4.4-py2.7-linux-armv7l.egg/Cheetah/Template.py",
line 1259, in __init__
self._compile(source, file, compilerSettings=compilerSettings)

File "/usr/local/lib/python2.7/site-packages/Cheetah-2.4.4-py2.7-linux-armv7l.egg/Cheetah/Template.py",
line 1546, in _compile
self._fileMtime = os.path.getmtime(file)
File "/usr/local/lib/python2.7/genericpath.py", line 54, in getmtime
return os.stat(filename).st_mtime
OSError: [Errno 2] No such file or
directory: '/mnt/apps/userdata/auto-sub/interface/templates/home.tmpl'

As one can see, the
file '/mnt/apps/userdata/auto-sub/interface/templates/home.tmpl' is
requested, but this file resides in
/mnt/apps/auto-sub/interface/templates/home.tmpl' (note the userdata
folder).

The current working directory (?) is determined via the path variable in
config.properties file. However, the interface folder resides in the
application directory, not of the userdata directory.

I have changed the source to include a variable autosub.BASE_DIR, which is
set in the main() method. This variables points to the directory where the
AutoSub.py file resides and is used to resolve templates and other
application files. The path variable in config.properties is still used to
point to the userdata directory.

A patch is attached, but I haven't tested it thoroughly. Especially the
templates are more or less the result of Replace All. The patch is checked
out against the latest source.

Attachments:
auto-sub_basedir.patch 20.8 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

auto...@googlecode.com

unread,
Jun 25, 2013, 7:01:42 PM6/25/13
to aut...@googlegroups.com

Comment #1 on issue 201 by basstott...@gmail.com: Relative template paths
broken when
http://code.google.com/p/auto-sub/issues/detail?id=201

The title should be 'Relative template paths broken'. I cannot find the
edit button. My bad.
Reply all
Reply to author
Forward
0 new messages