Clean buildout broken with getpaid.discount?

14 views
Skip to first unread message

Rob LaRubbio

unread,
Jul 1, 2010, 2:37:42 PM7/1/10
to getpa...@googlegroups.com
I'm trying to modify getpaid.discount so users who define a discount code can enter two per item instead of one.  To make this change I've tried starting with a clean buildout but am running into some issues.  

The first looks like a stray checkin of expercash.  Removing references to it in 335.cfg gets past the issue (I'll check in the updated cfg file)

The second issue looks like version conflicts.  If I include getpaid.discount, I need to pin zope.container = 3.8.1.  Should I make this change in 335.cfg or someplace else?

The third issue is the one that has me stumped.  If I include getpaid.discount in the sources.cfg:eggs, base.cfg:autocheckout and base.cfg:zcml then I get this error on startup:

Traceback (most recent call last):
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/Zope2/Startup/run.py", line 56, in ?
    run()
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/Zope2/Startup/run.py", line 21, in run
    starter.prepare()
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/Zope2/Startup/__init__.py", line 102, in prepare
    self.startZope()
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/Zope2/Startup/__init__.py", line 278, in startZope
    Zope2.startup()
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/Zope2/__init__.py", line 47, in startup
    _startup()
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/Zope2/App/startup.py", line 102, in startup
    OFS.Application.initialize(application)
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/OFS/Application.py", line 309, in initialize
    initializer.initialize()
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/OFS/Application.py", line 338, in initialize
    self.install_products()
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/OFS/Application.py", line 603, in install_products
    return install_products(app)
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/OFS/Application.py", line 634, in install_products
    folder_permissions, raise_exc=debug_mode)
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/OFS/Application.py", line 786, in install_product
    initmethod(context)
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/Products/Five/__init__.py", line 28, in initialize
    zcml.load_site()
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/Products/Five/zcml.py", line 53, in load_site
    _context = xmlconfig.file(file)
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/zope/configuration/xmlconfig.py", line 581, in file
    context.execute_actions()
  File "/Users/roblarubbio/projects/getpaid.buildout/parts/zope2/lib/python/zope/configuration/config.py", line 612, in execute_actions
    callable(*args, **kw)
  File "/Users/roblarubbio/.buildout/eggs/Products.PlacelessTranslationService-1.5.4-py2.4.egg/Products/PlacelessTranslationService/patches.py", line 44, in handler
    domain.addCatalog(catalog)
zope.configuration.config.ConfigurationExecutionError: exceptions.AttributeError: 'PTSTranslationDomain' object has no attribute 'addCatalog'
  in:
  File "/Users/roblarubbio/projects/getpaid.buildout/src/getpaid.discount/src/getpaid/discount/configure.zcml", line 6.1-6.49
   <i18n:registerTranslations directory="locales"/>

Anyone have any thoughts or suggestions?  Thanks.

-Rob



Lucie Lejard

unread,
Jul 1, 2010, 6:47:57 PM7/1/10
to getpa...@googlegroups.com
are you sure you gave the full traceback? there is nothing more after
"<i18n:registerTranslations directory="locales"/>"?
maybe registerTranslations is something that doesn't exist anymore...

Lucie
--
six feet up, inc. | "Nowhere to go but open source"
Direct Line +1 (317) 861-5948 x605
http://www.sixfeetup.com | Zope/Plone Custom Development + Hosting

> --
> GetPaid for Plone: http://www.plonegetpaid.com (overview info) |
> http://code.google.com/p/getpaid (code and issue tracker)
> You received this message because you are subscribed to the Google Groups
> "getpaid-dev" group.
> To post to this group, send email to getpa...@googlegroups.com
> To unsubscribe from this group, send email to
> getpaid-dev...@googlegroups.com
>
> For more options, visit this group at
> http://groups.google.com/group/getpaid-dev?hl=en?hl=en

Rob LaRubbio

unread,
Jul 2, 2010, 12:06:30 PM7/2/10
to getpa...@googlegroups.com
That's the full stack trace.  I was wondering why the frame above it gives this error:

File "/Users/roblarubbio/.buildout/eggs/Products.PlacelessTranslationService-1.5.4-py2.4.egg/Products/PlacelessTranslationService/patches.py", line 44, in handler
    domain.addCatalog(catalog)
zope.configuration.config.ConfigurationExecutionError: exceptions.AttributeError: 'PTSTranslationDomain' object has no attribute 'addCatalog'

Also I notice that yuejun.tang and danielle.davout have done a bunch of i18n checkins recently, could something have been missed in a checkin?

-Rob

danielle davout

unread,
Jul 2, 2010, 12:21:51 PM7/2/10
to getpa...@googlegroups.com
indeed, it could well be linked
it has already happened
http://dev.plone.org/plone/ticket/8084 :
If a .po file has moved -- for example if a product with .po files has
been eggified -- PTS will fail to load with a misleading error
I will look as soon as I can whether I've done something wrong, it is
far from excluded
Sorry

danielle davout

unread,
Jul 2, 2010, 12:50:10 PM7/2/10
to getpa...@googlegroups.com
My laptop is out of order, so I can't check it right now may be I ve
got a version 2.X (I cant tell from memory)
the handling of the po files are very different
or the problem was not be seen before the application of the patch (since March)

Rob LaRubbio

unread,
Jul 2, 2010, 1:29:45 PM7/2/10
to getpa...@googlegroups.com
I've got some time to look into it, I'm just not sure where to start.  So if you have pointers for how I can debug this, or where to look I'd appreciate it.  Thanks.

-Rob

Rob LaRubbio

unread,
Jul 6, 2010, 2:59:03 PM7/6/10
to getpa...@googlegroups.com
I'm still digging through this, if anyone is familiar with zope/plone i18n I'd love some pointers to how it set itself up.  Currently I'm noticing that I get two different utilities back, one which has the addCatalog method and another that does not.

This is the code in Products.PlacelessTranslationService-1.5.4-py2.4.egg/Products/PlacelessTranslationService/patches.py that is throwing the exception:

def handler(catalogs, name):
    """ special handler handling the merging of two message catalogs """
    gsm = getGlobalSiteManager()
    # Try to get an existing domain and add the given catalogs to it                            
    domain = queryUtility(ITranslationDomain, name)
    if domain is None:
        domain = TranslationDomain(name)
        gsm.registerUtility(domain, ITranslationDomain, name=name)
    for catalog in catalogs:
        domain.addCatalog(catalog)
    # make sure we have a TEST catalog for each domain:                                         
    domain.addCatalog(TestMessageCatalog(name))

When it is run for name='getpaid' domain is an instance of zope.i18n.translationdomain.TranslationDomain however when it is run for name='plone' domain is an instance of Products.PlacelessTranslationService.utility.PTSTranslationDomain which does not have the method addCatalog.  Any thoughts?

-Rob
Reply all
Reply to author
Forward
0 new messages