[Bugs] #2425 NORM: Implement dotted activity versions to sugar 0.92
Sugar Labs Bugs
bugtracker-noreply at sugarlabs.org
Mon Oct 11 07:55:24 EDT 2010
#2425: Implement dotted activity versions to sugar 0.92
----------------------------+-----------------------------------------------
Reporter: godiard | Owner: tomeu
Type: enhancement | Status: reopened
Priority: Normal | Milestone: 0.92
Component: sugar | Version: Unspecified
Severity: Unspecified | Resolution:
Keywords: r! | Status_field: New
Distribution: Unspecified | Seeta_dev:
----------------------------+-----------------------------------------------
Changes (by erikos):
* keywords: => r!
Comment:
While reviewing I did edit the file and corrected the things I were not
happy with. I have attached a
[http://bugs.sugarlabs.org/attachment/ticket/2425/normalized_version.patch
new file] for the NormalizedVersion. The following things I have changed:
I used the documentation format as described
[http://www.python.org/dev/peps/pep-0257/ PEP-257] (PEP-8 says to use
PEP-257).
I removed 'error_on_huge_major_num' as a class argument because it was not
used.
I do check if the parsed activity version is a string. So we raise our
error and do not trigger the one from the regular expression.
I reorganized the parsing of the string. I hope this helps in terms of
clearer variable naming, method naming and general readability.
I removed 'pad_zeros_length' from '_parse_numdots' because from our calls
it would never happen.
'_parts_to_str' does not have to be a @classmethod, and actually, I moved
that one liner in the '__str__' method as I think it is quite clear.
I made 'parts' public so we can use it in the comparisons. I have seen
that you did use 'get_parts' but I think a public method does suggest that
as a caller you would be interested in that, which I do not think is true
here.
--- General Note ---:
Please use pylint and pep8, in sugar-jhbuild can be done as:
pep8 sugar-jhbuild/source/sugar-toolkit/src/sugar/bundle/bundleversion.py
pylint sugar-jhbuild/source/sugar-
toolkit/src/sugar/bundle/bundleversion.py
pep8 is a Fedora package:
http://koji.fedoraproject.org/koji/packageinfo?packageID=9499
I cleaned up the code for both.
----
I think that is pretty much it. Please let me know if the changes are for
the better if you have comments other ideas etc.
--
Ticket URL: <http://bugs.sugarlabs.org/ticket/2425#comment:5>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system
More information about the Bugs
mailing list