As a result, I have to patch SABnzbd.py which has been working fine up until 0.4.0 with templates. However, using this patch:
Code: Select all
--- SABnzbd.py.orig 2008-07-05 15:35:03.000000000 -0700
+++ SABnzbd.py 2008-07-05 15:35:11.000000000 -0700
@@ -301,7 +301,7 @@
sabnzbd.MY_FULLNAME = os.path.normpath(os.path.abspath(sys.argv[0]))
sabnzbd.MY_NAME = os.path.basename(sabnzbd.MY_FULLNAME)
sabnzbd.DIR_PROG = os.path.dirname(sabnzbd.MY_FULLNAME)
- sabnzbd.DIR_INTERFACES = real_path(sabnzbd.DIR_PROG, DEF_INTERFACES)
+ sabnzbd.DIR_INTERFACES = real_path(%%PREFIX%%, DEF_INTERFACES)
# Need console logging for SABnzbd.py and SABnzbd-console.exe
consoleLogging = (not hasattr(sys, "frozen")) or (sabnzbd.MY_NAME.lower().find('-console') > 0)
Note that all I'm doing in the patch is to change the path to sabnzbd.DIR_INTERFACES. (%%PREFIX%% gets resolved to /usr/local/share/sabnzbdplus).Page handler: 'No such file or directory'
Traceback (most recent call last):
File "/usr/local/lib/python2.5/site-packages/cherrypy/_cphttptools.py", line 110, in _run
applyFilters('before_finalize')
File "/usr/local/lib/python2.5/site-packages/cherrypy/filters/__init__.py", line 151, in applyFilters
method()
File "/usr/local/lib/python2.5/site-packages/sabnzbd/interface.py", line 210, in beforeFinalize
**rsrc.callable_kwargs)
File "/usr/local/lib/python2.5/site-packages/sabnzbd/interface.py", line 731, in index
return template.respond()
File "cheetah__usr_local_share_sabnzbdplus_interfaces_Default_templates_queue_tmpl_1215299252_47_99950.py", line 98, in respond
File "/usr/local/lib/python2.5/site-packages/Cheetah-2.0.1-py2.5-freebsd-7.0-STABLE-i386.egg/Cheetah/Template.py", line 1512, in _handleCheetahInclude
nestedTemplateClass = compiler.compile(source=source,file=file)
File "/usr/local/lib/python2.5/site-packages/Cheetah-2.0.1-py2.5-freebsd-7.0-STABLE-i386.egg/Cheetah/Template.py", line 693, in compile
fileHash = str(hash(file))+str(os.path.getmtime(file))
File "/usr/local/lib/python2.5/posixpath.py", line 143, in getmtime
return os.stat(filename).st_mtime
OSError: [Errno 2] No such file or directory: '/usr/local/bin/interfaces/Default/templates/inc_top.tmpl'
However, in the "No such file or directory" error above, it's clear that the interface path is not being honored while looking for the template. The initial queue.tmpl is resolved fine, but not sure about after that.
What do I need to do for the interfaces directory to be honored? I've tried to find how the includes work for templates, but have been unable to find out how the paths are resolved.
Help is greatly appriciated.