I'm assuming you've checked that all call-sites use kwargs before re-ordering... and my next question was going to be are you sure that all those kwargs are really optional, but your test_provides() ensures that too :)
> """Create and return a `BinaryPackageRelease`.
>
> The binarypackagerelease will be attached to this specific build.
Hi Jelmer! Nice clean branch :)
> === modified file 'lib/lp/ soyuz/interface s/binarypackage build.py' soyuz/interface s/binarypackage build.py 2010-08-10 21:54:41 +0000 soyuz/interface s/binarypackage build.py 2010-08-12 10:37:50 +0000 kageRelease( cific, cific, fields= None):
> --- lib/lp/
> +++ lib/lp/
> @@ -125,10 +125,11 @@
>
> def createBinaryPac
> binarypackagename, version, summary, description, binpackageformat,
> - component, section, priority, shlibdeps, depends, recommends,
> - suggests, conflicts, replaces, provides, pre_depends, enhances,
> - breaks, essential, installedsize, architecturespe
> - debug_package):
> + component, section, priority, installedsize, architecturespe
> + shlibdeps=None, depends=None, recommends=None, suggests=None,
> + conflicts=None, replaces=None, provides=None, pre_depends=None,
> + enhances=None, breaks=None, essential=False, debug_package=None,
> + user_defined_
I'm assuming you've checked that all call-sites use kwargs before re-ordering... and my next question was going to be are you sure that all those kwargs are really optional, but your test_provides() ensures that too :)
> """Create and return a `BinaryPackageR elease` . lease will be attached to this specific build.
>
> The binarypackagere
> soyuz/interface s/binarypackage release. py' soyuz/interface s/binarypackage release. py 2010-07-10 04:52:43 +0000 soyuz/interface s/binarypackage release. py 2010-08-12 10:37:50 +0000
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -56,6 +56,8 @@
> title=_("Debug package"), schema=Interface, required=False,
> description=_("The corresponding package containing debug symbols "
> "for this binary."))
> + user_defined_fields = Attribute(
> + "Sequence of user-defined fields as key-value pairs.")
you could use zope.schema.List instead of attribute:
user_ defined_ fields = List(
title= _("Sequence of user-defined fields as key-value pairs."))
if that's what it is.
> soyuz/interface s/sourcepackage release. py' soyuz/interface s/sourcepackage release. py 2010-07-29 22:55:15 +0000 soyuz/interface s/sourcepackage release. py 2010-08-12 10:37:50 +0000 "MultipleJoin on SourcepackagePu blishing" )
> files = Attribute("Related list of IBinaryPackageFile entries")
>
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -96,8 +96,8 @@
> "was first uploaded in Launchpad")
> publishings = Attribute(
>
> -
> -
> + user_defined_fields = Attribute(
> + "Sequence of user-defined fields as key-value pairs.")
Same here.
> # read-only properties lease') soyuz/model/ binarypackagere lease.py' soyuz/model/ binarypackagere lease.py 2010-07-10 04:46:49 +0000 soyuz/model/ binarypackagere lease.py 2010-08-12 10:37:50 +0000 ('BinaryPackage File', 'binarypackager elease' , orderBy= "libraryfile" ) fields = StringCol( dbName= 'user_defined_ fields' ) fields' in kwargs: '_user_ defined_ fields' ] = simplejson.dumps( 'user_defined_ fields' ]) 'user_defined_ fields' ] __init_ _(self, *args, **kwargs)
> name = Attribute('The sourcepackagename for this release, as text')
> title = Attribute('The title of this sourcepackagere
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -13,6 +13,8 @@
>
> from zope.interface import implements
>
> +import simplejson
> +
> from sqlobject import StringCol, ForeignKey, IntCol, SQLMultipleJoin, BoolCol
> from storm.locals import Date, Int, Reference, Storm
>
> @@ -68,6 +70,22 @@
> files = SQLMultipleJoin
> joinColumn=
>
> + _user_defined_
> +
> + def __init__(self, *args, **kwargs):
> + if 'user_defined_
> + kwargs[
> + kwargs[
> + del kwargs[
> + SQLBase.
Do you prefer explicitly calling the superclass rather than using super? I don't mind if you do, but otherwise I'd go for super (https:/ /dev.launchpad. net/PythonStyle Guide#Chaining% 20method% 20calls)
> === modified file 'lib/lp/ soyuz/model/ sourcepackagere lease.py' soyuz/model/ sourcepackagere lease.py 2010-08-02 02:13:52 +0000 soyuz/model/ sourcepackagere lease.py 2010-08-12 10:37:50 +0000 'to_source' , orderBy= "-date_ requested" ) fields = StringCol( dbName= 'user_defined_ fields' ) fields' in kwargs: '_user_ defined_ fields' ] = simplejson.dumps( 'user_defined_ fields' ]) 'user_defined_ fields' ] __init_ _(self, *args, **kwargs)
> --- lib/lp/
> +++ lib/lp/
> @@ -15,6 +15,7 @@
> import pytz
> from StringIO import StringIO
> import re
> +import simplejson
>
> from sqlobject import StringCol, ForeignKey, SQLMultipleJoin
> from storm.expr import Join
> @@ -147,6 +148,22 @@
> package_diffs = SQLMultipleJoin(
> 'PackageDiff', joinColumn=
>
> + _user_defined_
> +
> + def __init__(self, *args, **kwargs):
> + if 'user_defined_
> + kwargs[
> + kwargs[
> + del kwargs[
> + SQLBase.
And again.
> === added file 'lib/lp/ soyuz/tests/ test_binarypack agerelease. py'
Yay... nice unit tests.
Thanks Jelmer!