Re: [Repoze-dev] bfg 1.3 on gae problem scanning
OK, thanks (again). That's what I did for now. - Andreas On Thu, Nov 04, 2010 at 06:40:14AM +0800, Tim Hoffman wrote: Hi In my experience I personally wouldn't use scan and in fact I am trying to use zcml as little as possible For any app to be successful on appengine it needs to start fast. zcml parsing is slowing than explicit imports. The docs suggest scan is slow too. Also during startup you can get DeadlineExceeded errors, and if this happens during zcml processing your instance will be broken. So I would do all view setups etc explicitly and not through zcml and decorators. Sorry this doesn't help solve your reported problem ;-) Rgds Tim On Thu, Nov 4, 2010 at 4:59 AM, Andreas Reuleaux reule...@web.de wrote: I follow exactly the steps described in the bfg on appengine tutorial, i. e. I am * using the current gae (1.3.8) * with python2.5 as that seems the the maximum python version supported by appengine monkey / GAE * using the current/simple index for bfg bin/easy_install -i http://dist.repoze.org/bfg/current/simple/ repoze.bfg that is as of today bfg 1.3 * having my bfgapp created from bfg_starter template + configuration steps as described in the turial Then I start the application $ python2.5 /opt/appengine/google_appengine/dev_appserver.py bfgapp/app and have a look at it http://localhost:8080 Everything is fine. BUT: As soon as I try to add scanning * either by adding scan package=. / to my configure.zcml * or by adding a line config.scan() somewhere between config.begin() and config.end() in my run.py (and restart my $ python2.5 /opt/appengine/google_appengine/dev_appserver.py bfgapp/app ) I get Traceback (most recent call last): File /opt/appengine/google_appengine/google/appengine/tools/dev_appserver.py, line 3211, in _HandleRequest self._Dispatch(dispatcher, self.rfile, outfile, env_dict) File /opt/appengine/google_appengine/google/appengine/tools/dev_appserver.py, line 3154, in _Dispatch base_env_dict=env_dict) File /opt/appengine/google_appengine/google/appengine/tools/dev_appserver.py, line 527, in Dispatch base_env_dict=base_env_dict) File /opt/appengine/google_appengine/google/appengine/tools/dev_appserver.py, line 2404, in Dispatch self._module_dict) File /opt/appengine/google_appengine/google/appengine/tools/dev_appserver.py, line 2314, in ExecuteCGI reset_modules = exec_script(handler_path, cgi_path, hook) File /opt/appengine/google_appengine/google/appengine/tools/dev_appserver.py, line 2210, in ExecuteOrImportScript exec module_code in script_module.__dict__ File /home/reuleaux/tmp/bfgapp/app/runner.py, line 59, in module application = application(*(config_args or ()), **(config_kwargs or {})) File /home/reuleaux/tmp/bfgapp/app/bfgapp/run.py, line 14, in app config.scan() File /home/reuleaux/tmp/bfgapp/app/lib/python/repoze.bfg-1.3-py2.5.egg/repoze/bfg/configuration.py, line 1455, in scan scanner.scan(package, categories=categories) File /home/reuleaux/tmp/bfgapp/app/lib/python/venusian-0.4-py2.5.egg/venusian/__init__.py, line 47, in scan module_type = loader.etc[2] TypeError: 'NoneType' object is unsubscriptable Something in venusian. - I don't know if this is related: in the initial installation step (installing repoze.bfg from the current/simple index with python2.5) I got already some problem: ... Searching for nose Reading http://pypi.python.org/simple/nose/ Reading http://somethingaboutorange.com/mrl/projects/nose/ Best match: nose 0.11.4 Downloading http://somethingaboutorange.com/mrl/projects/nose/nose-0.11.4.tar.gz Processing nose-0.11.4.tar.gz Running nose-0.11.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-sS34JB/venusian-0.4/temp/easy_install-Psmz2u/nose-0.11.4/egg-dist-tmp-bWA16F no previously-included directories found matching 'doc/.build' Installed /tmp/easy_install-sS34JB/venusian-0.4/nose-0.11.4-py2.5.egg File build/bdist.linux-i686/egg/venusian/tests/fixtures/classdecorator.py, line 4 class SuperClass(object): ^ SyntaxError: invalid syntax File /home/reuleaux/tmp/bfgapp/app/lib/python/venusian-0.4-py2.5.egg/venusian/tests/fixtures/classdecorator.py, line 4 class SuperClass(object): ^ SyntaxError: invalid syntax Adding venusian 0.4 to easy-install.pth file Installed /home/reuleaux/tmp/bfgapp/app/lib/python/venusian-0.4-py2.5.egg ... Note that I have asked this question before http://www.mail-archive.com/repoze-dev@lists.repoze.org/msg02671.html (with little help.) At the time the bfg from current/simple was still 1.2.x so I figured maybe for bfg this is preferred for some reason, and I continued to use 1.2.x, but now this is really bothering me
[Repoze-dev] problem with scan package=. / on google appengine
If have an application that used to work just fine under bfg+google appengine - cf. the tutorial at http://docs.repoze.org/bfg/1.3/tutorials/gae/index.html There is a scan package=. / in its configure file (which recently caused me no problems under gae) Now with a recent bfg (1.3a4) on gae 1.3.5 when running the dev_appserver.py script (under py25) I get this error if I have a scan like above (scan package=. /) in my configuration, any idea?: (This app runs just fine, when run under my system python, i. e. without gae.) By the way: is there a possibility to run bfg on gae under python2.6? - My system python is 2.6 already, but the bottleneck seems to be, that appengine-monkey insists on 2.5. -Andreas Traceback (most recent call last): File /opt/appengine/google_appengine/google/appengine/tools/dev_appserver.py, line 3199, in _HandleRequest self._Dispatch(dispatcher, self.rfile, outfile, env_dict) File /opt/appengine/google_appengine/google/appengine/tools/dev_appserver.py, line 3142, in _Dispatch base_env_dict=env_dict) File /opt/appengine/google_appengine/google/appengine/tools/dev_appserver.py, line 524, in Dispatch base_env_dict=base_env_dict) File /opt/appengine/google_appengine/google/appengine/tools/dev_appserver.py, line 2401, in Dispatch self._module_dict) File /opt/appengine/google_appengine/google/appengine/tools/dev_appserver.py, line 2311, in ExecuteCGI reset_modules = exec_script(handler_path, cgi_path, hook) File /opt/appengine/google_appengine/google/appengine/tools/dev_appserver.py, line 2207, in ExecuteOrImportScript exec module_code in script_module.__dict__ File /home/reuleaux/work/website/gae/app/runner.py, line 63, in module application = application(*(config_args or ()), **(config_kwargs or {})) File /home/reuleaux/work/website/gae/app/website/run.py, line 13, in app config.load_zcml(zcml_file) File /home/reuleaux/work/website/gae/app/lib/python/repoze/bfg/configuration.py, line 519, in load_zcml xmlconfig.file(filename, package, execute=True) File /home/reuleaux/work/website/gae/app/lib/python/zope/configuration/xmlconfig.py, line 653, in file context.execute_actions() File /home/reuleaux/work/website/gae/app/lib/python/zope/configuration/config.py, line 606, in execute_actions callable(*args, **kw) File /home/reuleaux/work/website/gae/app/lib/python/repoze/bfg/configuration.py, line 1232, in scan scanner.scan(package, categories=categories) File /home/reuleaux/work/website/gae/app/lib/python/venusian/__init__.py, line 47, in scan module_type = loader.etc[2] ConfigurationExecutionError: type 'exceptions.TypeError': 'NoneType' object is unsubscriptable in: File /home/reuleaux/work/website/gae/app/website/configure.zcml, line 18.2-18.22 scan package=. / ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] bfg + logging
Yes that got me running, I know have in my website.ini [loggers] keys=root [handlers] keys=hand [formatters] keys=form [logger_root] level=DEBUG handlers=hand [handler_hand] class=StreamHandler level=NOTSET formatter=form args=(sys.stdout,) stream=sys.stdout [formatter_form] ; format=F1 %(asctime)s %(levelname)s %(message)s format=%(message)s datefmt= and I get some logging output in my paster.log Very good tutorial by the way, this http://www.red-dove.com/python_logging.html#config Maybe it would be good to have this in the bfg docs ? - I mean: just a basic example to get something running and a link to this tutorial - no details of how to make a more complicated configuration - or is it just me, that didn't know of this hidden feature of PasteDeploy ? Thanks, Andreas On Wed, Oct 28, 2009 at 12:27:09PM -0400, Chris McDonough wrote: A hidden feature of PasteDeploy (the package which defines the .ini format for a BFG package.ini file) is that you can just inject something in the .ini format found at e.g. http://www.red-dove.com/python_logging.html#config into the BFG app .ini file (literally just paste it in to the BFG app .ini file) and PasteDeploy will configure the logging module. Then you can use the logging API to log to the loggers you've defined in the BFG config file. Andreas Reuleaux wrote: ... ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] bfg + logging
Yes, I can have a look (not immediately though). Should I just provide some patches or do you want to give me svn write access (should I sign some contributor agreement)? -Andreas On Wed, Oct 28, 2009 at 01:29:14PM -0400, Chris McDonough wrote: Andreas Reuleaux wrote: Maybe it would be good to have this in the bfg docs ? - I mean: just a basic example to get something running and a link to this tutorial - no details of how to make a more complicated configuration - or is it just me, that didn't know of this hidden feature of PasteDeploy ? Probably. Do you think you could take a stab at changing the docs in a fashion that suited this problem? (http://svn.repoze.org/repoze.bfg/trunk/docs). - C ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] zope.schema, zope.formlib in bfg? or help a newb understand zca coolness
You might also want to look at Malte's repoze.formapi, see e. g. his blog entry http://mockit.blogspot.com/2009/05/forms-that-dont-make-you-tense-and.html Personally I can't comment on repoze.formapi vs. formish, as I have used neither of them yet, but I think both should work well with bfg, whereas z3c.form would require some porting effort. -Andreas On Sat, Oct 03, 2009 at 01:17:21PM -0400, Chris McDonough wrote: +1 to what Martin wrote, with something else that can only add to the confusion: recently I have been using Formish (http://ish.io) to do autogenerated forms. I think both zope.formlib and z3c.form try to paint forms based on model objects; formish doesn't even try. It just lets you create your own form schema and attempts to draw forms based on that. This is enough for my needs currently. - C Martin Aspeli wrote: Thomas G. Willis wrote: OK, not sure if this is a blasphemous question or not. I've been slowly working through Web Component Development with Zope 3 , and instead of trying out the things in zopeproject, I figured that trying out the things in bfg as well may yield a greater understanding of what the heck is going on. I realize that this may be incredibly dumb, so I'm not surprised that I'm hitting roadblocks once in a while. Bear in mind that whilst repoze.bfg uses a number of Zope packages, it is not built on top of Zope 3 (in the same way that, say, Grok is). BFG contains forks/re-implementations of some Zope things, omits a large number of package traditionally part of a Zope 3 bundle (this is a good thing!), and solves certain things differently (e.g. the way views are done in bfg is different from the way they are done in Zope). For this reason, Philipp's book will probably not apply in many cases if you're using BFG, and I don't think there's any documentation or good guides to *which* parts will apply and which parts won't (i.e. a bfg delta zope document). That said, I can't see it being impossible to use zope.schema + a forms library in repoze.bfg. Not that I've tried. ;) After reading up on zope.schema and zope.formlib, it seems that schema based forms, fit my brain, and I would like to use them in bfg if possible rather than tw.forms etc... This won't help with your specific question, but most people seem to be ditching zope.formlib in favour of z3c.form, which is more feature complete, better documented and better maintained. The basic principles are still the same: you build a schema and then create a form from that schema. http://docs.zope.org/z3c.form has the documentation. To use it, you need to depend on it in your own package's setup.py so that it gets installed, and include its configuration via include package=z3c.form / in your configure.zcml. To use the default widgets (which you probably want) you also need to mark the request with the IFormLayer marker interface. I'm not sure what facility repoze.bfg has for that, though. Martin ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
[Repoze-dev] repoze.bfg.viewgroup
Is there any particular reason repoze.bfg.viewgroup hasn't made it from the lemonade index: http://dist.repoze.org/lemonade/dev/simple to the (more recent / up to date) bfg/current/simple index?: http://dist.repoze.org/bfg/current/simple What is the recommended way to use repoze.bfg.viewgroup? I am using buildout and remember in a discussion on this list not to long a ago (bfg vs buildout), that it is not particular fun to have two index= in one buildout. -Andreas ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] repoze.bfg.viewgroup
On Sat, Jul 11, 2009 at 03:42:46PM -0400, Chris McDonough wrote: On 7/11/09 2:51 PM, Andreas Reuleaux wrote: Is there any particular reason repoze.bfg.viewgroup hasn't made it from the lemonade index: http://dist.repoze.org/lemonade/dev/simple to the (more recent / up to date) bfg/current/simple index?: http://dist.repoze.org/bfg/current/simple The current index contains only the software required to run BFG itself; it contains no add-ons. OK, I see. What is the recommended way to use repoze.bfg.viewgroup? I am using buildout and remember in a discussion on this list not to long a ago (bfg vs buildout), that it is not particular fun to have two index= in one buildout. Something like this should work (in your [buildout] section): find-links = http://dist.repoze.org/bfgsite/repoze.bfg.viewgroup-0.2.tar.gz Then name repoze.bfg.viewgroup as a dependency in an eggs = section of a zope.recipe.egg part. - C Yes, that worked, thanks. -Andreas ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] repoze.bfg trunk C-free
On Sun, May 03, 2009 at 02:14:02PM -0400, Chris McDonough wrote: ... I have no plans to chase a ZPT-on-GAE ball around the yard personally. But I might go ahead and create BFG bindings for plain old Genshi (as opposed to chameleon.genshi). Plain-old-Genshi seems to be supported on GAE.. or at least I'd be able to verify that if http://genshi.edgewall.org/wiki/AppEngine was responding at the moment. Yes, that would be nice: I would prefer genshi over zpt/jinja2/etc. -Andreas ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev