[Repoze-dev] [issue110] unexpected keyword argument 'level' repoze.bfg.jinja2 (bfg 1.2a2)

2009-11-30 Thread Josip Delic

New submission from Josip Delic delij...@gmail.com:

After updating to newer version of repoze.bfg, i've got this error. 

When i remove the level keyword it works. In repoze.bfg.renderers is it also
removed.

Error:

  File
/home/delicj/.buildout/eggs/repoze.bfg.jinja2-0.5-py2.6.egg/repoze/bfg/jinja2/bindings.py,
line 17, in renderer_factory
return template_renderer_factory(path, Jinja2TemplateRenderer, 
level=level)
ConfigurationExecutionError: type 'exceptions.TypeError':
template_renderer_factory() got an unexpected keyword argument 'level'


--
assignedto: chrism
files: level.patch
messages: 332
nosy: chrism, delijati
priority: bug
status: unread
title: unexpected keyword argument 'level' repoze.bfg.jinja2 (bfg 1.2a2)
topic: repoze.bfg

__
Repoze Bugs b...@bugs.repoze.org
http://bugs.repoze.org/issue110
__--- bindings.py.old	2009-11-30 18:00:40.067922675 +0100
+++ bindings.py	2009-11-30 17:58:39.835423207 +0100
@@ -13,8 +13,8 @@
 from repoze.bfg.renderers import template_renderer_factory
 from repoze.bfg.settings import get_settings
 
-def renderer_factory(path, level=4):
-return template_renderer_factory(path, Jinja2TemplateRenderer, level=level)
+def renderer_factory(path):
+return template_renderer_factory(path, Jinja2TemplateRenderer)
 
 class Jinja2TemplateRenderer(object):
 implements(ITemplateRenderer)
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] [bfg 1.2a1] Required specification must be a specification or class.

2009-11-30 Thread Andreas Jung
Am 29.11.09 15:52, schrieb Chris McDonough:
 Andreas Jung wrote:
 Tried to get zopyx.smartprintng.server working w/ BFG 1.2a1. This fails
 badly.
 Anything I am missing?

 Thanks for trying it.  I have fixed this on the trunk and your server
 now starts.

 For maximum forward compatibility, you'll probably eventually want to
 change:

 @bfg_view(for_=Server, request_type='GET', permission='read')

 to:

 @bfg_view(for_=Server, request_method='GET', permission='read')

 (ie. request_type - request_method) 
Thanks, this worked.

Andreas
attachment: lists.vcf___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


[Repoze-dev] [issue110] unexpected keyword argument 'level' repoze.bfg.jinja2 (bfg 1.2a2)

2009-11-30 Thread Chris McDonough

Chris McDonough chr...@plope.com added the comment:

Thanks; I've fixed this in the 0.6 release, now on PyPI.

--
status: unread - resolved

__
Repoze Bugs b...@bugs.repoze.org
http://bugs.repoze.org/issue110
__
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] fun benchmarks.

2009-11-30 Thread Andreas Jung
Am 01.12.09 06:59, schrieb Chris McDonough:

 That would be somewhere around 8K - 9K requests per second, depending on whom 
 you believe.

 That's pretty snappy hardware for not much money.  I don't think we have much 
 excuse for slow web apps anymore.

Just geil!

Andreas
attachment: lists.vcf___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] fun benchmarks.

2009-11-30 Thread Chris McDonough
And in the spirit of 
http://blog.curiasolutions.com/2009/10/the-great-web-technology-shootout-round-3-better-faster-and-shinier/
 
a Chameleon hello world benchmark, rendering a template from a view that calls 
repoze.bfg.chameleon_zpt.render_template_to_response filling a slot in a 
macro from another template:

The view:

   from repoze.bfg.chameleon_zpt import render_template_to_response
   from repoze.bfg.chameleon_zpt import get_template

   master = get_template('templates/master.pt')

   def my_view(request):
   return render_template_to_response('templates/mytemplate.pt',
   project='starter', master=master)

The mytemplate.pt template:

   !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
   html xmlns=http://www.w3.org/1999/xhtml;
 xmlns:tal=http://xml.zope.org/namespaces/tal;
 xmlns:metal=http://xml.zope.org/namespaces/metal;
   body
   span metal:use-macro=master.macros['main']
  span metal:fill-slot=content
   pLorem ipsum dolor sit amet, consecteteur adipiscing elit nisi 
ultricies. Condimentum vel, at augue nibh sed. Diam praesent metus ut eros, sem 
penatibus. Pellentesque. Fusce odio posuere litora non integer habitant proin. 
Metus accumsan nibh facilisis nostra lobortis cum diam tellus. Malesuada nostra 
a volutpat pede primis congue nisl feugiat in fermentum. Orci in hymenaeos. Eni 
tempus mi mollis lacinia orci interdum lacus. Sollicitudin aliquet, etiam. Ac. 
Mi, nullam ligula, tristique penatibus nisi eros nisl pede pharetra congue, 
aptent nulla, rhoncus tellus morbi, ornare. Magna condimentum erat turpis. 
Fusce arcu ve suscipit nisi phasellus rutrum a dictumst leo, laoreet dui, 
ultricies platea. Porta venenatis fringilla vestibulum arcu etiam condimentum 
non./p
   /span
   /span
   /body
   /html

The master.pt template:

   !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
   html xmlns=http://www.w3.org/1999/xhtml;
 xmlns:tal=http://xml.zope.org/namespaces/tal;
 xmlns:metal=http://xml.zope.org/namespaces/metal;
   body metal:define-macro=main
 span metal:define-slot=content
   Hello ${project}
 /span
   /body
   /html

running ab -n1 -c10 against such a setup (as per the referenced blog entry):

   Server Software:Apache/2.2.12
   Server Hostname:127.0.0.1
   Server Port:80

   Document Path:  /starter
   Document Length:989 bytes

   Concurrency Level:  10
   Time taken for tests:   1.528 seconds
   Complete requests:  1
   Failed requests:0
   Write errors:   0
   Total transferred:  11801180 bytes
   HTML transferred:   9890989 bytes
   Requests per second:6544.78 [#/sec] (mean)
   Time per request:   1.528 [ms] (mean)
   Time per request:   0.153 [ms] (mean, across all concurrent requests)
   Transfer rate:  7542.59 [Kbytes/sec] received

Siege results (1000 reps, 10 concurrent in benchmark mode) against same:

   ** SIEGE 2.68
   ** Preparing 10 concurrent users for battle.
   The server is now under siege..  done.
   Transactions:   1 hits
   Availability:  100.00 %
   Elapsed time:1.81 secs
   Data transferred:5.69 MB
   Response time:   0.00 secs
   Transaction rate: 5524.86 trans/sec
   Throughput:  3.15 MB/sec
   Concurrency: 9.84
   Successful transactions:   1
   Failed transactions:0
   Longest transaction: 0.01
   Shortest transaction:0.00

Between 5500 - 6500 rps depending on whom you believe.

If you take for granted that the box described at 
http://blog.curiasolutions.com/2009/10/the-great-web-technology-shootout-round-3-better-faster-and-shinier/
 
  is roughly half as fast as this box that this test was performed on, and you 
take for granted that those tests are roughly accurate:  BFG beats everybody 
else benchmarked by between 2X and 3X except for Bottle, which is slightly 
faster in this test than BFG.  Bottle beats BFG by 10% with Bottle+Mako vs 
BFG+Chameleon, and by about 20% with no templating system involved.

- C

___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev