| nson |
to ICUtzinfo.default if tz is None, otherwise
+ timezone is set to tz.
+ """
+ if tz is None:
+ tz = TimeZone.default
+ return datetime.fromtimestamp(activity.Time._now, tz)
+
+def setNow(dt):
+ if dt is not None and dt.tzinfo is None:
+ dt = dt.replace(tzinfo=ICUtzinfo.default)
+
+ timetuple = dt.astimezone(TimeZone.utc).timetuple()
+
+ # this ignores calendar.timegm (or time.mktime) range limits and
+ # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
+ # ranges
+ new_timestamp = timegm(timetuple)
+
+ activity.Time.auto_update = False
+ activity.Time.advance(new_timestamp - activity.Time._now)
+
+def resetNow():
+ activity.Time.auto_update = True
+ activity.Time.tick()
+
+def nowTimestamp():
+ """The number of seconds betwen the UTC epoch and now."""
+ return activity.Time._now
+
+class TimeZone(trellis.Component, context.Service):
+
+ default = trellis.attr(ICUtzinfo.default)
+
+ @trellis.perform
+ def save_default(self):
+ ICUtzinfo.setDefault(self.default)
+
+ class _FloatingTZInfo(ICUtzinfo):
+ def __init__(self): pass
+
+ def utcoffset(self, dt):
+ return TimeZone.default.utcoffset(dt)
+
+ def dst(self, dt):
+ return TimeZone.default.dst(dt)
+
+ def __repr__(self):
+ return "FloatingTZ(%r)" % (TimeZone.default,)
+
+ floating = _FloatingTZInfo()
+
+ def __getitem__(self, key):
+ result = ICUtzinfo.getInstance(key)
+ if result.tzid == 'GMT' and key != 'GMT':
+ return None
+ else:
+ return result
+
+
+ ### Helper constants
+ pacific = ICUtzinfo.getInstance("US/Pacific")
+ eastern = ICUtzinfo.getInstance("US/Eastern")
+ utc = ICUtzinfo.getInstance("UTC")
</ins></span></pre></div>
<a id="trunkChandlerPlatformchandlertimemachinepy"></a>
<div class="delfile"><h4>Deleted: trunk/Chandler-Platform/chandler/timemachine.py
(31 => 32)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Sat, 14 Jun, 16:51 |
| Parlante |
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Sat, 09 Apr, 03:30 |
| ghoff |
er/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Sun, 31 Jul, 21:15 |
| ghoff |
er/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Sun, 31 Jul, 21:15 |
| ghoff |
er/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Sun, 31 Jul, 21:15 |
| ghoff |
er/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Sun, 31 Jul, 21:15 |
| ghoff |
```tzinfo``field.Ifyou+wanttospecifythetimezoneasbeingtheuserāscurrentdefault,use+the``floating``timezone:++&gt;&gt;&gt;TimeZone.floating+FloatingTZ(&lt;ICUtzinfo:US/Pacific&gt;)++Ifyouchangethedefaulttimezone,``floating``notices:++&gt;&gt;&gt;TimeZone.default=TimeZone.utc+&gt;&gt;&gt;TimeZone.floating+FloatingTZ(&lt;ICUtzinfo:UTC&gt;)++Because714ec@mail.gmail.com> |
Sun, 31 Jul, 21:15 |
| ghoff |
0e7f396000f691f00e7f396.e7f3a4@raincoast.com> |
Sun, 31 Jul, 21:15 |
| ghoff |
tInstance(&quot;US/Pacific&quot;)
+ eastern = ICUtzinfo.getInstance(&quot;US/Eastern&quot;)
+ utc = ICUtzinfo.getInstance(&quot;UTC&quot;)
</ins></span></pre></div>
<a id="trunkChandlerPlatformchandlertimemachinepy"></a>
<div class="delfile"><h4>Deleted: trunk/Chandler-Platform/chandler/timemachine.py
(31 => 32)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Sun, 31 Jul, 21:15 |
| ghoff |
and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Sun, 31 Jul, 21:15 |
| ghoff |
and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Sun, 31 Jul, 21:15 |
|
timezone is set to tz.
+ &quot;&quot;&quot;
+ if tz is None:
+ tz = TimeZone.default
+ return datetime.fromtimestamp(activity.Time._now, tz)
+
+def setNow(dt):
+ if dt is not None and dt.tzinfo is None:
+ dt = dt.replace(tzinfo=ICUtzinfo.default)
+
+ timetuple = dt.astimezone(TimeZone.utc).timetuple()
+
+ # this ignores calendar.timegm (or time.mktime) range limits and
+ # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
+ # ranges
+ new_timestamp = timegm(timetuple)
+
+ activity.Time.auto_update = False
+ activity.Time.advance(new_timestamp - activity.Time._now)
+
+def resetNow():
+ activity.Time.auto_update = True
+ activity.Time.Ś
|
Sun, 31 May, 00:29 |
| <MAWe...@rencomm.com> |
default = trellis.attr(ICUtzinfo.default)
+
+ @trellis.perform
+ def save_default(self):
+ ICUtzinfo.setDefault(self.default)
+
+ class _FloatingTZInfo(ICUtzinfo):
+ def __init__(self): pass
+
+ def utcoffset(self, dt):
+ return TimeZone.default.utcoffset(dt)
+
+ def dst(self, dt):
+ return TimeZone.default.dst(dt)
+
+ def __repr__(self):
+ return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
+
+ floating = _FloatingTZInfo()
+
+ def __getitem__(self, key):
+ result = ICUtzinfo.getInstance(key)
+ if result.tzid == 'GMT' and key != 'GMT':
+ return None
+ else:
+ return result
+
+
+ ### Helper constants
+ pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
+ eastern = ICUtzinfo.getInstance(&quot;US/Eastern&quot;)
+ utc = ICUtzinfo.getInstance(&quot;UTC&quot;)
</ins></span></pre></div>
<a id="trunkChandlerPlatformchandlertimemachinepy"></a>
<div class="delfile"><h4>Deleted: trunk/Chandler-Platform/chandler/timemachine.py
(31 => 32)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Wed, 05 Feb, 14:28 |
| <empirical.human...@gmail.com> |
bfoot.com> |
Thu, 06 Feb, 00:00 |
| llanp...@gmail.com> |
lf._indexes.iteritems():
- index._clearDirties()
</span><span class="add">+ self._clearIndexDirties()
</span><span class="cx">
def _copy_(self, orig):
</span>
</pre>
</div>
</div>
</body>
</html>§2 |
Sat, 07 Apr, 06:05 |
| ma...@gmail.com> |
one
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Wed, 11 Dec, 13:18 |
| bl...@orcaware.com |
"Michap(( Bel R°8h2 |
Sat, 21 Mar, 18:18 |
| bl...@orcaware.com |
else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Sat, 21 Mar, 18:18 |
| ic |
m/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Sun, 07 Jun, 03:49 |
| ic |
C epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Sun, 07 Jun, 03:49 |
| e |
= trellis.attr(ICUtzinfo.default)
+
+ @trellis.perform
+ def save_default(self):
+ ICUtzinfo.setDefault(self.default)
+
+ class _FloatingTZInfo(ICUtzinfo):
+ def __init__(self): pass
+
+ def utcoffset(self, dt):
+ return TimeZone.default.utcoffset(dt)
+
+ def dst(self, dt):
+ return TimeZone.default.dst(dt)
+
+ def __repr__(self):
+ return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
+
+ floating = _FloatingTZInfo()
+
+ def __getitem__(self, key):
+ result = ICUtzinfo.getInstance(key)
+ if result.tzid == 'GMT' and key != 'GMT':
+ return None
+ else:
+ return result
+
+
+ ### Helper constants
+ pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
+ eastern = ICUtzinfo.getInstance(&quot;US/Eastern&quot;)
+ utc = ICUtzinfo.getInstance(&quot;UTC&quot;)
</ins></span></pre></div>
<a id="trunkChandlerPlatformchandlertimemachinepy"></a>
<div class="delfile"><h4>Deleted: trunk/Chandler-Platform/chandler/timemachine.py
(31 => 32)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Tue, 18 Feb, 17:56 |
| e |
= trellis.attr(ICUtzinfo.default)
+
+ @trellis.perform
+ def save_default(self):
+ ICUtzinfo.setDefault(self.default)
+
+ class _FloatingTZInfo(ICUtzinfo):
+ def __init__(self): pass
+
+ def utcoffset(self, dt):
+ return TimeZone.default.utcoffset(dt)
+
+ def dst(self, dt):
+ return TimeZone.default.dst(dt)
+
+ def __repr__(self):
+ return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
+
+ floating = _FloatingTZInfo()
+
+ def __getitem__(self, key):
+ result = ICUtzinfo.getInstance(key)
+ if result.tzid == 'GMT' and key != 'GMT':
+ return None
+ else:
+ return result
+
+
+ ### Helper constants
+ pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
+ eastern = ICUtzinfo.getInstance(&quot;US/Eastern&quot;)
+ utc = ICUtzinfo.getInstance(&quot;UTC&quot;)
</ins></span></pre></div>
<a id="trunkChandlerPlatformchandlertimemachinepy"></a>
<div class="delfile"><h4>Deleted: trunk/Chandler-Platform/chandler/timemachine.py
(31 => 32)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Tue, 18 Feb, 17:56 |
| e |
= trellis.attr(ICUtzinfo.default)
+
+ @trellis.perform
+ def save_default(self):
+ ICUtzinfo.setDefault(self.default)
+
+ class _FloatingTZInfo(ICUtzinfo):
+ def __init__(self): pass
+
+ def utcoffset(self, dt):
+ return TimeZone.default.utcoffset(dt)
+
+ def dst(self, dt):
+ return TimeZone.default.dst(dt)
+
+ def __repr__(self):
+ return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
+
+ floating = _FloatingTZInfo()
+
+ def __getitem__(self, key):
+ result = ICUtzinfo.getInstance(key)
+ if result.tzid == 'GMT' and key != 'GMT':
+ return None
+ else:
+ return result
+
+
+ ### Helper constants
+ pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
+ eastern = ICUtzinfo.getInstance(&quot;US/Eastern&quot;)
+ utc = ICUtzinfo.getInstance(&quot;UTC&quot;)
</ins></span></pre></div>
<a id="trunkChandlerPlatformchandlertimemachinepy"></a>
<div class="delfile"><h4>Deleted: trunk/Chandler-Platform/chandler/timemachine.py
(31 => 32)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Tue, 18 Feb, 17:56 |
| e |
= trellis.attr(ICUtzinfo.default)
+
+ @trellis.perform
+ def save_default(self):
+ ICUtzinfo.setDefault(self.default)
+
+ class _FloatingTZInfo(ICUtzinfo):
+ def __init__(self): pass
+
+ def utcoffset(self, dt):
+ return TimeZone.default.utcoffset(dt)
+
+ def dst(self, dt):
+ return TimeZone.default.dst(dt)
+
+ def __repr__(self):
+ return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
+
+ floating = _FloatingTZInfo()
+
+ def __getitem__(self, key):
+ result = ICUtzinfo.getInstance(key)
+ if result.tzid == 'GMT' and key != 'GMT':
+ return None
+ else:
+ return result
+
+
+ ### Helper constants
+ pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
+ eastern = ICUtzinfo.getInstance(&quot;US/Eastern&quot;)
+ utc = ICUtzinfo.getInstance(&quot;UTC&quot;)
</ins></span></pre></div>
<a id="trunkChandlerPlatformchandlertimemachinepy"></a>
<div class="delfile"><h4>Deleted: trunk/Chandler-Platform/chandler/timemachine.py
(31 => 32)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Tue, 18 Feb, 17:56 |
| e |
= trellis.attr(ICUtzinfo.default)
+
+ @trellis.perform
+ def save_default(self):
+ ICUtzinfo.setDefault(self.default)
+
+ class _FloatingTZInfo(ICUtzinfo):
+ def __init__(self): pass
+
+ def utcoffset(self, dt):
+ return TimeZone.default.utcoffset(dt)
+
+ def dst(self, dt):
+ return TimeZone.default.dst(dt)
+
+ def __repr__(self):
+ return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
+
+ floating = _FloatingTZInfo()
+
+ def __getitem__(self, key):
+ result = ICUtzinfo.getInstance(key)
+ if result.tzid == 'GMT' and key != 'GMT':
+ return None
+ else:
+ return result
+
+
+ ### Helper constants
+ pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
+ eastern = ICUtzinfo.getInstance(&quot;US/Eastern&quot;)
+ utc = ICUtzinfo.getInstance(&quot;UTC&quot;)
</ins></span></pre></div>
<a id="trunkChandlerPlatformchandlertimemachinepy"></a>
<div class="delfile"><h4>Deleted: trunk/Chandler-Platform/chandler/timemachine.py
(31 => 32)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Tue, 18 Feb, 17:56 |
| e |
= trellis.attr(ICUtzinfo.default)
+
+ @trellis.perform
+ def save_default(self):
+ ICUtzinfo.setDefault(self.default)
+
+ class _FloatingTZInfo(ICUtzinfo):
+ def __init__(self): pass
+
+ def utcoffset(self, dt):
+ return TimeZone.default.utcoffset(dt)
+
+ def dst(self, dt):
+ return TimeZone.default.dst(dt)
+
+ def __repr__(self):
+ return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
+
+ floating = _FloatingTZInfo()
+
+ def __getitem__(self, key):
+ result = ICUtzinfo.getInstance(key)
+ if result.tzid == 'GMT' and key != 'GMT':
+ return None
+ else:
+ return result
+
+
+ ### Helper constants
+ pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
+ eastern = ICUtzinfo.getInstance(&quot;US/Eastern&quot;)
+ utc = ICUtzinfo.getInstance(&quot;UTC&quot;)
</ins></span></pre></div>
<a id="trunkChandlerPlatformchandlertimemachinepy"></a>
<div class="delfile"><h4>Deleted: trunk/Chandler-Platform/chandler/timemachine.py
(31 => 32)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Tue, 18 Feb, 17:56 |
| e |
07 Apr, 02:32 |
Tue, 18 Feb, 17:56 |
| e |
7A8-B259-45F3-B2A5-826727B2B368@osafoundation.org> |
Tue, 18 Feb, 17:56 |
| e |
shouldn't be outside those
+ # ranges
+ new_timestamp = timegm(timetuple)
+
+ activity.Time.auto_update = False
+ activity.Time.advance(new_timestamp - activity.Time._now)
+
+def resetNow():
+ activity.Time.auto_update = True
+ activity.Time.tick()
+
+def nowTimestamp():
+ &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
+ return activity.Time._now
+
+class TimeZone(trellis.Component, context.Service):
+
+ default = trellis.attr(ICUtzinfo.default)
+
+ @trellis.perform
+ def save_default(self):
+ ICUtzinfo.setDefault(self.default)
+
+ class _FloatingTZInfo(ICUtzinfo):
+ def __init__(self): pass
+
+ def utcoffset(self, dt):
+ return TimeZone.default.utcoffset(dt)
+
+ def dst(self, dt):
+ return TimeZone.default.dst(dt)
+
+ def __repr__(self):
+ return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
+
+ floating = _FloatingTZInfo()
+
+ def __getitem__(self, key):
+ result = ICUtzinfo.getInstance(key)
+ if result.tzid == 'GMT' and key != 'GMT':
+ return None
+ else:
+ return result
+
+
+ ### Helper constants
+ pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
+ eastern = ICUtzinfo.getInstance(&quot;US/Eastern&quot;)
+ utc = ICUtzinfo.getInstance(&quot;UTC&quot;)
</ins></span></pre></div>
<a id="trunkChandlerPlatformchandlertimemachinepy"></a>
<div class="delfile"><h4>Deleted: trunk/Chandler-Platform/chandler/timemachine.py
(31 => 32)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Tue, 18 Feb, 17:56 |
| e |
ations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Tue, 18 Feb, 17:56 |
| e |
ations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Tue, 18 Feb, 17:56 |
| e |
ations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Tue, 18 Feb, 17:56 |
| l..@fesourcing.com> |
lf._indexes.iteritems():
- index._clearDirties()
</span><span class="add">+ self._clearIndexDirties()
</span><span class="cx">
def _copy_(self, orig):
</span>
</pre>
</div>
</div>
</body>
</html>§2 |
Fri, 02 Jul, 00:02 |
| l..@fesourcing.com> |
lf._indexes.iteritems():
- index._clearDirties()
</span><span class="add">+ self._clearIndexDirties()
</span><span class="cx">
def _copy_(self, orig):
</span>
</pre>
</div>
</div>
</body>
</html>§2 |
Fri, 02 Jul, 00:02 |
| l..@fesourcing.com> |
is.perform
+ def save_default(self):
+ ICUtzinfo.setDefault(self.default)
+
+ class _FloatingTZInfo(ICUtzinfo):
+ def __init__(self): pass
+
+ def utcoffset(self, dt):
+ return TimeZone.default.utcoffset(dt)
+
+ def dst(self, dt):
+ return TimeZone.default.dst(dt)
+
+ def __repr__(self):
+ return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
+
+ floating = _FloatingTZInfo()
+
+ def __getitem__(self, key):
+ result = ICUtzinfo.getInstance(key)
+ if result.tzid == 'GMT' and key != 'GMT':
+ return None
+ else:
+ return result
+
+
+ ### Helper constants
+ pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
+ eastern = ICUtzinfo.getInstance(&quot;US/Eastern&quot;)
+ utc = ICUtzinfo.getInstance(&quot;UTC&quot;)
</ins></span></pre></div>
<a id="trunkChandlerPlatformchandlertimemachinepy"></a>
<div class="delfile"><h4>Deleted: trunk/Chandler-Platform/chandler/timemachine.py
(31 => 32)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Fri, 02 Jul, 00:02 |
| s |
f tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Tue, 21 May, 04:38 |
| s |
f tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Tue, 21 May, 04:38 |
| s |
<48ECFCB5.1000406@flyingpigs.dk> <B1A876AD-F0D4-4A36-A1DB-F353ED24827D@osafoundation.org> |
Tue, 21 May, 04:38 |
| ?Q?Robert_Sch=F6ftner?= |
chine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Sat, 07 Aug, 00:39 |
| ?Q?R=E9mi_Despr=E9s-Smyth?= |
rom PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Mon, 10 Dec, 07:07 |
| ?Q?R=E9mi_Despr=E9s-Smyth?= |
hange the default time zone, ``floating`` notices:
+
+&gt;&gt;&gt; TimeZone.default = TimeZone.utc
+&gt;&gt;&gt; TimeZone.floating
+FloatingTZ(&lt;ICUtzinfo: UTC&gt;)
+
+Because 714ec@mail.gmail.com> |
Mon, 10 Dec, 07:07 |
| r..@tnir.org> |
t either
>> 1) delete the mail from imap after it is read
>> or
>> 2) Make store a hash of the mail locally so it can recognize mails that
>> have already been handled
>>
>>š~z" |
Thu, 30 Jan, 06:45 |
| <pef.go...@gmail.com> |
ICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Wed, 28 Sep, 01:45 |
| arl.l...@snet.net> |
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import peak.events.trellis as trellis
+import peak.events.activity as activity
+import peak.context as context
+
+from calendar import timegm
+from datetime import datetime
+from PyICU import ICUtzinfo
+
+def getNow(tz=None):
+ &quot;&quot;&quot;
+ Return the current datetime, or the peak.events.activity.Time's
+ simulated time.
+
+ The timezone is set to ICUtzinfo.default if tz is None, otherwise
+ timezone is set to tz.
+ &quot;&quot;&quot;
+ if tz is None:
+ tz = TimeZone.default
+ return datetime.fromtimestamp(activity.Time._now, tz)
+
+def setNow(dt):
+ if dt is not None and dt.tzinfo is None:
+ dt = dt.replace(tzinfo=ICUtzinfo.default)
+
+ timetuple = dt.astimezone(TimeZone.utc).timetuple()
+
+ # this ignores calendar.timegm (or time.mktime) range limits and
+ # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
+ # ranges
+ new_timestamp = timegm(timetuple)
+
+ activity.Time.auto_update = False
+ activity.Time.advance(new_timestamp - activity.Time._now)
+
+def resetNow():
+ activity.Time.auto_update = True
+ activity.Time.tick()
+
+def nowTimestamp():
+ &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
+ return activity.Time._now
+
+class TimeZone(trellis.Component, context.Service):
+
+ default = trellis.attr(ICUtzinfo.default)
+
+ @trellis.perform
+ def save_default(self):
+ ICUtzinfo.setDefault(self.default)
+
+ class _FloatingTZInfo(ICUtzinfo):
+ def __init__(self): pass
+
+ def utcoffset(self, dt):
+ return TimeZone.default.utcoffset(dt)
+
+ def dst(self, dt):
+ return TimeZone.default.dst(dt)
+
+ def __repr__(self):
+ return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
+
+ floating = _FloatingTZInfo()
+
+ def __getitem__(self, key):
+ result = ICUtzinfo.getInstance(key)
+ if result.tzid == 'GMT' and key != 'GMT':
+ return None
+ else:
+ return result
+
+
+ ### Helper constants
+ pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
+ eastern = ICUtzinfo.getInstance(&quot;US/Eastern&quot;)
+ utc = ICUtzinfo.getInstance(&quot;UTC&quot;)
</ins></span></pre></div>
<a id="trunkChandlerPlatformchandlertimemachinepy"></a>
<div class="delfile"><h4>Deleted: trunk/Chandler-Platform/chandler/timemachine.py
(31 => 32)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Wed, 24 Apr, 12:07 |
| arl.l...@snet.net> |
o(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Wed, 24 Apr, 12:07 |
| lemp2...@yahoo.com> |
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import peak.events.trellis as trellis
+import peak.events.activity as activity
+import peak.context as context
+
+from calendar import timegm
+from datetime import datetime
+from PyICU import ICUtzinfo
+
+def getNow(tz=None):
+ &quot;&quot;&quot;
+ Return the current datetime, or the peak.events.activity.Time's
+ simulated time.
+
+ The timezone is set to ICUtzinfo.default if tz is None, otherwise
+ timezone is set to tz.
+ &quot;&quot;&quot;
+ if tz is None:
+ tz = TimeZone.default
+ return datetime.fromtimestamp(activity.Time._now, tz)
+
+def setNow(dt):
+ if dt is not None and dt.tzinfo is None:
+ dt = dt.replace(tzinfo=ICUtzinfo.default)
+
+ timetuple = dt.astimezone(TimeZone.utc).timetuple()
+
+ # this ignores calendar.timegm (or time.mktime) range limits and
+ # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
+ # ranges
+ new_timestamp = timegm(timetuple)
+
+ activity.Time.auto_update = False
+ activity.Time.advance(new_timestamp - activity.Time._now)
+
+def resetNow():
+ activity.Time.auto_update = True
+ activity.Time.tick()
+
+def nowTimestamp():
+ &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
+ return activity.Time._now
+
+class TimeZone(trellis.Component, context.Service):
+
+ default = trellis.attr(ICUtzinfo.default)
+
+ @trellis.perform
+ def save_default(self):
+ ICUtzinfo.setDefault(self.default)
+
+ class _FloatingTZInfo(ICUtzinfo):
+ def __init__(self): pass
+
+ def utcoffset(self, dt):
+ return TimeZone.default.utcoffset(dt)
+
+ def dst(self, dt):
+ return TimeZone.default.dst(dt)
+
+ def __repr__(self):
+ return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
+
+ floating = _FloatingTZInfo()
+
+ def __getitem__(self, key):
+ result = ICUtzinfo.getInstance(key)
+ if result.tzid == 'GMT' and key != 'GMT':
+ return None
+ else:
+ return result
+
+
+ ### Helper constants
+ pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
+ eastern = ICUtzinfo.getInstance(&quot;US/Eastern&quot;)
+ utc = ICUtzinfo.getInstance(&quot;UTC&quot;)
</ins></span></pre></div>
<a id="trunkChandlerPlatformchandlertimemachinepy"></a>
<div class="delfile"><h4>Deleted: trunk/Chandler-Platform/chandler/timemachine.py
(31 => 32)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Wed, 24 Apr, 12:07 |
| lemp2...@yahoo.com> |
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import peak.events.trellis as trellis
+import peak.events.activity as activity
+import peak.context as context
+
+from calendar import timegm
+from datetime import datetime
+from PyICU import ICUtzinfo
+
+def getNow(tz=None):
+ &quot;&quot;&quot;
+ Return the current datetime, or the peak.events.activity.Time's
+ simulated time.
+
+ The timezone is set to ICUtzinfo.default if tz is None, otherwise
+ timezone is set to tz.
+ &quot;&quot;&quot;
+ if tz is None:
+ tz = TimeZone.default
+ return datetime.fromtimestamp(activity.Time._now, tz)
+
+def setNow(dt):
+ if dt is not None and dt.tzinfo is None:
+ dt = dt.replace(tzinfo=ICUtzinfo.default)
+
+ timetuple = dt.astimezone(TimeZone.utc).timetuple()
+
+ # this ignores calendar.timegm (or time.mktime) range limits and
+ # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
+ # ranges
+ new_timestamp = timegm(timetuple)
+
+ activity.Time.auto_update = False
+ activity.Time.advance(new_timestamp - activity.Time._now)
+
+def resetNow():
+ activity.Time.auto_update = True
+ activity.Time.tick()
+
+def nowTimestamp():
+ &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
+ return activity.Time._now
+
+class TimeZone(trellis.Component, context.Service):
+
+ default = trellis.attr(ICUtzinfo.default)
+
+ @trellis.perform
+ def save_default(self):
+ ICUtzinfo.setDefault(self.default)
+
+ class _FloatingTZInfo(ICUtzinfo):
+ def __init__(self): pass
+
+ def utcoffset(self, dt):
+ return TimeZone.default.utcoffset(dt)
+
+ def dst(self, dt):
+ return TimeZone.default.dst(dt)
+
+ def __repr__(self):
+ return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
+
+ floating = _FloatingTZInfo()
+
+ def __getitem__(self, key):
+ result = ICUtzinfo.getInstance(key)
+ if result.tzid == 'GMT' and key != 'GMT':
+ return None
+ else:
+ return result
+
+
+ ### Helper constants
+ pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
+ eastern = ICUtzinfo.getInstance(&quot;US/Eastern&quot;)
+ utc = ICUtzinfo.getInstance(&quot;UTC&quot;)
</ins></span></pre></div>
<a id="trunkChandlerPlatformchandlertimemachinepy"></a>
<div class="delfile"><h4>Deleted: trunk/Chandler-Platform/chandler/timemachine.py
(31 => 32)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Wed, 24 Apr, 12:07 |
| <pwgdarch...@gmail.com> |
ctivity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Tue, 19 Sep, 05:10 |
| <pwgdarch...@gmail.com> |
ctivity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Tue, 19 Sep, 05:10 |
|
e
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;tzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- &quot;&quot;&quot;The number of seconds betwen the UTC epoch and now.&quot;&quot;&quot;
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return &quot;FloatingTZ(%r)&quot; % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance(&quot;US/Pacific&quot;)
- eastext/ht |
Sun, 19 Feb, 19:20 |
|
emachine.py 2008-10-10 14:39:34
UTC (rev 31)
+++ trunk/Chandler-Platform/chandler/timemachine.py 2008-10-10 14:53:09 UTC (rev 32)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-# Copyright (c) 2003-2007 Open Source Applications Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import peak.events.trellis as trellis
-import peak.events.activity as activity
-import peak.context as context
-
-from calendar import timegm
-from datetime import datetime
-from PyICU import ICUtzinfo
-
-def getNow(tz=None):
- &quot;&quot;&quot;
- Return the current datetime, or the timemachine's pretend time.
-
- The timezone is set to ICUtzinfo.default if tz is None, otherwise
- timezone is set to tz.
-
- &quot;&quot;&quot;
- if tz is None:
- tz = TimeZone.default
- return datetime.fromtimestamp(activity.Time._now, tz)
-
-def setNow(dt):
- if dt is not None and dt.tzinfo is None:
- dt = dt.replace(tzinfo=ICUtzinfo.default)
-
- timetuple = dt.astimezone(TimeZone.utc).timetuple()
-
- # this ignores calendar.timegm (or time.mktime) range limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = Tr |