[master] updated Size class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here is an update to my proposed Size class, incorporating the
feedback I got from bcl, akozumpl, and clumens.

* The class now inherits Decimal, so it can be used like a
  Decimal object for calculations.

* Because Decimal is immutable, it uses __new__ in place of
  __init__, so I had to move some of the static data and the
  _parseSpec() and _makeSpecs() functions to the module level.

* I wrapped the prefix names and abbreviations in _() so we can
  handle translations, but there are still some open questions
  here.  For example, this makes it easier for us to handle
  outputting the humanReadable() string for the correct locale,
  but what about _parseSpec()?  Do we want to allow entry using
  Arabic abbreviations when set to the Japanese locale?  I'm
  not too worried about this right now.

* Handle both singular and plural forms of the unit specifier.

* Renamed SizePositiveError to SizeNotPositiveError because we
  don't want to allow sizes <= 0.

-- 
David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux