[Dev] Chandler date/time related changes
Andi Vajda
vajda at osafoundation.org
Tue May 24 18:16:30 PDT 2005
These changes, as described in an earlier message, have been checked in.
After your next 'cvs update' you need to first run 'make install' and then
re-create your repository as some core schema types have changed.
Andi..
On Tue, 24 May 2005, Andi Vajda wrote:
>
> In the past two weeks I implemented a bunch of changes related to dates,
> times and calendars in order to make localizing Chandler easier:
>
> - started a new project, called PyICU, which is a set of python extensions
> wrapping IBM's ICU C++ APIs with SWIG. Currently PyICU wraps the ICU base
> classes such as UnicodeString, Locale, TimeZone, the format classes and
> the calendar classes. More wrapping is in the works.
> For more information about PyICU, see its subversion repository at
> http://svn.osafoundation.org/pyicu/trunk
> and its README file.
>
> - added ICU and PyICU to Chandler's build.
>
> - changed the underlying implementation of the repository core schema types
> DateTime and DateTimeDelta to no longer use mxDateTime but the python
> builtin types provided by the datetime module.
> The new set of date and time types in the repository core schema is:
> - DateTime: implemented by a python datetime, this type now supports
> timezones as specified by ICU using the new ICUtzinfo helper class as
> implemented by PyICU. For example:
> now = datetime.now(tz=ICUtzinfo.getInstance('Pacific/Honolulu'))
> (ICU supports 577 such timezone names)
> - Time: implemented by a python time, supports timezones too. This is
> a new type in the repository core schema.
> - Date: implemented by a python date. This is a new type in the
> repository core schema.
> - TimeDelta: implemented by a python timedelta. This type replaces the
> the former DateTimeDelta type.
> Also, I removed RelativeDateTime as it seemed redundant. All uses of it
> could be replaced by a TimeDelta value instead, except for one case where
> I used the ICU Calendar class for assistance. If it turns out that we
> actually need a RelativeDateTime type as was implemented by mxDateTime,
> the python dateutil module has a very reasonable implementation that we
> could add later.
> As a result of all of these changes, we should be able to remove the
> egenix system from our build in the near future.
>
> - changed all Chandler code using the old mx types to use the python
> builtins instead. This involved changing lots of code all over, the diffs
> are attached to this message for your review. Chandler appears to run
> fine, all unit tests pass but I sure could have broken stuff along the
> way, especially in the UI.
>
> - to illustrate the benefits of all this, I also enhanced the Calendar UI
> somewhat to be less hardcoded and use the ICU library for getting month
> and day names and other info such as first-day-of-week. I also added a
> new
> command line flag to starting Chandler, --locale, which accepts a
> standard
> locale name and that sets ICU's default locale to it. The calendar UI is
> displayed in the chosen locale. For example, use:
> ../release/RunChandler --locale pt_BR
> to display the calendar in Brazilian Portuguese. On my Mac, I can even
> run it in Chinese:
> ../release/RunChandler --locale zh_TW
>
> I'd like to check all of this in *before* the scheduled cvs/svn conversion,
> that is tonight, but more testing is still needed.
>
> In the meantime, comments are welcome !
>
> Andi..
More information about the Dev
mailing list