Code review comment for lp:~adiroiban/launchpad/bug-496352-series-status-refactor

Revision history for this message
Adi Roiban (adiroiban) wrote :

= Bug 496352 =
Since DistroSeriesStatus is also used for ProductSeries, it should be renamed and moved to a dedicated file.

This is the note from Salgado
# XXX: salgado, 2008-06-02: We should use a more generic name here as this
# enum is used in ProductSeries.status as well.

== Proposed fix ==

Just rename the class DistroSeriesStatus to SeriesStatus and create a new module Series to host it (in the future it can contain any other common classes (interfaces).

== Implementation details ==

After touching those files, now lint complain about them.
My changes should have not affect any of the reported problems.

Any hint in fixing them is much appreciated.

== Tests ==
A full test should be ran

== Demo and Q/A ==

After these changes nothings has to be changed from the users point of view.

= Lint =

I think there is a problem with pylint setup as it does not pick up lazr modules.

Also I don't know why this interface is not accepted lib/lp/registry/interfaces/distroseries.py

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/archiveuploader/uploadpolicy.py
  lib/lp/code/tests/test_branch.py
  lib/lp/registry/interfaces/distroseries.py
  lib/lp/registry/model/distribution.py
  lib/lp/testing/factory.py
  lib/lp/translations/browser/product.py
  lib/lp/translations/stories/standalone/xx-productseries-translations.txt

== Pylint notices ==

lib/lp/registry/interfaces/distroseries.py
    22: [F0401] Unable to import 'lazr.enum' (No module named enum)
    49: [F0401] Unable to import 'lazr.restful.fields' (No module named restful)
    50: [F0401] Unable to import 'lazr.restful.declarations' (No module named restful)
    115: [E1002, DistroSeriesVersionField._validate] Use super on an old style class
    426: [C0322, IDistroSeriesPublic.getPackageUploads] Operator not preceded by a space
    description=_("Return items that are more recent than this "
    ^
    "timestamp."),
    required=False),
    status=Choice(

    vocabulary=DBEnumeratedType,
    title=_("Package Upload Status"),
    description=_("Return only items that have this status."),
    required=False),
    archive=Reference(

    schema=Interface,
    title=_("Archive"),
    description=_("Return only items for this archive."),
    required=False),
    pocket=Choice(

    vocabulary=DBEnumeratedType,
    title=_("Pocket"),
    description=_("Return only items targeted to this pocket"),
    required=False),
    custom_type=Choice(

    vocabulary=DBEnumeratedType,
    title=_("Custom Type"),
    description=_("Return only items with custom files of this "
    "type."),
    required=False),
    )

    @operation_returns_collection_of(Interface)
    @export_read_operation()
    def getPackageUploads(created_since_date, status, archive, pocket,
    custom_type):

lib/lp/testing/factory.py
    17: [F0401] Unable to import 'email.Encoders' (No module named Encoders)
    18: [F0401] Unable to import 'email.Utils' (No module named Utils)
    19: [F0401] Unable to import 'email.Message' (No module named Message)
    20: [F0401] Unable to import 'email.MIMEText' (No module named MIMEText)
    21: [F0401] Unable to import 'email.MIMEMultipart' (No module named MIMEMultipart)

« Back to merge proposal