On Tue, Apr 20, 2010 at 09:55:52AM +0200, Martin Bähr wrote:
> import ConfigParser
> 
> class ZopeFactory(Factory):
> 
>     name = 'factory-zope'
>     version = '1.0'
> 
>     def getRecipeClass(self):
> 
>         packages = ConfigParser.RawConfigParser()
>         packages.optionxform = str
>         packages.readfp(self.openSourceFile('versions.cfg'))
> 
>         class ZopeRecipe(CPackageRecipe):
>             pass
> 
>         return ZopeRecipe

This isn't going to do you much good.  You aren't doing anything to
make "packages" available in the new class you create, so all that
work goes to waste.  :)

Instead, try something like this:

import ConfigParser

class ZopeFactory(Factory):

    name = 'factory-zope'
    version = '1.0'

    def getRecipeClass(self):

        packageInfo = ConfigParser.RawConfigParser()
        packageInfo.optionxform = str
        packageInfo.readfp(self.openSourceFile('versions.cfg'))

        class ZopeRecipe(CPackageRecipe):
            packages = packageInfo

        return ZopeRecipe


> the actual package was created with: cvc newpkg zope --factory=zope
> but cvc complains: 
> 
> error: unable to load recipe file /home/mbaehr/conary/eMBee/zope/zope.recipe:
> Error in recipe file "zope.recipe":
>  Traceback (most recent call last):
>   File "/home/mbaehr/conary/eMBee/zope/zope.recipe", line 7, in ?
>     class Zope(ZopeRecipe):
> NameError: name 'ZopeRecipe' is not defined

I suspect that we have documentation omissions here.  Unfortunately,
I'm not sure what the omission is.

We'll work together on IRC to discover what what it is and then we
can improve the documentation.
_______________________________________________
Foresight-devel mailing list
Foresight-devel@lists.rpath.org
http://lists.rpath.org/mailman/listinfo/foresight-devel

Reply via email to