[Checkins] SVN: zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/ Pyramid deprecations fixed

Andreas Jung andreas at andreas-jung.com
Tue Aug 23 07:57:35 EDT 2011


Log message for revision 122687:
  Pyramid deprecations fixed
  

Changed:
  U   zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/templates/index.pt
  U   zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/views.py

-=-
Modified: zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/templates/index.pt
===================================================================
--- zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/templates/index.pt	2011-08-23 11:46:33 UTC (rev 122686)
+++ zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/templates/index.pt	2011-08-23 11:57:34 UTC (rev 122687)
@@ -30,7 +30,7 @@
   </div>   
 
   <div id="footer">
-      (C) 2009,2010, ZOPYX Limited, <a href="http://www.zopyx.com">www.zopyx.com</a>, <a href="mailto:info at zopyx.com">info at zopyx.com</a>
+      (C) 2009-2011, ZOPYX Limited, <a href="http://www.zopyx.com">www.zopyx.com</a>, <a href="mailto:info at zopyx.com">info at zopyx.com</a> &bull; Published under the Zope Public Licence 2.1 (ZPL).
   </div>
 
 </body>

Modified: zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/views.py
===================================================================
--- zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/views.py	2011-08-23 11:46:33 UTC (rev 122686)
+++ zopyx.smartprintng.server/trunk/zopyx/smartprintng/server/views.py	2011-08-23 11:57:34 UTC (rev 122687)
@@ -11,8 +11,8 @@
 import xmlrpclib
 import pkg_resources
 from stat import ST_CTIME
-from pyramid.chameleon_zpt import render_template_to_response
-from pyramid.view import static
+from pyramid.renderers import render_to_response
+from pyramid.view import static_view
 from pyramid.view import view_config
 from pyramid_xmlrpc import xmlrpc_view
 from webob import Response
@@ -26,7 +26,7 @@
     from nullauth import authenticateRequest, authorizeRequest
     have_authentication = False
 
-static_view = static('templates/static')
+static_view = static_view('templates/static', use_subpath=True)
 
 
 ##################
@@ -44,12 +44,13 @@
     def __call__(self):
         converters = self.context.availableConverters()
         version = pkg_resources.require('zopyx.smartprintng.server')[0].version 
-        return render_template_to_response('templates/index.pt',
-                                           context=self.context,
-                                           converters=converters,
-                                           request=self.request,
-                                           version=version,
-                                           project='zopyx.smartprintng.server')
+        params =  dict(context=self.context,
+                       project='zopyx.smartprintng.server',
+                       version=version,
+                       converters=converters)
+        return render_to_response('templates/index.pt',
+                                  params,
+                                  request=self.request)
 
 @view_config(for_=Server, request_method='GET', permission='read', name='selftest')
 class selftest(object):



More information about the checkins mailing list