Revision: 4598
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4598&view=rev
Author: jswhit
Date: 2007-12-04 12:48:55 -0800 (Tue, 04 Dec 2007)
Log Message:
-----------
check for time zone offset.
Modified Paths:
--------------
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py
Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py
===================================================================
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py
2007-12-04 20:43:54 UTC (rev 4597)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py
2007-12-04 20:48:55 UTC (rev 4598)
@@ -446,7 +446,8 @@
# parse the date string.
n = timestr.find('since')+6
year,month,day,hour,minute,second,utc_offset = _parse_date(timestr[n:])
-
+ if utc_offset:
+ raise ValueError("time zone offset not allowed")
return units, datetime(year, month, day, hour, minute, second)
class utime:
@@ -572,8 +573,9 @@
it is divisible by 400.
- C{'noleap'} or C{'365_day'}:
Gregorian calendar without leap years, i.e., all years are 365 days long.
- all_leap or 366_day Gregorian calendar with every year being a leap year,
- i.e., all years are 366 days long.
+ - C{all_leap} or C{'366_day'}:
+ Gregorian calendar with every year being a leap year, i.e.,
+ all years are 366 days long.
-C{'360_day'}:
All years are 360 days divided into 30 day months.
-C{'julian'}:
@@ -773,19 +775,8 @@
m = p.match(origin.strip())
if m:
c = m.groupdict(0)
-
- # Instantiate timezone object.
+ # UTC offset.
offset = int(c['ho'])*60 + int(c['mo'])
- #tz = FixedOffset(offset, 'Unknown')
-
- #return datetime(int(c['year']),
- # int(c['month']),
- # int(c['day']),
- # int(c['hour']),
- # int(c['min']),
- # int(c['sec']),
- # int(c['dsec']) * 100000,
- # tz)
return
int(c['year']),int(c['month']),int(c['day']),int(c['hour']),int(c['min']),int(c['sec']),offset
raise Exception('Invalid date origin: %s' % origin)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins