Commit Graph

14 Commits

Author SHA1 Message Date
Bruno Bord 028305289e
The ``IsoRegistry.items()`` method has been removed from the API
This is a **BREAKING CHANGE**.
You must use the ``get_calendars()`` to perform the same registry queries
refs #375, closes #491.
2020-04-24 11:48:32 +02:00
Bruno Bord 9b9bbbb02d
Remove object inheritance for mixin and "non-calendar" classes
refs #442
2020-01-10 10:47:11 +01:00
Bruno Bord 88729e45b1
Remove absolute imports and replace them by relative ones
refs #442
2020-01-10 10:47:11 +01:00
Bruno Bord 1624504024
Iso Registry API modification:
the `items()` method is to be renamed into `get_calendars`.
2019-12-06 16:07:41 +01:00
Bruno Bord 07c9acc27f
ISO Registry ``items()`` method to allow an empty or None "search" argument.
* ``items()`` would return the full list of calendars.
* ``items([list of codes...])`` would return a dictionary of calendars whose codes are in the registry. Unkown codes would be skipped. Sub-regions codes would be allowed (e.g.: ``items(['CA-AB', 'AU-NT'])`` would return the Canada Alberta & Australia Northern Territory calendars)
* ``items([list of codes...], include_subregions=True)`` same as above, except that you would get also subregions when they exist.
2019-12-06 16:06:54 +01:00
Bruno Bord 89675ae1ba
Renaming and sorting test methods 2019-12-06 15:55:01 +01:00
Bruno Bord 2b9b147bd8
Consolidate the `items()` method
refs #403
2019-12-06 15:55:01 +01:00
Bruno Bord b78a5b7721
Removed ``_code_elements`` function
it was unnecessary complicated code.
2019-12-06 15:55:01 +01:00
Bruno Bord 5ba9573962
Simplify method ``get_calendar_class`` in ISO registry 2019-12-06 15:55:01 +01:00
Bruno Bord f4f0f96302
Improve registry tests
refs #412

* Dropped unused lines in tests
* Trying to register a class that doesn't inherit from the core calendar class should raise an exception
2019-11-15 10:59:40 +01:00
Bruno Bord 7ef41145bb Change registry mechanism to avoid circular imports
refs #288
2019-06-07 15:38:06 +02:00
Bruno Bord 8472fbb32d Class docstring will give its name
I thought it was a bit sad that you had to give a `name` class property that was just for the sake of having a string to decribe the class. Describing the class means using a `docstring`.
Now the `name` property is deducted from the docstring, and all the Europe classes along with the "core" United States one are aligned with a more Pythonic way: a class should always have a docstring.
2018-08-30 15:53:57 +02:00
Piotr Roksela 56c3b07770 unused imports and line length fixes 2017-09-20 15:40:45 +02:00
Piotr Roksela f3bfc63401 registry tests 2017-09-20 15:40:45 +02:00