diff options
| author | Nicholas Piper <nicholas@users.sourceforge.net> | 2007-08-07 22:48:06 +0000 |
|---|---|---|
| committer | Nicholas Piper <nicholas@users.sourceforge.net> | 2007-08-07 22:48:06 +0000 |
| commit | face4a2bacd4de4d8b791068015d78ce05b61064 (patch) | |
| tree | b5514079171346a5314ed80eb95e944b2f8f48c2 /bindings/python/README.in | |
| parent | 9abfb8f16c0c42adeaf157df625ad5e242280e0e (diff) | |
| download | libgpod-face4a2bacd4de4d8b791068015d78ce05b61064.tar.gz libgpod-face4a2bacd4de4d8b791068015d78ce05b61064.tar.xz libgpod-face4a2bacd4de4d8b791068015d78ce05b61064.zip | |
Try to deal with typestamps in a sane way in the Python bindings
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1672 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'bindings/python/README.in')
| -rw-r--r-- | bindings/python/README.in | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/bindings/python/README.in b/bindings/python/README.in index f5c4501..a71c6b2 100644 --- a/bindings/python/README.in +++ b/bindings/python/README.in @@ -41,3 +41,59 @@ The current helper functions are: @WRAPPER_LIST@ Please see the example scripts for ideas on how to use these functions. + + +The time_t mapping has changed recently: + ++------------------------+-------------+-------------+ +|Version | Reading | Writing | +| | | | ++------------------------+-------------+-------------+ +|r1669 < libgpod |C style API: |C style API: | +| |As a unix |As a unix | +| |timestamp |timestamp | +| |integer |integer or a | +| | |Python | +| |OO style API:|datetime | +| |As a Python |instance | +| |datetime | | +| | |OO style API:| +| | |As a unix | +| | |timestamp | +| | |integer or a | +| | |Python | +| | |datetime | +| | |instance | +| | | | ++------------------------+-------------+-------------+ +|r1433 < libgpod < r1669 |As a unix |As a unix | +| |timestamp |timestamp | +| |integer |integer | +| | | | +| | | | ++------------------------+-------------+-------------+ +|r1417 < libgpod < r1433 |Not possible |Not possible | +| |(time_t not |(time_t not | +| |mapped to |mapped to | +| |Python type) |Python type) | +| | | | ++------------------------+-------------+-------------+ +|libgpod < r1417 |As an integer|As an integer| +| |with a |with a | +| |2082844800 |2082844800 | +| |offset |offset | ++------------------------+-------------+-------------+ + +This table means that as a user of the Python bindings, you likely +want to detect libgpod < r1417. One way would be to test for the +presence of some of the renamed constants in 0.5: + + # libgpod>= 0.5.2 doesn't use mac-type timestamps anymore. check + # if we're using a newer version by looking for a renamed constant. + if hasattr(gpod, 'ITDB_SPL_STRING_MAXLEN'): + track.time_released = int(time.mktime(ipod_date) + else: + track.time_release = int(time.mktime(ipod_date) + 2082844800 + +(Since r1633 there exists a gpod.version_info tuple, which will make +such things easier to cope with in the future. |
