[Repoze-dev] chameleon.repoze.org is offline.

2010-12-17 Thread Tim Hoffman
Hi Folks

In case you didn't notice, chameleon.repoze.org is offline.

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


Re: [Repoze-dev] chameleon.repoze.org is offline.

2010-12-17 Thread Tim Hoffman
HI Malthe

No probs.  Bad luck on the slice.

Let us know when you get back up.

T

On Fri, Dec 17, 2010 at 9:26 PM, Malthe Borch mbo...@gmail.com wrote:
 Hey Tim,

 The server that's hosting the site was compromised yesterday. My slice
 there has been suspended.

 As of yet, I haven't gotten permission to access the files on there
 yet from the hosting provider.

 Thanks for reporting though.

 \malthe

 On 17 December 2010 14:22, Tim Hoffman zutes...@gmail.com wrote:
 Hi Folks

 In case you didn't notice, chameleon.repoze.org is offline.

 T
 ___
 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] bfg 1.3 on gae problem scanning

2010-11-03 Thread Tim Hoffman
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.

 Chris?

 -thanks in advance

 -Andreas







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

___
Repoze-dev mailing list

Re: [Repoze-dev] repoze.who redirecting form plugin, and the use http response codes 302 vs 303

2010-09-13 Thread Tim Hoffman
Just a follow up.

I changed all occurences of HTTPFound to HTTPSeeOther and redeployed
to appengine.
And now iphones and ipads accessing the application via Telstra 3G
network now behave correctly.

So I think I am correct in my interpretation and resolution.

If people agree I will supply a patch (oops I haven't check repoze.who
2.x to see if its already been done there.)

Tim

On Mon, Sep 13, 2010 at 1:39 PM, Tim Hoffman zutes...@gmail.com wrote:
 Hi

 I have run into a bit of a weird problem.

 I am using repoze.who successfully on appengine (not really relevant
 ;-) and did some testing recently of the application
 on an iphone4 on telstra's 3G network, and login's stopped working.

 (previous testing was on various other 3G and conventional ISP, with
 normal browsers, iphone, ipad and android)

 On Telstra3G network we have found that on successful login repoze.who
 (1.0.18) does a HTTPFound(came_from)  to send you to the page/url
 which is your planned destination.  paste (1.7.2)  HTTPFound returns
 http status 302.  And on all networks I had tried to date it works
 fine
 but on telstra we actually get served the original login form which
 was the original result of the inital failed page request

 To help illustrate step by step what happens with repoze.who
 redirecting form plugin.

 Start out not logged in

 goto url  - /home  -  get a 302 response with location
 /login?came_from=/home  as we are not logged

 browser loads - /login?came_from=/home user logs in with a POST, and
 redirecting form now sends 302 with location /home  (See line 191
 who/plugins/form.py)

 iphone/ipad now tries to get -  /home and telstra serves up the
 cached previous response for /home which is  /login?came_from=/home

 Which is not what I expected ;-)

 However having a read up on 302 status on wikipedia it suggests that
 in fact if adhering to the letter of the law a 303 response
 should actually be returned by redirecting form plugin. So maybe
 telstra is doing the right thing.  The wikipedia article on 302
 suggests the use 303 behaviour for 302 is a common pattern.

 http://en.wikipedia.org/wiki/HTTP_302  and
 http://en.wikipedia.org/wiki/HTTP_303

 So I think the redirecting form plugin for repoze.who should in fact
 be using HTTPSeeOther paste exception rather than HTTPFound.

 Does any one agree with my interpretation of whats going on ?
 Comments welcome ?

 Regards

 Tim Hoffman

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


Re: [Repoze-dev] Deform and late binding of source values for checkbox widget and validators

2010-09-08 Thread Tim Hoffman
Hi Chris

On the face of it, it looks pretty good.

I hope to be in a position to swap out formish and give it a go in a few weeks,

T

On Thu, Sep 9, 2010 at 4:57 AM, Chris McDonough chr...@plope.com wrote:
 And, more or less, with some slight differences in spellings, and one
 additional feature this is what is now in Colander 0.8:

 http://docs.repoze.org/colander/binding.html

 - C


 On Wed, 2010-09-08 at 12:25 -0400, Chris McDonough wrote:
 I've been thinking about how to solve this problem, and what I've come
 up with so far is this:

 - Schemas may be bound to a set of values.  When a schema is bound,
   it is cloned, and any deferred values it has will be resolved.

 - A deferred value is a callable that accepts the schema node being
   bound and a set of arbitrary keyword arguments.  It should
   return a value appropriate for its usage (a widget, a missing value,
   a validator, etc).

 - Deferred values are not resolved until the schema is bound.

 - Schemas are bound via SomeSchema().bind(**kw).  The values in kw
   are passed to each deferred value along with the schema node being
   bound.

 Here's an example:

 
 @colander.deferred
 def deferred_date_validator(node, **kw):
     max_date = kw.get('max_date')
     if max_date is None:
         max_date = datetime.date.today()
     return colander.Range(min=datetime.date.min, max=max_date)

 @colander.deferred
 def deferred_date_description(node, **kw):
     max_date = kw.get('max_date')
     if max_date is None:
         max_date = datetime.date.today()
     return 'Blog post date (no earlier than %s)' % max_date.ctime()

 @colander.deferred
 def deferred_date_missing(node, **kw):
     default_date = kw.get('default_date')
     if default_date is None:
         default_date = datetime.date.today()
     return default_date

 @colander.deferred
 def deferred_body_validator(node, **kw):
     max_bodylen = kw.get('max_bodylen')
     if max_bodylen is None:
         max_bodylen = 1  18
     return colander.Length(max=max_bodylen)

 @colander.deferred
 def deferred_body_description(node, **kw):
     max_bodylen = kw.get('max_bodylen')
     if max_bodylen is None:
         max_bodylen = 1  18
     return 'Blog post body (no longer than %s bytes)' % max_bodylen

 @colander.deferred
 def deferred_body_widget(node, **kw):
     body_type = kw.get('body_type')
     if body_type == 'richtext':
         widget = deform.widget.RichTextWidget()
     else:
         widget = deform.widget.TextAreaWidget()
     return widget

 @colander.deferred
 def deferred_category_validator(node, **kw):
     categories = kw.get('categories', [])
     return colander.OneOf([ x[0] for x in categories ])

 @colander.deferred
 def deferred_category_widget(node, **kw):
     categories = kw.get('categories', [])
     return deform.widget.RadioChoiceWidget(values=categories)

 class BlogPostSchema(Schema):
     title = SchemaNode(
         colander.String(),
         title = 'Title',
         description = 'Blog post title',
         validator = colander.Length(min=5, max=100),
         widget = deform.widget.TextInputWidget(),
         )
     date = SchemaNode(
         colander.Date(),
         title = 'Date',
         missing = deferred_date_missing,
         description = deferred_date_description,
         validator = deferred_date_validator,
         widget = deform.widget.DateInputWidget(),
         )
     body = SchemaNode(
         colander.String(),
         title = 'Body',
         description = deferred_body_description,
         validator = deferred_body_validator,
         widget = deferred_body_widget,
         )
     category = SchemaNode(
         colander.String(),
         title = 'Category',
         description = 'Blog post category',
         validator = deferred_category_validator,
         widget = deferred_category_widget,
         )

 schema = BlogPostSchema().bind(
     max_date = datetime.date.max,
     max_bodylen = 5000,
     body_type = 'richtext',
     default_date = datetime.date.today(),
     )
 form = deform.Form(schema)
 

 This proposal does not deal with conditional inclusion or exclusion of
 schema nodes, only resolving deferred schema properties.

 Comments are appreciated.

 - C




 On Tue, 2010-09-07 at 20:37 +0800, Tim Hoffman wrote:
  Bummer ;-)
 
 
  I don't think I have a developed an application in the last 10 years
  that hasn't has to do this.
  I was quite surprised when I discovered this feature was missing in
  formish, but it seems to be missing in quite a
  few other form libs like wtforms as well.
 
  I suppose at least they all have declarative method of defining the
  schema, but it does mean the actual schema definition is a bit more
  obscured.
 
  Cheers
 
  T
 
 
 
 
  On Tue, Sep 7, 2010 at 8:20 PM, Chris McDonough chr...@plope.com wrote:
   Hi Tim,
  
   Sorry, there is no built-in solution that will allow you to use
   declarative-module-scope code only.  You'll need to generate schemas and
   widgets at render time

Re: [Repoze-dev] Deform and late binding of source values for checkbox widget and validators

2010-09-07 Thread Tim Hoffman
Bummer ;-)


I don't think I have a developed an application in the last 10 years
that hasn't has to do this.
I was quite surprised when I discovered this feature was missing in
formish, but it seems to be missing in quite a
few other form libs like wtforms as well.

I suppose at least they all have declarative method of defining the
schema, but it does mean the actual schema definition is a bit more
obscured.

Cheers

T




On Tue, Sep 7, 2010 at 8:20 PM, Chris McDonough chr...@plope.com wrote:
 Hi Tim,

 Sorry, there is no built-in solution that will allow you to use
 declarative-module-scope code only.  You'll need to generate schemas and
 widgets at render time.

 - C


 On Tue, 2010-09-07 at 12:56 +0800, Tim Hoffman wrote:
 Hi Chris.

 Am just starting too look at deform in some detail and I have question.

 One of the things I have struggled with formish has been the fact I
 can't easily
 define a source of values for widgets like checkbox or validators such
 as OneOf to
 only be resolved late at render time. And I can't see how I would go
 about it with deform.

 In your example http://docs.repoze.org/deform/app.html you have
  colors = (('red', 'Red'), ('green', 'Green'), ('blue', 'Blue')) used
 as values for

 widget.RadioChoiceWidget values and for the validator OneOf

 So in my contrived example I would like the set of possible values
 for color is dependent on the
 user and some other factor.  Looking at the code for SelectWidget and
 RadioChoice widget
 it appears they won't take a callable and lazily render those values
 at render time.


 With formish I basically constructed the form structure (schema)
 but only applied widget definitions  and validators just before render
 time. So that I could use things
 like the current context to determine values for validation or
 choices.  This was a bit of a hack.


 So do you have a strategy or suggestion on how to approach this use case ?

 I suppose I could work with imperative schema definition performed
 late, but I much prefer to work with classes.
 (I currently generate Formish (structures) directly from UML).

 Cheers

 Tim
 ___
 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] Model-based vs. view-based security

2010-07-29 Thread Tim Hoffman
Hi


  TH I use a UML modeling tool to generate all my models and form schemas
 so I
  TH tend not to write much code in these entities.

 That's interesting, any pointer/link for this specific tool?


I am using enterprise architect.   http://www.sparxsystems.com.au/  It can
actually reverse engineer and generate python, but its code lifecycle tools
really need some customising (in tool) for python.  EE will also reverse
engineer (with full roundtrip) from RDBMS, WSDL, C, Java, C++, . .

So I am using a code generation tool that I have written over the last few
years (for another customer, so at the moment I can't release it, but am
planning to rewrite it to target both argouml and enterprise architect).

I am currently able to generate from the xmi files the following

storm schema from a reverse engineered rdbms.
zope3 model and schema
bobo view/routes/subroutes (and some viewlet equivalents - basic zope
component multi adapter lookup of view fragments, based on context, request,
user, view)
bfg models
formish form schema.
postresql DDL.

code generation templates are based on dtml.

Conceptually its inspired by archgenxml but I found it too difficult to
repurpose archgenxml for completely different purposes.

Rgds

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


Re: [Repoze-dev] Model-based vs. view-based security

2010-07-28 Thread Tim Hoffman
Hi



 2) With the security proxy machinery I can have a view that
 conditionally displays certain HTML elements (like form fields)
 depending on the permissions that the accessing user has on the context
 object.


I too came to bfg from zope2 and zope 3 and was used to model based
security,
however the complete disconnection of forms from models in bfg is just
fantastic ;-)

I always found that whilst forms tied to the model was nice for simple
things (ala basic crud) the minute
you had complex forms (aggregate forms, forms with no model etc) that the
tight binding of model and form was
a big pain.  Separating form from model has been a real godsend for some of
my latest projects.

I use a UML modeling tool to generate all my models and form schemas so I
tend not to write much code in these entities.

I personally think the form schema is much more about the view than the
model.

Rgds

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


Re: [Repoze-dev] repoze.folder API weirdness

2010-06-17 Thread Tim Hoffman
For what its worth I would follow the current zope object manager
 semantics.

Rgds

T

On Thu, Jun 17, 2010 at 10:41 PM, Chris Rossi ch...@archimedeanco.comwrote:



 On Thu, Jun 17, 2010 at 10:08 AM, Tim Hoffman zutes...@gmail.com wrote:

 I would be concerned if you tried to __setitem__ a new page to replace the
 existing folder of the same name
 thus blowing away a whole heap of subfolders and documents in the process.

 Very bad ;-(

 I would tend to think that responsibility for protecting the user from
 errors lies at the UI and application level.  An API, generally speaking,
 should just do what it's told.

 I don't think I have a preference between wiggy's and mcdonc's proposals.

 Chris


 ___
 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.org doesn't seem to be responding (at least from Australia)

2010-05-23 Thread Tim Hoffman
Hi

Subject says it all.. Anyone else experience it or is it just me ;-)

Rgds

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


Re: [Repoze-dev] repoze.org doesn't seem to be responding (at least from Australia)

2010-05-23 Thread Tim Hoffman
Looks like its dead again

T

On Sun, May 23, 2010 at 8:33 PM, Tres Seaver tsea...@palladion.com wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Charlie Clark wrote:
  Am 23.05.2010, 11:28 Uhr, schrieb Tim Hoffman zutes...@gmail.com:
 
  Hi
  Subject says it all.. Anyone else experience it or is it just me
 
  Invisible here as well. Maybe they've installed Plone? ;-)

 I have asked the hosting service to reboot the machine, after their
 self-help reboot didn't work.



 Tres.
 - --
 ===
 Tres Seaver  +1 540-429-0999  tsea...@palladion.com
 Palladion Software   Excellence by Designhttp://palladion.com
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAkv5II8ACgkQ+gerLs4ltQ4xeACgqPk6Xe1XYf3xecgHUjL+xyi9
 +sUAoKyZ5dkKfhDkcxTOCelOkNObjzHz
 =y1Xm
 -END PGP SIGNATURE-
 ___
 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] google wave for apps domain is available - have enabled it for ktstudio.org

2010-05-19 Thread Tim Hoffman

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


[Repoze-dev] Issue with enabling the ZCA Global API by Using The ZCA Global Registry

2010-05-06 Thread Tim Hoffman
Hi

I am trying to run a combined global zca registry as per the docs
http://docs.repoze.org/bfg/1.2/narr/zca.html.

I am using the Enabling the ZCA Global API by Using The ZCA Global
Registry option

globalreg = getGlobalSiteManager()
config = Configurator(registry=globalreg)
config.setup_registry(settings=settings)

Unfortunately Configurator.make_wsgi_app calls self.registry.notify
(line 418 of Configurator.py)
however a zope.component.globalregistry.BaseGlobalComponents doesn't
have a notify method so it barfs ;-)


 File /home/timh/qtrack/qtrack/pages_handler.py, line 88, in main
application = config.make_wsgi_app()
  File 
/home/timh/qtrack/lib/python2.5/site-packages/repoze.bfg-1.2.1-py2.5.egg/repoze/bfg/configuration.py,
line 418, in make_wsgi_app
self.registry.notify(WSGIApplicationCreatedEvent(app))
AttributeError: 'BaseGlobalComponents' object has no attribute 'notify'


I am going to wrap the registry to give it the notify method before I
stick the registry in the configurator  (I do want want subscribers
notified),
but as it stands what is documented won't work.

Regards

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


Re: [Repoze-dev] BFG and GAE

2010-05-05 Thread Tim Hoffman
Hi All

We (KT Studio), have a fairly significant site based on BFG (pre 1.1)
running on app engine very successfully. (www.polytechnic.wa.edu.au).
(We have other bfg based app engine apps in the pipeline). (Also about
to go live with a bobo, repoze.what and zope.component/zope.interface,
formish based app as an alternate stack)

Much of what Chris has said is spot on the mark, (though there are
emerging tools like TyphoonAE which provide
an alternate deployment to google for the app engine api).  In fact
appengine should really be thought of as an API and collection of
services that you build your application too.

We see a huge advantage in app engine if you can deal with the
restrictions of the platform because it
does remove a major area of support requirements (namely the OS,
scaling, failover and the app stack (web server, rdbms etc)).

The main things I find I have to do when building is removing things
we don't use, (paste scripts don't help much, therefor no ini files
etc.., ) , Which really means just hooking  bfg up with the wsgi
handler.

I personally think bfg offers some big advantages over Django on
appengine, though you probably have to do a little more work in some
areas, but there seems to be a bit of an impedance mis-match between
Django its ORM and App Engine.

Where as bfg just gets out of the way, but does what it does well.
Also not tying forms directly to the model is a good thing.
I really have not found myself trying to work around things in
appengine.  (Especially now we can do configuration directly in
python).

Just my 2c ;-)

T



On Thu, May 6, 2010 at 1:13 AM, Charlie Clark
charlie.cl...@clark-consulting.eu wrote:
 Am 05.05.2010, 17:10 Uhr, schrieb Alex Clark acl...@aclark.net:

 However I'll mention I see guys like philikon (http://i-luuv.appspot.com)
 and davisagli (http://buildthreat.appspot.com/) building cool apps on
 GAE
 and I can't help but wonder what it would be like if the BFG/GAE story
 was complete and in place.

 Please forgive the ignorance but is actually cool about those two sites?

 Charlie
 --
 Charlie Clark
 Managing Director
 Clark Consulting  Research
 German Office
 Helmholtzstr. 20
 Düsseldorf
 D- 40215
 Tel: +49-211-600-3657
 Mobile: +49-178-782-6226
 ___
 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] repoze.bfg and gae

2010-04-22 Thread Tim Hoffman
Hi Davide

No refactoring is required that I have found to date.  You just can't
use zodb etc
so you need to use appengines models.  So you are using the
view/traversal/routes/events parts of
bfg. I would also suggest you declare views using python rather than using zcml.

T

On Thu, Apr 22, 2010 at 8:33 PM, Davide Moro davide.m...@redomino.com wrote:
 Hi,
 I have a question about repoze.bfg that runs on Google App Engine, hope
 this is the right list.

 Does a bfg's callable view code need to be refactored when our
 application runs on GAE? I mean, for example it is possible to getting
 data from the params attribute of the webob request or we need to manage
 things in other ways?

 Thanks,

 davide


 --
 Davide Moro

 Redomino S.r.l.
 Largo Valgioie 14,
 10146 Torino Italy
 Tel: +39 0117499875
 http://redomino.com

 ___
 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] repoze.bfg and gae

2010-04-22 Thread Tim Hoffman
HI Davide

The comment re: zcml is more about startup performance.  zcml works
fine its just slower and harder to
remove extraneous stuff.

I am using request.params.get/request.POST with no problems.

Note in the debugger in gae you will need to

use p to output values

as in

(Pdb) p request

Otherwise nothing will show.  I would suggest request.POST is defined
other wide you would have
NoneType has not attribute POST.

Rgds

T






On Thu, Apr 22, 2010 at 9:49 PM, Davide Moro davide.m...@redomino.com wrote:
 Il giorno gio, 22/04/2010 alle 20.45 +0800, Tim Hoffman ha scritto:
 Hi Davide

 No refactoring is required that I have found to date.  You just can't
 use zodb etc
 so you need to use appengines models.  So you are using the
 view/traversal/routes/events parts of
 bfg. I would also suggest you declare views using python rather than using 
 zcml.

 Hi Tim,
 thank you for your tips. So using zcml with gae we can expect problems?

 Yes, I know that you cannot use zodb and I'm dealing with gae models but
 my question is another.
 In my simple standalone bfg application I am able to get params data
 from the webob request in a callable view (request.params.get('name') or
 request.GET/POST).

 Running the same code under GAE I'm not able to get any data in my
 callable view and I was just wondering if I'm missing something. It
 seems that request is not defined.

 Without GAE:
 (Pdb) request.params
 UnicodeMultiDict([('id', u'asdf'), ('name', u'asdf')])


 With GAE:
 (Pdb) request.params
 (Pdb)


 Thanks,

 davide

 --
 Davide Moro

 Redomino S.r.l.
 Largo Valgioie 14,
 10146 Torino Italy
 Tel: +39 0117499875
 http://redomino.com


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


Re: [Repoze-dev] GAE or other 'cloud' choices for bfg apps?

2010-04-17 Thread Tim Hoffman
HI Darryl

Here's a couple of quick tips and these where a big win for us.

1.  Memcache page output heavily, and  if possible serve the pages
without even starting up or initialising bfg.
We found we could do a cold startup and serve a page from cache in
200ms cached page from memcache in 30ms. In this scenario you don't
want to import any thirdparty libraries, just use what comes out of
the box from appengine. (  ie importing any module not part of the
core gae env always seems to take longer.)   Whereas just starting bfg
before doing anything could take between 3-4 sec and on a bad day a
lot longer.  Then if its not in the cache start bfg and process the
page request.

2.  Defer loading/importing stuff where possible.  For instance we use
formish/schemaish for forms.  But if no one is logged in
then we don't need to do the formish/schema imports.  If someone is
logged in then we do import formish.  That way we only incur import
costs when we actually use things. This is hard to control with zcml
and a lot easier to do if you are directly registering things in
python.  Also it means you don't have the cost of parsing zcml as
well.

Rgds

T



On Sat, Apr 17, 2010 at 3:52 AM, Darryl Cousins
darryljcous...@gmail.com wrote:
 Hi Tim,

 On Thu, Apr 15, 2010 at 1:55 PM, Tim Hoffman zutes...@gmail.com wrote:
 Hi Iain

 I have a number of projects on app engine.  Some using repoze.bfg
 (www.polytechnic.wa.edu.au (paid work), www.fishandlily.com.au (my
 small business)) and others just using zope.component and bobo (not
 public yet).

 We are using app engines persistence model which is simple and
 straight forward.  (http://code.google.com/p/bfg-pages/ has some
 examples of implementing a very simple cms on bfg and appengine, it
 implements traversal over entities in the datastore as folders and
 content).

 I think bfg is a good fit with appengine.  A couple of pointers, you
 are basically using the view, traversal, component registry
 mechanisms and not zodb/persistence (which isn't really core to bfg).
 We are not currently using chameleon but straight zpt with a custom
 bindings see the link above. You need to watch startup times so I am
 moving  away from using zcml and using python to register things.

 Yes, start up time is something I've noticed too. Aside from not using
 zcml for component registration do you have any other pointers to help
 with that problem?

 Thanks in advance,
 Darryl Cousins


 The really big advantage of app engine as I see it, is not having to
 deal with the system platform (ie cpu's disk, memory, networks, etc..)
  app engine is purely a runtime and services. So if you have little in
 the way of IT admin support, it is a big win.
 You do have to make some concessions/design compromises to take into
 account the restrictions enforced by the platform.

 As for economics www.polytechnic.wa.edu.au gets about 7000 unique
 visitors a day, around 20,000-50,000 page views a day and
 we have billing enabled but rarely get over 50% of the free quota so
 it's currently not costing anything at the moment to run.

 Rgds

 T


 On Thu, Apr 15, 2010 at 7:46 AM, Iain Duncan iainduncanli...@gmail.com 
 wrote:
 Hey all, I have an app that eventually is intended to be used as a
 subscriber service. I'm totally new to the cloud thing, wondering if
 experienced bfg'ers would like to weigh in with their experiences
 - what is your preferred cloud deployment for bfg apps?
 - what persistence mechanism gets used? Is there some kind of facade over
 the bigtable? How do you handle it?
 - what is your experience with using cloud deployment, do you think it's
 even worth it?
 thanks!
 Iain
 ___
 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 mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] GAE or other 'cloud' choices for bfg apps?

2010-04-14 Thread Tim Hoffman
Hi Iain

I have a number of projects on app engine.  Some using repoze.bfg
(www.polytechnic.wa.edu.au (paid work), www.fishandlily.com.au (my
small business)) and others just using zope.component and bobo (not
public yet).

We are using app engines persistence model which is simple and
straight forward.  (http://code.google.com/p/bfg-pages/ has some
examples of implementing a very simple cms on bfg and appengine, it
implements traversal over entities in the datastore as folders and
content).

I think bfg is a good fit with appengine.  A couple of pointers, you
are basically using the view, traversal, component registry
mechanisms and not zodb/persistence (which isn't really core to bfg).
We are not currently using chameleon but straight zpt with a custom
bindings see the link above. You need to watch startup times so I am
moving  away from using zcml and using python to register things.

The really big advantage of app engine as I see it, is not having to
deal with the system platform (ie cpu's disk, memory, networks, etc..)
 app engine is purely a runtime and services. So if you have little in
the way of IT admin support, it is a big win.
You do have to make some concessions/design compromises to take into
account the restrictions enforced by the platform.

As for economics www.polytechnic.wa.edu.au gets about 7000 unique
visitors a day, around 20,000-50,000 page views a day and
we have billing enabled but rarely get over 50% of the free quota so
it's currently not costing anything at the moment to run.

Rgds

T


On Thu, Apr 15, 2010 at 7:46 AM, Iain Duncan iainduncanli...@gmail.com wrote:
 Hey all, I have an app that eventually is intended to be used as a
 subscriber service. I'm totally new to the cloud thing, wondering if
 experienced bfg'ers would like to weigh in with their experiences
 - what is your preferred cloud deployment for bfg apps?
 - what persistence mechanism gets used? Is there some kind of facade over
 the bigtable? How do you handle it?
 - what is your experience with using cloud deployment, do you think it's
 even worth it?
 thanks!
 Iain
 ___
 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] GAE or other 'cloud' choices for bfg apps?

2010-04-14 Thread Tim Hoffman
Hi Iain

http://code.google.com/appengine/docs/python/datastore/entitiesandmodels.html

Will get you started on app engines high level datastore peristence.

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


Re: [Repoze-dev] recommended way to do session variables in a bfg app?

2010-04-12 Thread Tim Hoffman
Hi

I am using beaker with bfg on app engine. Works well.  (Though I had
to make a gae memcache compatible plugin)

T

On Mon, Apr 12, 2010 at 3:10 AM, Iain Duncan iainduncanli...@gmail.com wrote:
 Wondering about using session variables in a bfg app. I didn't find any
 mention of it in the docs, so I assume it's something handled outside of
 bfg. Is the crustimony proceedcake just to add Beaker to the middleware
 stack and use it directly?
 thanks
 Iain
 ___
 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] current repoze.who in PyPI and repoze.what

2010-04-06 Thread Tim Hoffman
Yep thats what found.

But at the moment if you easy_install repoze.what you end up with
repoze.who.2.0.x and you can't seem to get
repoze.who 1.0.18 from PyPI

T

On Tue, Apr 6, 2010 at 1:26 PM, Chris McDonough chr...@plope.com wrote:
 On 4/6/10 1:12 AM, Tim Hoffman wrote:

 Hi

 I have been using repoze.what (1.0.8) and (due to dependancies)
 repoze.who 1.0.18 for the last couple of months.
 Today we where setting up a new instance and found that repoze.who
 2.0.a2 was coming down from PyPI as it is
 the most recent version and repoze.who 1.0.18 was hidden.

 We found code that was working was now failing silently (changes with
 aut_tkt I believe)  (ok maybe not an error but user auth that was
 working stopped haven't found out yet
 what exactly was going wrong).

 Is 2.0.xx of repoze.who supposed to be the correct version for
 repoze.what 1.0.18 it looks like repoze.what dependancies on
 repoze.who is just  1.0 ?

 I'd use the 1.X version of r.who for best compatibility.

 - C

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


Re: [Repoze-dev] Using traversal with GAE's BigTable

2010-03-30 Thread Tim Hoffman
Hi

Have a look at http://code.google.com/p/bfg-pages/

I have used it in a number of projects.  Its a very rough and ready
cms, with traversal.
Across folders etc. mapped to gae entities.  It has been used on a
number of
in production appengine projects.

T

On Wed, Mar 31, 2010 at 1:29 AM, george hu geo...@gmail.com wrote:
 I have a small repoze.bfg application which has a traversal/ZODB structure,
 I got trouble with moving it to the GAE, as my understanding for now, on GAE
 there is only BigTable supported, I guess have to rewrite the model part of
 my code to adapt it into the GAE. Does any body has experience of doing
 this? A sample of Model.py is highly appreciated.

 George  Hu

 ___
 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] Need advise on using session with repoze.bfg

2010-02-18 Thread Tim Hoffman
Hi

Yeah I am using beaker on app engine as well with bfg, real easy to
setup and it works well.
I am using memcache on app engine as the store at the moment as I
don't mind if sessions
disappear if not used for a little while, but it would be easy to make
writes to the session persist in the datastore.

T

On Fri, Feb 19, 2010 at 8:51 AM, Fernando Correa Neto fcd...@gmail.com wrote:
 Hey there,

 Using beaker is no biggie.
 In your .ini you need something like:

 [filter:beaker]
 use = egg:Beaker#beaker_session
 beaker.session.key = yourapp.session
 beaker.session.secret = supersecret

 [pipeline:main]
 pipeline = egg:repoze.zodbconn#closer
           egg:repoze.tm2#tm
           beaker
           app

 And then you'll have 'yourapp.session' in your environment. i.e.:
 request.environ['yourapp.session'] or
 request.environ['beaker.session'].

 Cheers,
 Fernando

 On Thu, Feb 18, 2010 at 10:10 PM, georgehu geo...@gmail.com wrote:
 I'm trying to implement a simple session management like the Amazon
 site, you can throw your order item into your shopping cart even without
 a login, and Amazon can remember your ordered items for many days. I'm
 using mysql and sqlalchemy, according to the document, the Beaker is
 suggested in this case. But I would like to see an example code snippet
 or tutorial on how to do it.

 Thanks

 George Hu
 ___
 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 mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Looking for advice on how to use repoze.what to protect a specific resource/entity.

2010-02-16 Thread Tim Hoffman
Hi Chris

Yeah , after Tres repose, and thinking further on the abstractions I
thinking along simliar lines, sort of collapsing the notion of a role
and permission together.

Thanks for the input.  I am pretty sure this is the path I will take.

It seems to play nicer with what I am trying to achieve than
repoze.what predicates which seem to not suit context evaluation.

I will get my uml - python generator to spit out routes and bfg views
and think about how I want to annotate the model
to support the acl declerations.

Thanks everyone for the input.

T

On Tue, Feb 16, 2010 at 9:07 PM, Chris McDonough chr...@plope.com wrote:
 You might choose to not have a special owner principal if you're already
 generating the __acl__ via a property.  Instead, you might just think of
 owner as a set of permission names, and generate the right ACL.

 For instance, if you store a set of owner names as the owners attribute of
 a model (when the model is created or modified):

    model.owners
   ['tim', 'chris']

 And you have, somewhere in your code, something like the following:

   OWNER_PERMISSIONS = ('read', 'write', 'delete')

 Something like this can be done in your __acl__ property:

   acl = []
   for owner in self.owners:
       acl.append((Allow, owner, OWNER_PERMISSIONS))
   ... other mutations to the acl ...
   return acl

 Then if you need to show the owners in the UI, use model.owners, and don't
 try to imply any ownership info from the ACL itself.


 On 2/15/10 6:52 PM, Tim Hoffman wrote:

 Hi

 I could at the very least evaluate the Owner special principal
 into the real owner, when I provide the __acl__ registration via the
 property accessor

 Most of the project is defined in a uml model and the code is being
 generated. So
 declaring the permissions where possible in the model means I need to use
 abstractions representing things like Owner in the model

 T

 On Tue, Feb 16, 2010 at 7:49 AM, Tim Hoffmanzutes...@gmail.com  wrote:

 HI Tres

 The last thing I would love to be able to do would be to declare the
 permissions
 at the class level

 as in

 (Allow, Owner, edit)

 And have a Owner a special principal like Everyone,
 that allows me to declare the permission. But only evaluates owner
 when the permission is checked

 Do you think that could work, I haven't worked out how I could
 implement that though.

 T

 On Tue, Feb 16, 2010 at 7:24 AM, Tres Seavertsea...@palladion.com
  wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Tim Hoffman wrote:

 I was hoping to declare the local role equivalent at the class level,
 but following from what you said

 I have a class declaration for site_manager and persist
 a user/owner declaration on the object at creation time ?

 Then when I retrieve the entity from the app engine datastore
 have a __acl__ property accessor which
 then merges the class declaration with the persisted addition
 definition of ower.

 Does that sound like an appropriate approach?

 That sounds like it would work, yes.


 Tres.
 - --
 ===
 Tres Seaver          +1 540-429-0999          tsea...@palladion.com
 Palladion Software   Excellence by Design    http://palladion.com
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAkt516wACgkQ+gerLs4ltQ4I6ACfaqLKXOodUYv8GroTYAPN3TwL
 izQAnA1Y6ojjgLB/LgpHpTFU08LoRI0h
 =ruoG
 -END PGP SIGNATURE-


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



 --
 Chris McDonough
 Agendaless Consulting, Fredericksburg VA
 The repoze.bfg Web Application Framework Book: http://bfg.repoze.org/book

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


[Repoze-dev] Looking for advice on how to use repoze.what to protect a specific resource/entity.

2010-02-15 Thread Tim Hoffman
Hi

I am trying to work out how I could protect a specific resource/entity
using repoze.what.

For instance I have a specific Record, owned by a specific User, and
only a user with the Owner permission can Edit the record.

I can't work out how you would assign Owner permission to the user only when
accessing Record.  i.e the user in question would not be owner of
any other record.

It seems the group source and permission source act on a global basis
and aren't context aware.  And predicates check_authorization() calls
only take a environ
and therefore you can only protect things like URL's not entities.

Am I trying to do something not possible/intended for repoze.what.

I suppose I am looking for functionality similiar to zope2
permissions/roles etc...

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


Re: [Repoze-dev] Looking for advice on how to use repoze.what to protect a specific resource/entity.

2010-02-15 Thread Tim Hoffman
Hi Gustavo

Yeah I have thought about writing custom Predicates.

The main problem I saw with it was it appears I would have to pass in the
object to be checked at
predicate instantiation time, rather than at evaluation time.

evaluate only takes environ and credentials.
Which means I would have to somehow stuff the entity into the wsgi environ
or I would be retrieving the object
a second time inside the evaluate predicate, when I already have it. And
that would seem expensive (I am running on App Engine).

So using your example from the docs.

It would look something like.


from repoze.what.predicates import Predicate

class is_author(Predicate):
   message = 'Only %(author)s can manage post %(post_id)s'

   def __init__(self,context,**kwargs):
   super(is_author,self).__init__(kwargs)
   self.context = context

   def evaluate(self, environ, credentials):

   if self.context.author != credentials.get('repoze.what.userid'):
   self.unmet(post_id=post_id, author=post.author_userid)

And then

# Can the user edit the post?  (must be site manager or owner)

from repoze.what.predicates import Any, has_permission
p =  Any(has_permission('site_manager'),is_author(context))

T

On Tue, Feb 16, 2010 at 5:41 AM, Gustavo Narea m...@gustavonarea.net wrote:
 Hello, Tim.

 The groups/permissions functionality is just something basic and
 optional, to help people get started, although for some smaller projects
 it may be good enough. For finer-grained control, you may want to check
 this:

http://what.repoze.org/docs/1.0/Manual/Predicates/Writing.html#creating-a-predicate-checker-more-sensitive-to-the-request

 I've never really wanted to offer a similar functionality
 out-of-the-box. I've given some thought to this, and never came up with
 non-intrusive way of addressing this kind of situations. But I'm always
 open to hear alternatives.

 I hope this is what you were looking for.

  - Gustavo.


 On 15/02/10 15:19, Tim Hoffman wrote:
 Hi

 I am trying to work out how I could protect a specific resource/entity
 using repoze.what.

 For instance I have a specific Record, owned by a specific User, and
 only a user with the Owner permission can Edit the record.

 I can't work out how you would assign Owner permission to the user only
when
 accessing Record.  i.e the user in question would not be owner of
 any other record.

 It seems the group source and permission source act on a global basis
 and aren't context aware.  And predicates check_authorization() calls
 only take a environ
 and therefore you can only protect things like URL's not entities.

 Am I trying to do something not possible/intended for repoze.what.

 I suppose I am looking for functionality similiar to zope2
 permissions/roles etc...

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



 --
 Gustavo Narea xri://=Gustavo.


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


Re: [Repoze-dev] Looking for advice on how to use repoze.what to protect a specific resource/entity.

2010-02-15 Thread Tim Hoffman
Hi Chris.

I have been rereading the ACL's for repoze.bfg and am having trouble
getting my head bits of it.

I could easily use repoze.bfg for this project, though I really don't
need all of bfg in this instance,so was
seeing if I could get by with just bobo and repoze.what (oh and I was
hoping to leverage of the openid
and various other authent plugins for repoze.who).

But ignoring authentication for the moment.

Can you give me hint on the approach I would take becuase in my example
If I wanted an ACL on the persistent model as per my original it would
be declared something like the following.

(I am ignoring creation for the moment.) The goal is only the owner of
a particular entity
or a user with the site_manager role can edit it.  And I won't know
someone is owner until I have the
object. I assuming you would have a sort of transient group owner
and someone would only be
in it if they are the owner ?

The I could declare the owner permssion etc,.. as follows

from repoze.bfg.security import Allow

 __acl__ = [
(Allow, Everyone, 'view'),
(Allow, 'group:owner', 'edit'),
(Allow, 'group:site_managers', 'edit'),
]

The bit I can't work out is how I would determine of the user is
Owner of the content.
Would that be through a custom AuthorizationPolicy or a Authentication Policy.

Or am I thinking about this the wrong way around ?

In zope2 a principal would have a number of potential roles dependant
on the context.  So I am trying to get that style of behaviour.

T







On Tue, Feb 16, 2010 at 1:27 AM, Chris McDonough chr...@plope.com wrote:

 I don't know if things have changed, but the last time I talked to Gustavo, 
 this was an intrinsic limitation in repoze.what v1.  It doesn't handle 
 context-sensitive authorization.

 - C


 On 2/15/10 10:19 AM, Tim Hoffman wrote:

 Hi

 I am trying to work out how I could protect a specific resource/entity
 using repoze.what.

 For instance I have a specific Record, owned by a specific User, and
 only a user with the Owner permission can Edit the record.

 I can't work out how you would assign Owner permission to the user only 
 when
 accessing Record.  i.e the user in question would not be owner of
 any other record.

 It seems the group source and permission source act on a global basis
 and aren't context aware.  And predicates check_authorization() calls
 only take a environ
 and therefore you can only protect things like URL's not entities.

 Am I trying to do something not possible/intended for repoze.what.

 I suppose I am looking for functionality similiar to zope2
 permissions/roles etc...

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



 --
 Chris McDonough
 Agendaless Consulting, Fredericksburg VA
 The repoze.bfg Web Application Framework Book: http://bfg.repoze.org/book
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] Looking for advice on how to use repoze.what to protect a specific resource/entity.

2010-02-15 Thread Tim Hoffman
HI Tres

The last thing I would love to be able to do would be to declare the
permissions
at the class level

as in

(Allow, Owner, edit)

And have a Owner a special principal like Everyone,
that allows me to declare the permission. But only evaluates owner
when the permission is checked

Do you think that could work, I haven't worked out how I could
implement that though.

T

On Tue, Feb 16, 2010 at 7:24 AM, Tres Seaver tsea...@palladion.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Tim Hoffman wrote:

 I was hoping to declare the local role equivalent at the class level,
 but following from what you said

 I have a class declaration for site_manager and persist
 a user/owner declaration on the object at creation time ?

 Then when I retrieve the entity from the app engine datastore
 have a __acl__ property accessor which
 then merges the class declaration with the persisted addition
 definition of ower.

 Does that sound like an appropriate approach?

 That sounds like it would work, yes.


 Tres.
 - --
 ===
 Tres Seaver          +1 540-429-0999          tsea...@palladion.com
 Palladion Software   Excellence by Design    http://palladion.com
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAkt516wACgkQ+gerLs4ltQ4I6ACfaqLKXOodUYv8GroTYAPN3TwL
 izQAnA1Y6ojjgLB/LgpHpTFU08LoRI0h
 =ruoG
 -END PGP SIGNATURE-

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


Re: [Repoze-dev] Looking for advice on how to use repoze.what to protect a specific resource/entity.

2010-02-15 Thread Tim Hoffman
Hi

I could at the very least evaluate the Owner special principal
into the real owner, when I provide the __acl__ registration via the
property accessor

Most of the project is defined in a uml model and the code is being
generated. So
declaring the permissions where possible in the model means I need to use
abstractions representing things like Owner in the model

T

On Tue, Feb 16, 2010 at 7:49 AM, Tim Hoffman zutes...@gmail.com wrote:
 HI Tres

 The last thing I would love to be able to do would be to declare the
 permissions
 at the class level

 as in

 (Allow, Owner, edit)

 And have a Owner a special principal like Everyone,
 that allows me to declare the permission. But only evaluates owner
 when the permission is checked

 Do you think that could work, I haven't worked out how I could
 implement that though.

 T

 On Tue, Feb 16, 2010 at 7:24 AM, Tres Seaver tsea...@palladion.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Tim Hoffman wrote:

 I was hoping to declare the local role equivalent at the class level,
 but following from what you said

 I have a class declaration for site_manager and persist
 a user/owner declaration on the object at creation time ?

 Then when I retrieve the entity from the app engine datastore
 have a __acl__ property accessor which
 then merges the class declaration with the persisted addition
 definition of ower.

 Does that sound like an appropriate approach?

 That sounds like it would work, yes.


 Tres.
 - --
 ===
 Tres Seaver          +1 540-429-0999          tsea...@palladion.com
 Palladion Software   Excellence by Design    http://palladion.com
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAkt516wACgkQ+gerLs4ltQ4I6ACfaqLKXOodUYv8GroTYAPN3TwL
 izQAnA1Y6ojjgLB/LgpHpTFU08LoRI0h
 =ruoG
 -END PGP SIGNATURE-


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


Re: [Repoze-dev] Chameleon on GAE

2010-02-04 Thread Tim Hoffman
Hi Malthe

On Thu, Feb 4, 2010 at 8:53 PM, Malthe Borch mbo...@gmail.com wrote:
 On 4 February 2010 13:48, Tim Hoffman zutes...@gmail.com wrote:
 Do you mean it parses all templates on instance startup.  If so that
 would be prohibitively expensive
 if you have a lot of templates.

 Yes.

 And startup time (just processing all
 the zcml, and all the other imports) is problematic as it is.
 (In the project just compeleted www.polytechnic.wa.edu.au, there is
 131 template files.  (page templates and metal macros). Our startup
 time

 You can use the CHAMELEON_CACHE=1 environment setting to cache these.

Are intermediate python files created in the filesystem normally.  If
so then they could be deployed
and then the templates will always be in the filesystem on app engine as well.

Which in fact would be fine and probably the best approach. Just need
to then make sure that
nothing tries to regenerate them on startup time as that will fail.
(Which I assume couldn't happen)



 for a cold instance without anything in memcache is between 4 and 8
 secs.  If appengine is having problems then that can blow out a very
 long way)

 It probably makes a lot of sense to memcache the templates, although
 memcache might decide to expunge the cached files since they won't be
 used much (only at startup).

 Do you have any idea how much it costs to parse a template first time
 round vs traditional zpt.

 Chameleon takes substantially longer than ZPT to parse and compile templates.


So deploying the filesystem cache would be the way to go. Because even
parsing/compiling
them on demand is likely to be too slow.

 I am going to have to have a bit of play, but parsing all templates on
 startup has me really worried. Memcache would alleviate that somewhat
 but any new instance would then still have to check to see if every
 template exists in memcache on startup and parse missing ones.
 However the main problem with a memcache strategy on google is such
 that anything can disappear from it at any time, which means if it's
 gone from memcache then you would have to parse on use of the
 template.  Which sort of counters the whole approach. I wonder if the
 datastore could
 be used as a first line storage for the compiled templates.  The they
 could be loaded and then cached in memcache, that way the cost
 would not be too high if the are not present as the loader could grab
 them from the datastore.

 I thought just that, too. This approach might be good. Can you try it
 out? Other than that, perhaps it's possible to fool memcached.


Sticking templates in to the datastore would be relatively easy.  But if the
filesystem cache is deployed that would be the best. That way you are
sure to deploy
current templates from svn at deployment time.  Building/updating
compiled templates in the
datastore could be very prone to problems if you can't update it in a
realistic time from
and appengine also has versions so you would need to key all of the templates
based on the versions etc.  All starts getting a bit messy.

And unfortunately you can't fool googles memcache.  About all you
can hope is not exhaust the 250MB limit and keep everything active.
But from what I have experienced with memcache behaviour on
appengine you can't rely on it.  (ie you really need it and it does
a great job in helping you keeps things fast but you absolutely cannot
rely on stuff to stay in it.)

I will be playing with chameleon over the next few days and should have
some definitive answers by mid next week.

See ya

T

 \malthe

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


Re: [Repoze-dev] Chameleon on GAE

2010-02-03 Thread Tim Hoffman
So does this mean compiled code (.py) is deployed or does it parse -
generate etc on each instance startup
and possibly cache generated code in the module . given you can't
write to the filesystem.

T

On Thu, Feb 4, 2010 at 10:35 AM, Chris McDonough chr...@plope.com wrote:
 Hi Tim,

 AFAICT, as of 1.1 it just works.. no need to distinguish between compile
 time and runtime.  I tested this last night.

 - C


 On 2/3/10 8:50 PM, Tim Hoffman wrote:

 Hi Malthe

 Do you have a posting somewhere that details how one uses chameleon
 with appengine.
 I assume you are precompiling the template before deployment to appengine.

 But the only post I can find in repoze-dev talks about some strategies
 your where going to investigate.
 and I can't see anything in the docs specific.

 My guess is I use CHAMELEON_CACHE and then deploy its on disk cache of .py
 files

 Thanks

 T


 On Tue, Jan 26, 2010 at 7:42 PM, Malthe Borchmbo...@gmail.com  wrote:

 2010/1/26 Tim Hoffmanzutes...@gmail.com:

 So whats the secret , pre-compile everything ?

 Same procedure as last year, except we now use the compilation hoops
 from Genshi which makes it work, plus some rewrites of our code
 transformation logic.

 \malthe

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



 --
 The repoze.bfg Web Application Framework Book: http://bfg.repoze.org/book

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


Re: [Repoze-dev] Chameleon on GAE

2010-01-26 Thread Tim Hoffman
HI Malthe

Good news.

So whats the secret , pre-compile everything ?

T

On Tue, Jan 26, 2010 at 7:29 PM, Malthe Borch mbo...@gmail.com wrote:
 Deep in the mountains of Austria, during a snow storm, Chameleon
 became compatible with Google App Engine.
 ___
 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] Chameleon on GAE

2010-01-26 Thread Tim Hoffman
Cool

Can't wait to try it out.

Just starting a new repoze.bfg project (not a content based system
this time, but a specialised timesheet style of app
to record apprenticeship compliance with work elements or a course)
and may well give it a go.  We wil be only using limited templating as
most
of the app will be ajax/jquery gui based.

T

On Tue, Jan 26, 2010 at 7:42 PM, Malthe Borch mbo...@gmail.com wrote:
 2010/1/26 Tim Hoffman zutes...@gmail.com:
 So whats the secret , pre-compile everything ?

 Same procedure as last year, except we now use the compilation hoops
 from Genshi which makes it work, plus some rewrites of our code
 transformation logic.

 \malthe

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


[Repoze-dev] integrating repoze.bfg with OAuth, OpenID, FacebookConnect etc... for authentication

2010-01-25 Thread Tim Hoffman
Hi Folks

I am looking for some advice.

I need to be able to use multiple authentication sources for a new
repoze.bfg based app.  Do you think I should should use repoze.who
etc...
or try and hook the various auth directly under bfg's existing
authenctication model ?

Thanks

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


Re: [Repoze-dev] integrating repoze.bfg with OAuth, OpenID, FacebookConnect etc... for authentication

2010-01-25 Thread Tim Hoffman
Hi Chris

On the face of it then , I will probably do the work as plugins to
repoze.who as it seems there are a few repoze.who plugins
already in existence for OAuth , openid, facebook connect etc that
I can hopefully leverage off.

Cheers

T

On Mon, Jan 25, 2010 at 6:46 PM, Chris McDonough chr...@plope.com wrote:
 I don't think it makes much of a difference if you need to write it all from
 scratch anyway.  Either would be fine.

 - C

 Tim Hoffman wrote:

 Hi Folks

 I am looking for some advice.

 I need to be able to use multiple authentication sources for a new
 repoze.bfg based app.  Do you think I should should use repoze.who
 etc...
 or try and hook the various auth directly under bfg's existing
 authenctication model ?

 Thanks

 Tim
 ___
 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] integrating repoze.bfg with OAuth, OpenID, FacebookConnect etc... for authentication

2010-01-25 Thread Tim Hoffman
Hi Chris

Control was definately one of the concerns.  But I am only relying on
a potential pool of
authentication providers (google, facebook, myspace ) for basic user auth.

It is also possible that I may need to run on appengine, so I may take
the approach of building
repoze.who plugins along the line of the existing AEoid wsgi
middleware by Nick Johnson
(http://blog.notdot.net/2009/12/OpenID-on-App-Engine-made-easy-with-AEoid)
for openid that mirrors much of the existing google app engine user auth api.

I am still just collecting ideas for approaches at the moment, trying
to see what code
is out there that I can leverage off.

I also have a requirement for an authorization model that is fairly
sophisticated (once I have identified users) with persistent ACL's
and some workflow.

T


On Mon, Jan 25, 2010 at 10:02 PM, Chris McDonough chr...@plope.com wrote:
 That would be a good reason to use r.who in this case, sure.

 Of course, if you don't have enough control when you use r.who, you can
 always take the code internal if you need to by creating a BFG
 authentication policy based on the code from these plugins.

 Tim Hoffman wrote:

 Hi Chris

 On the face of it then , I will probably do the work as plugins to
 repoze.who as it seems there are a few repoze.who plugins
 already in existence for OAuth , openid, facebook connect etc that
 I can hopefully leverage off.

 Cheers

 T

 On Mon, Jan 25, 2010 at 6:46 PM, Chris McDonough chr...@plope.com wrote:

 I don't think it makes much of a difference if you need to write it all
 from
 scratch anyway.  Either would be fine.

 - C

 Tim Hoffman wrote:

 Hi Folks

 I am looking for some advice.

 I need to be able to use multiple authentication sources for a new
 repoze.bfg based app.  Do you think I should should use repoze.who
 etc...
 or try and hook the various auth directly under bfg's existing
 authenctication model ?

 Thanks

 Tim
 ___
 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 mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] integrating repoze.bfg with OAuth, OpenID, FacebookConnect etc... for authentication

2010-01-25 Thread Tim Hoffman
HI Chris

Good points raised and could well be an significant requirement.  I
have not yet used repoze.who and have limited experience with wsgi
middleware (Beaker with appengine based memcached session store is it)
so I have wondered how you can hook up any ui to the middleware.

T

On Mon, Jan 25, 2010 at 10:39 PM, Chris McDonough chr...@plope.com wrote:
 My experience so far with helping people who want lots and lots of control
 about how a login UI works with r.who has not been stellar; this is the only
 reason I mention being able to cutnpaste code into a BFG authentication
 policy.  When you use a custom authentication policy, you can still control
 the horizontal and vertical of login and logout, whereas with r.who, you
 typically have less control.

 - C


 Tim Hoffman wrote:

 Hi Chris

 Control was definately one of the concerns.  But I am only relying on
 a potential pool of
 authentication providers (google, facebook, myspace ) for basic user
 auth.

 It is also possible that I may need to run on appengine, so I may take
 the approach of building
 repoze.who plugins along the line of the existing AEoid wsgi
 middleware by Nick Johnson
 (http://blog.notdot.net/2009/12/OpenID-on-App-Engine-made-easy-with-AEoid)
 for openid that mirrors much of the existing google app engine user auth
 api.

 I am still just collecting ideas for approaches at the moment, trying
 to see what code
 is out there that I can leverage off.

 I also have a requirement for an authorization model that is fairly
 sophisticated (once I have identified users) with persistent ACL's
 and some workflow.

 T


 On Mon, Jan 25, 2010 at 10:02 PM, Chris McDonough chr...@plope.com
 wrote:

 That would be a good reason to use r.who in this case, sure.

 Of course, if you don't have enough control when you use r.who, you can
 always take the code internal if you need to by creating a BFG
 authentication policy based on the code from these plugins.

 Tim Hoffman wrote:

 Hi Chris

 On the face of it then , I will probably do the work as plugins to
 repoze.who as it seems there are a few repoze.who plugins
 already in existence for OAuth , openid, facebook connect etc that
 I can hopefully leverage off.

 Cheers

 T

 On Mon, Jan 25, 2010 at 6:46 PM, Chris McDonough chr...@plope.com
 wrote:

 I don't think it makes much of a difference if you need to write it all
 from
 scratch anyway.  Either would be fine.

 - C

 Tim Hoffman wrote:

 Hi Folks

 I am looking for some advice.

 I need to be able to use multiple authentication sources for a new
 repoze.bfg based app.  Do you think I should should use repoze.who
 etc...
 or try and hook the various auth directly under bfg's existing
 authenctication model ?

 Thanks

 Tim
 ___
 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 mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] chameleon and appengine

2010-01-10 Thread Tim Hoffman
Hi

I am using zpt (tal/metal) on app engine. See
http://code.google.com/p/bfg-pages/

T


On Mon, Jan 11, 2010 at 12:09 AM, Miuler miu...@gmail.com wrote:

 Hi, will work chameleon on google appengine? in future?
 ___
 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] new site based on repoze.bfg

2009-12-01 Thread Tim Hoffman
Hi Folks

I have been working on a site (www.polytechnic.wa.edu.au)  based on
repoze.bfg running on app engine for the last few months.

(I don't do visual design I just make it run). It uses bfg-pages
(http://code.google.com/p/bfg-pages/) for zpt templating and appengine
datamodel traversal so
that it can reflect large amounts of the plone structure. All of the
custom entities used are designed in Enterprise Architect and the
python classes and interface definitions
are generated directly from the UML model.

Beaker is used for session management middleware with a custom plugin
to put sessions into memcache.

Formish is used for the few forms we use in appengine (mainly site
configuration and our own concept of actions and portlets for
appengine)

Content is authored in Plone (running on EC2) which is then pushed
from plone to appengine.
Course data is  extracted from a SQLServer database and pushed into
plone where it is annotated and then published to appengine
All content is indexed on solr (also running on ec2)  for searching
from appengine (appengine doesn't have any text search capability
worth mentioning) .

We had a few teething problems in the last week where our production
instance's performance was being affected by things happening inside
google.
Which turns out be a known problem (for google engineering that is ;-)

In the last 24 hours we moved all of the data to a new instance and
all seems well so far (fingers crossed).

See ya

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


Re: [Repoze-dev] new site based on repoze.bfg

2009-12-01 Thread Tim Hoffman
Hi Martin

On Tue, Dec 1, 2009 at 10:42 PM, Martin Aspeli optilude+li...@gmail.com wrote:
 Tim Hoffman wrote:
 Hi Folks

 I have been working on a site (www.polytechnic.wa.edu.au)  based on
 repoze.bfg running on app engine for the last few months.

 Hey, cool, Python people in WA. :) And for you ignorant Americans,
 that's not Washington, that's Western Australia.

 Nice site, too.



Thanks, I will pass that on to the designers

 (I don't do visual design I just make it run). It uses bfg-pages
 (http://code.google.com/p/bfg-pages/) for zpt templating and appengine
 datamodel traversal so
 that it can reflect large amounts of the plone structure.

 That's quite interesting.

 All of the
 custom entities used are designed in Enterprise Architect and the
 python classes and interface definitions
 are generated directly from the UML model.

 You mean Sparx EA? How do you use it?

Yep, very nice piece of software. I have written some code generators
that take the XMI and then can generate storm classes, gae models and
zope3 interface definitions for various entities.  We used to it to
reverse engineer the SQLServer database and then generate storm
accessor classes for all of the tables.

The re-used the same uml definitions to also generate interfaces and
app engine model classes.  Works quite well.

(I have used argouml a lot too in the past) but I have found
Enterprise Architect a much richer tool and the xmi files a pretty
easy to parse with elementtree.




 Beaker is used for session management middleware with a custom plugin
 to put sessions into memcache.

 Formish is used for the few forms we use in appengine (mainly site
 configuration and our own concept of actions and portlets for
 appengine)

 Content is authored in Plone (running on EC2) which is then pushed
 from plone to appengine.

 What do you use for the push?


Basically I have the remote_api hooked up inside a plone tool and with
adapters that manage the plone - gae mapping.
This was all developed before I realized content mirror might be an option.

 Course data is  extracted from a SQLServer database and pushed into
 plone where it is annotated and then published to appengine
 All content is indexed on solr (also running on ec2)  for searching
 from appengine (appengine doesn't have any text search capability
 worth mentioning) .

 Nifty.

 We had a few teething problems in the last week where our production
 instance's performance was being affected by things happening inside
 google.
 Which turns out be a known problem (for google engineering that is ;-)

 In the last 24 hours we moved all of the data to a new instance and
 all seems well so far (fingers crossed).

 Good job!

 Out of curiosity, why did you choose to go with an EC2 + GAE setup
 instead of just using EC2 or doing some other cheap hosting?

Having done plone sites for years I getting the scalability always
meant I had to manage a cluster of some sort with lots of zeo front
ends etc.
This site has over 7000 unique visitors a day and the organisation
that will ultimately own the app doesn't have the resources currently
to manage that sort of infrastructure.  I had been looking at
deliverance and varnish etc. to speed things up but felt that if
we utilised gae just for presentation on what would still be a
reasonably dynamic site I wouldn't have to manage the infrastructure
to the same degree.  Solr is a lot easier to scale horizontally out of
the box as well and that was the bit missing from app engine, so we
run solr and an author only plone (its still the best for workflow
etc)

Also gae puts a few constraints around what you can do which means you
have to tackle performance fairly early on, but seeing that we are
seperating the authoring from the presentation seems the focus on
performance is fine.


 Martin

 --
 Author of `Professional Plone Development`, a book for developers who
 want to work with Plone. See http://martinaspeli.net/plone-book

 ___
 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] new site based on repoze.bfg

2009-12-01 Thread Tim Hoffman
I didn't know you where in Aus, where abouts ?

T

On Wed, Dec 2, 2009 at 12:07 AM, Martin Aspeli optilude+li...@gmail.com wrote:
 Malthe Borch wrote:
 2009/12/1 Martin Aspeli optilude+li...@gmail.com:
 Lest I offended anybody, I would like to insert an additional smiley at
 the end of that last sentence, like so:

  ;-)

 I think there was no offense, but it is only fair to mention that the
 British are very much at war right now, displaying a great ignorance
 on a daily basis.

 Hey, I live in Australia where no-one takes anything too seriously,
 least of all themselves. :)

 Martin

 --
 Author of `Professional Plone Development`, a book for developers who
 want to work with Plone. See http://martinaspeli.net/plone-book

 ___
 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] new site based on repoze.bfg

2009-12-01 Thread Tim Hoffman
Bloody hell.

How long have you been in Perth?

KT Studio was in West Perth (Dumas House) when I started with them in 2001,
then we moved to East Perth, the more recently to Bentley (Tech Park,
but part of Swan Tafe - since rebranded to Polytechnic West)

We should organise drinks at KT some time, have a local meet up .
There are a few of us who have been doing plone/zope locally since
early Portal Toolkit days ;-)


T

On Wed, Dec 2, 2009 at 12:39 AM, Martin Aspeli optilude+li...@gmail.com wrote:
 Tim Hoffman wrote:
 I didn't know you where in Aus, where abouts ?

 West Perth.

 Martin

 --
 Author of `Professional Plone Development`, a book for developers who
 want to work with Plone. See http://martinaspeli.net/plone-book

 ___
 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] new site based on repoze.bfg

2009-12-01 Thread Tim Hoffman

 Basically I have the remote_api hooked up inside a plone tool and with
 adapters that manage the plone - gae mapping.
 This was all developed before I realized content mirror might be an option.

 ;)

 Some kind of generic tool or framework for Plone - GAE integration
 would be really cool, especially if the GAE side was BFG based. There's
 a lot of interest in that area. I would *love* for Plone to be able to
 advertise that story as part of its deployment options.


At the moment the plone and gae classes are both loaded inside plone
and the registered adapters
manage the translation of the properties of the various entities.

We have most plone content types mapped via a coupe of adapters.

Being able to instantiate app engine entities and use them directly
inside plone over the remote_api
made the task fairly straight forward.


 Having done plone sites for years I getting the scalability always
 meant I had to manage a cluster of some sort with lots of zeo front
 ends etc.
 This site has over 7000 unique visitors a day and the organisation
 that will ultimately own the app doesn't have the resources currently
 to manage that sort of infrastructure.  I had been looking at
 deliverance and varnish etc. to speed things up but felt that if
 we utilised gae just for presentation on what would still be a
 reasonably dynamic site I wouldn't have to manage the infrastructure
 to the same degree.  Solr is a lot easier to scale horizontally out of
 the box as well and that was the bit missing from app engine, so we
 run solr and an author only plone (its still the best for workflow
 etc)

 Sure. But you could've just run the BFG app on EC2 as well, no? What was
 the specific gain for GAE?


Yep but then I would still have to manage more stuff, and manage
scaling it. So we are still talking
elastic load balancing, running memcache for shared cache/sessions
etc.. a datastore that is replicated etc
It all starts getting complicated and I always end up having to do it.
 Having done a few projects now with appengine
being able to just forget about the platform (fingers crossed) means I
am able to shrink the number of managed pieces.

Given typhoonae seems to be coming along it could be an option for the
same code base if we wanted to rehost the site on other kit.

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


Re: [Repoze-dev] new site based on repoze.bfg

2009-12-01 Thread Tim Hoffman
On Wed, Dec 2, 2009 at 12:47 AM, Martin Aspeli optilude+li...@gmail.com wrote:
 Tim Hoffman wrote:
 Bloody hell.

 How long have you been in Perth?

 Since February. :)

Cool, what made you come here?

 KT Studio was in West Perth (Dumas House) when I started with them in 2001,
 then we moved to East Perth, the more recently to Bentley (Tech Park,
 but part of Swan Tafe - since rebranded to Polytechnic West)

 That sounds far away.

Nah, I live in the Swan Valley thats far away.



 We should organise drinks at KT some time, have a local meet up .
 There are a few of us who have been doing plone/zope locally since
 early Portal Toolkit days ;-)

 Yeah, definitely. I know a few other Zope/Plone/Python people around
 here too. Drop me a mail (optilude at gmail dot com). :)


Cool I will get Paul Houghton (KT Studio) to spring for it.

I am off too bed.

T


 Martin

 --
 Author of `Professional Plone Development`, a book for developers who
 want to work with Plone. See http://martinaspeli.net/plone-book

 ___
 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] would like to registerViews in python but not via decorator

2009-11-25 Thread Tim Hoffman
Hi Chris

Yeah I figured I as getting the wrong registry, and in fact I was if I
try and register stuff too early it all went in to the wrong bucket.

I am still having some problems looking stuff up.  I can manually look
stuff up with 
zope.component.queryMultiAdapter((context,request),IView,name=myview)
but the primary views that the router is doing a lookup using lookup()
still fail to be found,  the few zcml based views left around like
NotFound
are being found (and that template calls a couple of
zope.component.queryMultiAdapter((context,request),IView,name=myview)
in it to get
various fragments so I now everything is in the same registry.

It seems the lookup code in router hits the cache and then doesn't
seem to successfully find the views I have registered explicitly

I will keep digging.  Its becoming pretty important that I reduce
start up costs as much as possible

T


On Thu, Nov 26, 2009 at 4:43 AM, Chris McDonough chr...@plope.com wrote:
 Tim Hoffman wrote:

 Hi Chris

 I am trying to register some views directly through python and not
 using the view decorator,
 I have tried using code very similiar to repoze.bfg.testing.

 However after doing so, whilst I can look the view up by doing
 a zope.component.queryMultiAdapter((context,request),IView,name=myview)
 and alternately getting the site manager first.

 However the router never seems to be able to find the views I have
 registered in this fashion.

 Sorry for not responding sooner Tim.

 I'm not sure how this is; it may be that your registrations are getting in
 to the wrong registry.  Try using
 repoze.bfg.threadlocal.get_current_registry() instead of
 zope.component.getSiteManager() to retrieve the registry before you add
 stuff to it maybe?

 Note that the trunk has facilities out of the box for this (although it's
 still under heavy development):

 http://docs.repoze.org/bfg/trunk/narr/configuration.html#hello-world-configured-imperatively


 - C


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


[Repoze-dev] would like to registerViews in python but not via decorator

2009-11-23 Thread Tim Hoffman
Hi Chris

I am trying to register some views directly through python and not
using the view decorator,
I have tried using code very similiar to repoze.bfg.testing.

However after doing so, whilst I can look the view up by doing
a zope.component.queryMultiAdapter((context,request),IView,name=myview)
and alternately getting the site manager first.

However the router never seems to be able to find the views I have
registered in this fashion.

If I have a look in the registry (pdb'ing repoze.bfg.router) I can see
the registrations in _adapter_registrations
however loopkup() never seems to find them.

Is there some additional strange incantation that I am missing , or
got any alternate suggestions for approachs.

I am trying to defer my startup costs under app engine, and a whole
lot of zcml is not required to be processed depending on the type of
user.
That seems to hard to defer, so moving to explicit python
registrations seems to be the better approach, and works for anything
directly looked up via getMutliAdapter.

Thanks

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


[Repoze-dev] Any ideas on how one might do routes after traversal

2009-09-17 Thread Tim Hoffman
Hi Folks

I have always used traversal rather than routes(url dispatch) , but I
just happen to have a requirement to potentially
use such a schema however to complicate things I need to use a hybrid
model, but I really need to use routes after traversal
rather than before as described in
http://docs.repoze.org/bfg/narr/hybrid.html#hybrid-chapter

Does anyone think it would be possible ?

For instance

/a/b/collection/xxx/

Where collection is where traversal would stop and ideally collection
would then be the root factory for xxx/yyy

I know I could use the xxx/yyy as a subpath argument to the default
view on collection but in my case the combination of
xxx/yyy would actually define the view I would like to use.

Any one have an ideas or am I barking up the wrong tree and need to
get the view for collection actually look up a view for xxx/yyy
and return that instead.

Thanks

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


Re: [Repoze-dev] Any ideas on how one might do routes after traversal

2009-09-17 Thread Tim Hoffman
HI Chris

Yeah , I thought that might be the answer.

Thanks anyway

T

On Fri, Sep 18, 2009 at 12:54 AM, Chris McDonough chr...@plope.com wrote:
 Tim Hoffman wrote:

 Hi Folks

 I have always used traversal rather than routes(url dispatch) , but I
 just happen to have a requirement to potentially
 use such a schema however to complicate things I need to use a hybrid
 model, but I really need to use routes after traversal
 rather than before as described in
 http://docs.repoze.org/bfg/narr/hybrid.html#hybrid-chapter

 Does anyone think it would be possible ?

 For instance

 /a/b/collection/xxx/

 Where collection is where traversal would stop and ideally collection
 would then be the root factory for xxx/yyy

 I know I could use the xxx/yyy as a subpath argument to the default
 view on collection but in my case the combination of
 xxx/yyy would actually define the view I would like to use.

 Any one have an ideas or am I barking up the wrong tree and need to
 get the view for collection actually look up a view for xxx/yyy
 and return that instead.

 I'd just use the subpath personally.  There's an API named
 render_view_to_response in the view module that you can pass some
 serialization of the subpath to in the default view for the collection.

 - C


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


Re: [Repoze-dev] page directive sci-fi

2009-09-13 Thread Tim Hoffman
Hi Chris

You are correct, I just didn't want to see the view directive just
disappear and be left with a page implementation ;-).

T

On Mon, Sep 14, 2009 at 10:34 AM, Chris Rossi ch...@archimedeanco.com wrote:
 I may be missing something that makes this impossible, but my point was that
 you could probably add it to the existing implementation without changing
 how any existing applications work.  The existing functionality is all there
 as a subset of the new stuff.  But I haven't stared at it for too long so I
 may be missing obvious backwards incompatibility.

 Chris


 On Sun, Sep 13, 2009 at 10:29 PM, Tim Hoffman t...@zute.net wrote:

 Hi

 I am not too sure about making this the default 'view' implementation
 or at least we need to retain the existing the simpler view directive.

 I many cases I am/need to identify the template used much later in the
 process, so for me baking the template
 name in the view directive is certainly not what I want

 T


 On Mon, Sep 14, 2009 at 1:59 AM, Chris Rossi ch...@archimedeanco.com
 wrote:
  This looks reasonable.  I think it would also be reasonable to just make
  this the standard 'view' functionality, since afaict the current
  functionality is a subset of this.
 
  Chris
 
 
  On Sun, Sep 13, 2009 at 12:57 PM, Chris McDonough chr...@plope.com
  wrote:
 
  Here's some sci fi I wrote up about a page ZCML directive.  As Tim
  Hoffman
  suggested, maybe the fact that the page is passed into the template
  would
  give us enough pull capability to avoid any of the other hacks I
  proposed to
  push global names into every rendered template.
 
  Note that the view directive could probably eventually be changed to
  do
  everything that the page directive I describe below does.
 
  Comments appreciated.
 
  repoze.bfg.page README
  ==
 
  ``repoze.bfg.page`` is a package which adds a ``page`` ZCML directive
  to the set of directives that may be used under BFG.  You might use a
  ``page`` directive in places where you would otherwise use the
  built-in repoze.bfg ``view`` directive.  Defining a ``page`` directive
  effectively creates a single BFG view under the hood, and owns
  attributes similar to those of a view directive.  However, the
  ``page`` directive differs from the BFG ``view`` directive in a number
  of important ways:
 
  - The ``page`` directive allows you to associate a *template* with the
    page being defined.  The machinery behind the ``page`` directive is
    capable of rendering an associated template, unlike a view, which
    must find and render a template itself.
 
  - A ``page`` directive, like a BFG ``view`` directive, points at a
    callable which accepts two arguments: ``context`` and ``request``.
    This callable must return a Response object *or* a Python
    dictionary.  This is unlike a BFG ``view`` callable, which always
    returns a Response object (and must never return a dictionary).
 
    The ``callable`` which a ``page`` directive points at may optionally
    be a class.  If the page directive's ``callable`` attribute points
    at a class, that class must have an ``__init__`` method that accepts
    two arguments: ``context`` and ``request``.  That class must further
    define a ``__call__`` method which accepts no arguments and which
    returns a dictionary or a Response object.
 
    If the page callable returns a Python dictionary, the ``template``
    named within the directive will be passed the dictionary as its
    keyword arguments, and the ``page`` implementation will return the
    resulting rendered template in a response to the user.  The callable
    object (whatever object was used to define the page ``callable``)
    will be automatically inserted into the set of keyword arguments
    passed to the template as ``page``.  If the callable object was a
    class, an instance of that class will be inserted into the keyword
    arguments as ``page``.
 
    If the ``callable`` associated with a ``page`` directive returns a
    Response object (an object with the attributes ``status``,
    ``headerlist`` and ``app_iter``), any template associated with the
    ``page`` declaration is ignored, and the response is passed back to
    BFG.  For example, if your page callable returns an ``HTTPFound``
    response, no template rendering will be performed::
 
      from webob.exc import HTTPFound
      return HTTPFound(location='http://example.com') # templating
  avoided
 
  Here's an example of a page directive which acts as a default view::
 
    page
     template=templates/my_template.pt
     callable=.pages.my_page
     /
 
  The ``template`` attribute is optional.  If one is not named, and the
  callable returns a dictionary, an error will be thrown at rendering
  time.
 
  Special ZCML Attributes
  ---
 
  The directive accepts attributes other than ``template`` and
  ``callable``.
 
  attr
 
    ``repoze.bfg.page`` defaults to using the ``__call__`` method

Re: [Repoze-dev] owrap layout through zcml

2009-09-12 Thread Tim Hoffman
HI Chris

I a way you describing something simliar to what we have in zope2, in
that from a tal expression we have access to
(via acquisition) all of the portal tools etc...

I wonder if a couple of hi level functions could be put into the
namespace, (or the view for instance) that allow you
to lookup adapters and utilities in a simpler way, or alternately use
a view class and push the view handle into the template
and hang all of the extra api you need there. I have taken to useing
view classes most of the time and
always providing view as well as context and request.

T


On Sun, Sep 13, 2009 at 5:43 AM, Chris McDonough chr...@plope.com wrote:
 So I've been trying to puzzle out some issues, which might or might not
 be related to this topic.

 In KARL, we currently write all of our views something in the form of:

 def myview(context, request):
    [ do stuff ]
    api = TemplateAPI(context, request) # a utility class
    return render_template_to_response('atemplate.pt', api=api,
                                       foo=1, bar=2)

 In the template, we do things like tal:replace=href api.context_url
 and so on.  Basically, the KARL api object is a garbage barge of
 utility attributes and functions totally specific to the application
 itself.  There is nothing general about it.

 What I'd like to do is to be able to write a KARL view like this:

 def myview(context, request):
    [ do stuff ]
    return render_template_to_response('atemplate.pt', foo=1, bar=2)

 ... but still have some way of accessing the KARL api in the template.
  In essence, I'd like to put the BFG templating system in charge of
 adding one or more globals that is accessible within the template.

 There's a half step towards this that's simple.  It'd be relatively easy
 to put both context and request into the names passed to all
 templates.  But this doesn't help us very much in the common case,
 because then we'd need to write a lot of hairy expressions to compute
 things based on those values.  Basically the template would assume the
 job of our current API, which is not ideal.

 It'd be better if we could add some configuration that would one or more
 globals to a template's namespace.  For example, one configuration might
 look like (via ZCML):

  templatename name=api component=.api.TemplateAPI/

 The .api.TemplateAPI class would accept, say, a context and a request
 (or just a request, as requests already have a context attribute), ala:

 class TemplateAPI(object):
     def __init__(self, context, request):
         self.context = context
         self.request = request
         self.context_url = model_url(context)

 At this point the name api would just be jammed into the template
 names on each template rendering and it could have both attributes and
 methods accessible via api.whatever.

 At some point I had considered using a Chameleon expression prefix to
 separate these sorts of builtin names from the main template namespace
 names.  For example, instead of tal:replace=href api.context_url,
 you'd access builtins via an expression type, e.g. tal:replace=href
 api:context_url.  That bugged Malthe because it's essentially a second
 python: expression type that happens to not use the main template
 namespace.  I'm not sure about it either, because it's obvious that
 you'll want to use the names passed to the template explicitly in those
 expressions too, and the semantics and implementation could get pretty
 confusing if you need to make that possible.

 Can anyone think of a better way of achieving this goal?  If we don't
 collectively come up with something better, I am apt to just allow folks
 to register factories via ZCML that produce something that is jamed into
 the main template namespace, ala the templatename ZCML directive
 above.  Any number of them will be registerable.  A conflict will occur
 during ZCML processing if two share the same name.  These functions, if
 they exist, will be called on each template rendering and their results
 will be jammed into the top-level namespace.

 Robert Marianski wrote:
 On Mon, Aug 24, 2009 at 10:11:04PM -0400, Chris McDonough wrote:
 I like this.

 Some variations:

 - Have IOWrap be a multiadapter on context and request, so we can vary the
 o-wrap based on request type too (e.g. IManagementRequest vs. 
 IRetailRequest).

 Good idea. I'll go ahead and add this in.

 - If IOWrap can't be adapted, just return the result of the view (instead of
 throwing a component lookup error).

 I'm kind of torn on this. On the one hand, I like that a specific
 exception would get thrown, so it's easy to know when there's a
 configuration problem and how to fix it. On the other, getting no wrap
 is obvious itself, and may be better for users to initially see an
 unwrapped page rather than seeing their applications explode.

 I'd expect that there would typically be a catch-all owrap defined
 anyway, so it's unlikely that this will be much of an issue in practice.
 But in retrospect 

Re: [Repoze-dev] Fwd: repoze.bfg.xmlrpc - httpserver hangs

2009-09-10 Thread Tim Hoffman
I actually use xmlrpc a lot and have run into this in the past a few times.
there have been a few incarnations of medusa in the past that has also
exhibited
similiar symptoms, I think it has something to do with how the server and client
decide if there is anything left to transfer over the socket and the client sits
waiting for something never coming and blocking a thread on the server.

Unfortunately when I have encountered this in the past (like now) I am always
buried under the current project workload and just can't spend the time
trying to pin down the specifics.

T

On Fri, Sep 11, 2009 at 4:10 AM, Chris McDonough chr...@plope.com wrote:
 simahawk wrote:

 Hi,
 indeed I tried to use twisted and finally it worked!

 I simply installed PasteScript and Twisted and changed a line in the
 server section of the myproj.ini:

 [server:main]
 use = egg:PasteScript#twisted

 That's a bit of a shame... the paste HTTP server is usually the best behaved
 of the bunch.

 - C





 On Thu, 2009-09-10 at 12:51 -0400, Chris McDonough wrote:

 The output of the threads debug middleware you put up at
 http://pastebin.org/16704 looks more or less normal to me.  You might try a
 different WSGI HTTP server to see if that has any effect.

 - C

 simahawk wrote:

 Thank you Tim!
 It seems the only thing I can do is try to use twisted. Am I wrong?

 BTW I tried repoze.debug and this is the result:
 http://pastebin.org/16704

 10 threads waiting for something...


 On Thu, 2009-09-10 at 09:02 +0800, Tim Hoffman wrote:

 I found that if you run zope3 server under paste you get the same
 thing, whereas if you use twisted
 it works fine.  See this thread I posted last year.

 https://mail.zope.org/pipermail/zope3-users/2008-October/008261.html

 T

 On Wed, Sep 9, 2009 at 11:32 PM, simahawksimah...@gmail.com wrote:

 hi list,

 I created a web-service with repoze.bfg and repoze.bfg.xmlrpc with a
 xmlrpx_view. This views creates a PDF and it should return me a simple
 string with the url of the PDF but in order to get my string back I
 need
 to restart repoze 'cause the application hangs at some point after the
 view returns the string.

 I went trough the code with pdb and I found that the application hangs
 on the method worker_thread_callback in
 Paste-1.7.2-py2.6.egg/paste/httpserver.py

 I tried to make the view returning the string directly and it works...
 so it seems it doesn't like processing stuff in the meanwhile... :)

 In other word, this works:

 [...]
 @xmlrpc_view
 def generate_report(context, data):
   url = 'http://foo.com/static/file.pdf'
   return url
 [...]

 whilst this don't:

 [...]
 @xmlrpc_view
 def generate_report(context, data):
   do_this
   [...]
   do_that
   url = 'http://foo.com/static/file.pdf'
   return url
 [...]

 It's a bit weird... any suggestion will be much appreciated.

 Thanks,
 SimO

 ___
 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 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] Fwd: repoze.bfg.xmlrpc - httpserver hangs

2009-09-09 Thread Tim Hoffman
I found that if you run zope3 server under paste you get the same
thing, whereas if you use twisted
it works fine.  See this thread I posted last year.

https://mail.zope.org/pipermail/zope3-users/2008-October/008261.html

T

On Wed, Sep 9, 2009 at 11:32 PM, simahawksimah...@gmail.com wrote:
 hi list,

 I created a web-service with repoze.bfg and repoze.bfg.xmlrpc with a
 xmlrpx_view. This views creates a PDF and it should return me a simple
 string with the url of the PDF but in order to get my string back I need
 to restart repoze 'cause the application hangs at some point after the
 view returns the string.

 I went trough the code with pdb and I found that the application hangs
 on the method worker_thread_callback in
 Paste-1.7.2-py2.6.egg/paste/httpserver.py

 I tried to make the view returning the string directly and it works...
 so it seems it doesn't like processing stuff in the meanwhile... :)

 In other word, this works:

 [...]
 @xmlrpc_view
 def generate_report(context, data):
    url = 'http://foo.com/static/file.pdf'
    return url
 [...]

 whilst this don't:

 [...]
 @xmlrpc_view
 def generate_report(context, data):
    do_this
    [...]
    do_that
    url = 'http://foo.com/static/file.pdf'
    return url
 [...]

 It's a bit weird... any suggestion will be much appreciated.

 Thanks,
 SimO

 ___
 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] ? about owrap

2009-08-25 Thread Tim Hoffman
Hi Robert

I am coming pretty late to your discussion about owrap, from what I have
gleaned it does look interesting and potentially very
useful for a project I am working on.

From looking at the code and the dummyapp it looks like its almost inverting
the relationship between a views template and the owrap views template
vs the traditional templating model in plone for instance where your view
invokes main template and you fill slots.  Does that make sense ?

How do you see it really being used compared with what I am used to from
plone land and what I am doing in bfg-pages.

I specifically I am looking to address sidebar/portlet type functionality
with repoze.bfg on top of app engine as well as a general strategy of
composing
complex pages from many components based not only on content type but other
properties of the content itself, and broader contexts.

I am using full zpt/metal so I am pretty comfortable approaching this using
macros, but conceptually I see some advantages if my interpretation of
owrap is correct.

Any thoughts. I will be in position to do some experiments in a couple of
days if that would also help you in exploring where you take owrap
functionality

regards

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


[Repoze-dev] Simple repoze.bfg based CMS for GAE

2009-07-23 Thread Tim Hoffman
Hi Folks

Finally got my some code into shape.  The simple cms based on repoze.bfg
running on gae that I have been blathering about for a while is up
and running at  www.fishandlily.com.au.  A sample site is at
repoze-bfg-gae.appspot.com and from there you can look at the code
if you want to.

It is very rough, virtually no docs, and I haven't got a paster script
together yet to make installs doable for mortals ;-) so some instructions
are there.

Its probably only useful as an example of a non django based app engine code
that is content oriented.

See ya

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


[Repoze-dev] How to specify xmlrpc view bindings in zcml ?

2009-07-06 Thread Tim Hoffman
Hi

I seem to remember seeing on this list (or somewhere else on the net
;-) an example of using zcml
to specify an xmlrpc  view  ( - probably not explaining it well here )
but the for the life of me
I can't find such a thing anywhere , I know I am not dreaming, I hope!

Can anyone point me in the right direction?

Cheers

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


Re: [Repoze-dev] How to specify xmlrpc view bindings in zcml ?

2009-07-06 Thread Tim Hoffman
Hi Chris

Thats awesome I think the docs story is getting really good for repoze
and I personally think repoze.bfg is a good solution on app engine.

For those interested here is the site (svfalf.appspot.com) that I have
been working on for the last few weeks. There is still new content
going in and there a still a tweaks to be done, it will be a week or
so before it replaces the original site (www.fishandlily.com.au).

But it is a repoze.bfg site running on google app engine.  I am using
zpt (metal macros), form generation is using io.formish (though you
won't get to see that stuff on the site) . Its basically a very simple
CMS that I  have put together (which I will clean up once we go live
for people to pull apart ;-).

The site isn't going to set the world on fire but it is dynamic (we
have a lot of water lily info that changes during the course of the
year which we don't want to have to edit all the time)
its for our small business (that is very non IT based).

See ya

Tim



On Tue, Jul 7, 2009 at 11:04 AM, Chris McDonoughchr...@plope.com wrote:
 On 7/6/09 10:46 PM, Chris McDonough wrote:

 We can always do a better job at documentation discoverability and
 indexing and
 searching and such, and we will over time.  Currently the only docs that
 are
 indexed on bfg.repoze.org are the actual BFG docs themselves, apologies.

 That said, if I type in repoze.bfg xmlrpc to Google, the first link I
 get is
 the one that Reed pointed at.  If we just improved those docs to include
 install
 instructions, I think we'd be golden.

 So I've done just that (see http://docs.repoze.org/xmlrpc/) and made a new
 0.3 release with the updated docs.

 - C


 On 7/6/09 10:42 PM, Tim Hoffman wrote:

 Hi all

 Thanks guys, I thought I was going mad,

 All your responses made it look easy to find this info which worried
 me as I am big on rtfm
 so I went back to the site to try and find the xmlrpc doc and again
 couldn't find it.

 Here is what I did ( I tend to just enter repoze.bfg into google and
 click on links - I am lazy)

 so as a result of a google search

 I went to the http://bfg.repoze.org site (which is the 3rd link) and
 entered xmlrpc into search

 I only got one result about pastebin and xmlrpc which did suggest I
 was on the right track but didn't have the info or links to the info I
 needed.

 So then I went to the http://static.repoze.org/bfgdocs/ which is the
 first url listed in google
 for repoze.bfg

 I tried a search there and got nothing.

 The general link to docs on both main sites  of api's but xmlrpc and
 other stuff is also not listed there.

 Now it seems even if I get to docs.repoze.org from either of the two
 urls I used I won't be able to search successfuly for xmlrpc as it
 seems that search is limited to  a subsection, and unless I just enter
 the bare docs.repoze.org (which I didn't think of silly me ;-(  I
 won't find this stuff.

 I wonder if search scope could be increased to include all of the
 stuff under docs.repoze.org
 or possibly a link on the bfg.repoze.org home page or docs section
 that does link to root level docs.repoze.org saying other modules are
 available here

 I think this would help a lot trying to find stuff about the broader
 repoze.bfg ecosystem

 Thanks again for all your help

 Rgds

 Tim




 On Tue, Jul 7, 2009 at 10:00 AM, Chris McDonoughchr...@plope.com
 wrote:

 One thing that those docs don't really make clear is that this
 functionality
 comes from an add-on package:

 easy_install -i http://dist.repoze.org/bfgsite/simple repoze.bfg.xmlrpc

 - C


 On 7/6/09 9:37 PM, Reed O'Brien wrote:

 On Jul 6, 2009, at 9:23 PM, Tim Hoffman wrote:

 Hi

 I seem to remember seeing on this list (or somewhere else on the net
 ;-) an example of using zcml
 to specify an xmlrpc  view  ( - probably not explaining it well here )
 but the for the life of me
 I can't find such a thing anywhere , I know I am not dreaming, I hope!

 Can anyone point me in the right direction?

 Start here:

 http://docs.repoze.org/xmlrpc/
 ___
 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 mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] bfg form generation

2009-06-29 Thread Tim Hoffman
Hi Iain

I am using formish with some success at the moment.
You need the latest copy from github, rather than whats in PyPI and if you
want to
use the FileUpload widget you may need to build a custom FileResource
handler (I am running on GAE so write temp files to the filesystem is not an
option )

Its pretty simple and lightweight does both the form generation from schemas
defined
using schemaish and validation. (I looked at ToscaWidgets and found it was
going to harder to shoehorn into GAE and it didn't have my requirements to
be able to specify readonly widgets)

Rgds

Tim

On Sun, Jun 28, 2009 at 3:47 AM, Iain Duncan iaindun...@telus.net wrote:

 what are folks using to make forms and validation schemas with bfg? I am
 a big fan of formencode, but not sure how best to use it in the bfg
 context. I'm curious whether one can use zope form generation easily
 with formencode?

 thanks
 iain

 ___
 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] unifying url dispatch and traversal

2009-06-05 Thread Tim Hoffman
Hi

On Fri, Jun 5, 2009 at 11:33 PM, Chris McDonoughchr...@plope.com wrote:
 Paul and Tres recently taught a repoze.bfg tutorial at the Plone
 Symposium at Penn State.  Tres mentioned to me that, by the reactions
 of the tutorial attendees, he thought having two separate-but-equal
 ways to do URL-to-code mapping (traversal vs. url dispatch/aka routes)
 was too confusing.  He then suggested an alternative.


I wasn't there, so not party to the discussion but in my opinion I
just don't see this as confusing,
if anything I think having to distinct methods is good.  Those who
think in routes mode just worry about it and those that like traversal
use that mode.  The combined mode is something experts who want both
can do.

My concern is you will be mixing to different modes of working and
therefore we end up with wierd corner cases that less experienced
users will then have trouble diagnosing. (ie understanding precedence
of traversal and routes matches when names are similiar)

This seems like a slippery road to strange magical behaviour ;-)

But hey like I said I wasn't there so don't know the background to the confusion

Rgds

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


Re: [Repoze-dev] Changes to Chameleon compilation system

2009-05-09 Thread Tim Hoffman
HI Chris

Sunday morning, forgot to reply-all

sorry

Will forward the other emails now

T

On Sun, May 10, 2009 at 9:29 AM, Chris McDonough chr...@plope.com wrote:
 On 5/9/09 9:10 PM, Tim Hoffman wrote:

 The more I think/understand the way chameleon works the less likely I
 think it is going to work.

 As I sent out the app engine sdk know includes a modified _ast module
 so maybe it will work
 (but haven't tried it myself the inclusion was to get genshi working
 in the main), but I think the only possibility will be compiling
 templates into an in memory cache but unless you have a busy sight the
 compile cost might be pretty high, as an app engine will spin down in
 less than 30 sec's of non use.  And startup time/spin up time on a new
 request will possibly be very expensive unless the template is only
 compiled as used and then cached and reused again pretty soon.

 I think Malthe's idea is to generate .py files that will can be used during
 a deployment (to GAE or anything else really).  On GAE, using these .py
 files should be no slower than importing and using any other .py file in
 your application.  In general, the biggest expense of Chameleon is emitting
 Python source, the rest is quite fast.

 Is there any reason this isn't cc'ed to the list?

 - C

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


[Repoze-dev] Fwd: Changes to Chameleon compilation system

2009-05-09 Thread Tim Hoffman
The more I think/understand the way chameleon works the less likely I
think it is going to work.

As I sent out the app engine sdk know includes a modified _ast module
so maybe it will work
(but haven't tried it myself the inclusion was to get genshi working
in the main), but I think the only possibility will be compiling
templates into an in memory cache but unless you have a busy sight the
compile cost might be pretty high, as an app engine will spin down in
less than 30 sec's of non use.  And startup time/spin up time on a new
request will possibly be very expensive unless the template is only
compiled as used and then cached and reused again pretty soon.

T

On Sun, May 10, 2009 at 9:03 AM, Tim Hoffman t...@zute.net wrote:
 Or at least it doesn't create .pyc in the file system.


 T

 On Sun, May 10, 2009 at 9:00 AM, Tim Hoffman t...@zute.net wrote:
 Hi

 Just so you know

 deploying to google app engine won't send pyc files.  App Engine
 doesn't create pyc files either when running on the service

 T

 On Sat, May 9, 2009 at 9:08 PM, Chris McDonough chr...@plope.com wrote:
 On 5/9/09 8:50 AM, Malthe Borch wrote:
 As a general improvement (in terms of clarity) and as part of the
 efforts of getting Chameleon working on GAE, I've begun reworking the
 compilation stage.

 If not explicitly disabled (using ``CHAMELEON_CACHE=0``), template
 files (ending in .pt) will be compiled with the result written to a
 Python-module with the same filename (ending in .pt.py); Python will
 of course attempt to write a byte-code compilation (ending in
 .pt.pyc), which will guarantee good performance when restarting the
 system.

 Then,

 On template instantiation:

 1) If the ``CHAMELEON_EAGER`` flag is enabled, parse template source
 immediately.
 2) Load the template source module.
 3) If the ``CHAMELEON_STATIC`` flag is enabled, compile into
 one-method-fits-all-arguments render methods for main template and
 each available macro (if required).

 On render:

 4) If the ``CHAMELEON_STATIC`` flag is enabled, collapse
 keyword-arguments into dynamic context (econtext).

 On compilation:

 5) If the render call signature (keyword arguments and macro name)
 matches an already compiled render-method, return it.

 Else:

 6) Compile template (to source string).
 7) Append to template source module.
 8) Reload template source module and return render-method.

 I've lost track of what a lot of this means (particularly wrt 
 CHAMELEON_STATIC)
 but the stuff I do understand sounds pretty good to me.

 At a higher level, let me try to repeat the use case here and tell me if I 
 have
 it right:

 - On template instantiation (at least in eager mode and unless
   CHAMELEON_CACHE=0), a .py file will be written next to the
   template file being instantiated.

 - The Chameleon code that actually performs rendering will
   try to find the .py file via some importy sort of thing.

 - Python will write the .pyc file.

 - When we want to deploy to GAE or other platforms without
   instantiation/compilation support, we'll just check in
   the .py files (or maybe even the .pyc files) and
   push them up.  The instantiation code won't ever need
   to do the compilation step.

 Is that close to right?

 - 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


[Repoze-dev] repoze.bfg on gae with zope.pagetemplate and helper routines

2009-05-04 Thread Tim Hoffman
Hi

I am new to the list (and pretty new to repoze) I have put together a
module which includes bindings for zope.pagetemplate with direct
support for metal macros, plus a bunch of helper utils that make
things a bit easier when using google app engine,
I was thinking of calling it repoze.gae.

A couple of question
1. does the naming make sense from the repoze communities point of view
2. should I split the page template handling into a seperate module
from the utilities,
3. where should I put this stuff for people to get to ?

Rgds

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


Re: [Repoze-dev] repoze.bfg on gae with zope.pagetemplate and helper routines

2009-05-04 Thread Tim Hoffman
HI Chris

Sounds like a plan

I will start a repoze.bfg.gae

My bindings for pagetemplate are pretty much the same, but I have a
higher level
wrapper that is doing some extra stuff for macros etc

So I may leave that zpt wrapper repoze.bfg.gae as I plan to do some
template caching that is suitable for gae etc along with gae
specific instructions for using pagetemplates

One thing to note for people planing to use zope.pagetemplates in gae
is that it does
have a dependancy on i18nmessageid which has some 'c' code , you need
to remove the
_zope_i18nmessageid_message.py as the standard bootstrap code for the c lib
causes gae to barf as it is using some python capabilities that aren't in gae

I will also include a cut down zope.proxy in repoze.bfg.gae so if
people wan't to use
zope.deferredimport (because some other zope3 stuff uses it) than can
copy it up and use that
instead.

Will sign the agreement later today

See ya

Tim


On Tue, May 5, 2009 at 9:09 AM, Chris McDonough chr...@plope.com wrote:
 Hi Tim,

 Carlos de la Guardia created zope.pagetemplate bindings for bfg the other
 day (http://svn.repoze.org/repoze.bfg.zopepagetemplate/trunk/). I might try
 to change that if it doesn't have what you need to get ZPT support, and
 then, if necessary, create another package that has the other helper utils
 you've created.

 In general, naming something repoze.bfg.gae would make sense if the package
 really was only related to GAE, but bindings to zope.pagetemplate are useful
 outside the context of GAE too, so I probably wouldn't put those bindings in
 a package with gae in the name.  Also, since what you're creating is
 probably a BFG-related package, I'd expect a repoze.bfg.gae instead of
 repoze.gae (repoze.bfg is a namespace package, used for packages related
 to BFG; repoze is also a namespace package but contains packages not
 related to BFG).

 I can get you access to the repoze SVN repository if you'd like to become a
 committer:

 http://repoze.org/contributing.html

 On 5/4/09 9:00 PM, Tim Hoffman wrote:

 Hi

 I am new to the list (and pretty new to repoze) I have put together a
 module which includes bindings for zope.pagetemplate with direct
 support for metal macros, plus a bunch of helper utils that make
 things a bit easier when using google app engine,
 I was thinking of calling it repoze.gae.

 A couple of question
 1. does the naming make sense from the repoze communities point of view
 2. should I split the page template handling into a seperate module
 from the utilities,
 3. where should I put this stuff for people to get to ?

 Rgds

 T
 ___
 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