Mailing list archives: April 2008

Site index · List index
Message list1 · 2 · Next »Thread · Author · Date
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 "License"); -# 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 "AS IS" 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): - """ - 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. - - """ - 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") - eastext/ht Sat, 14 Jun, 16:51
Parlante - pacific = ICUtzinfo.getInstance("US/Pacific") - 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 "License"); -# 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 "AS IS" 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): - """ - 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. - - """ - 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") - 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 "License"); -# 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 "AS IS" 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): - """ - 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. - - """ - 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") - 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 "License"); -# 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 "AS IS" 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): - """ - 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. - - """ - 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") - 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 "License"); -# 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 "AS IS" 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): - """ - 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. - - """ - 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") - eastext/ht Sun, 31 Jul, 21:15
ghoff ```tzinfo``field.Ifyou+wanttospecifythetimezoneasbeingtheuser’scurrentdefault,use+the``floating``timezone:++>>>TimeZone.floating+FloatingTZ(<ICUtzinfo:US/Pacific>)++Ifyouchangethedefaulttimezone,``floating``notices:++>>>TimeZone.default=TimeZone.utc+>>>TimeZone.floating+FloatingTZ(<ICUtzinfo:UTC>)++Because714ec@mail.gmail.com> Sun, 31 Jul, 21:15
ghoff 0e7f396000f691f00e7f396.e7f3a4@raincoast.com> Sun, 31 Jul, 21:15
ghoff tInstance("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 "License"); -# 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 "AS IS" 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): - """ - 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. - - """ - 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") - eastext/ht Sun, 31 Jul, 21:15
ghoff 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") - eastext/ht Sun, 31 Jul, 21:15
ghoff 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") - eastext/ht Sun, 31 Jul, 21:15
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.Ś 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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) + eastern = ICUtzinfo.getInstance(&amp;quot;US/Eastern&amp;quot;) + utc = ICUtzinfo.getInstance(&amp;quot;UTC&amp;quot;) &lt;/ins&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="trunkChandlerPlatformchandlertimemachinepy"&gt;&lt;/a&gt; &lt;div class="delfile"&gt;&lt;h4&gt;Deleted: trunk/Chandler-Platform/chandler/timemachine.py (31 =&gt; 32)&lt;/h4&gt; &lt;pre class="diff"&gt;&lt;span&gt; &lt;span class="info"&gt;--- 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) &lt;/span&gt;&lt;span class="lines"&gt;@@ -1,90 +0,0 @@ &lt;/span&gt;&lt;del&gt;-# Copyright (c) 2003-2007 Open Source Applications Foundation -# -# Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;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 &amp;quot;AS IS&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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() &lt;/span&gt;&lt;span class="add"&gt;+ self._clearIndexDirties() &lt;/span&gt;&lt;span class="cx"&gt; def _copy_(self, orig): &lt;/span&gt; &lt;/pre&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;§2 Sat, 07 Apr, 06:05
ma...@gmail.com> one - else: - return result - - - ### Helper constants - pacific = ICUtzinfo.getInstance(&amp;quot;US/Pacific&amp;quot;) - eastext/ht Wed, 11 Dec, 13:18
bl...@orcaware.com "Michap€–€–((– B–el R°€–8h–2 Sat, 21 Mar, 18:18
bl...@orcaware.com else: - return result - - - ### Helper constants - pacific = ICUtzinfo.getInstance(&amp;quot;US/Pacific&amp;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) &lt;/span&gt;&lt;span class="lines"&gt;@@ -1,90 +0,0 @@ &lt;/span&gt;&lt;del&gt;-# Copyright (c) 2003-2007 Open Source Applications Foundation -# -# Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;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 &amp;quot;AS IS&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) - eastext/ht Sun, 07 Jun, 03:49
ic C epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) + eastern = ICUtzinfo.getInstance(&amp;quot;US/Eastern&amp;quot;) + utc = ICUtzinfo.getInstance(&amp;quot;UTC&amp;quot;) &lt;/ins&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="trunkChandlerPlatformchandlertimemachinepy"&gt;&lt;/a&gt; &lt;div class="delfile"&gt;&lt;h4&gt;Deleted: trunk/Chandler-Platform/chandler/timemachine.py (31 =&gt; 32)&lt;/h4&gt; &lt;pre class="diff"&gt;&lt;span&gt; &lt;span class="info"&gt;--- 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) &lt;/span&gt;&lt;span class="lines"&gt;@@ -1,90 +0,0 @@ &lt;/span&gt;&lt;del&gt;-# Copyright (c) 2003-2007 Open Source Applications Foundation -# -# Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;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 &amp;quot;AS IS&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) + eastern = ICUtzinfo.getInstance(&amp;quot;US/Eastern&amp;quot;) + utc = ICUtzinfo.getInstance(&amp;quot;UTC&amp;quot;) &lt;/ins&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="trunkChandlerPlatformchandlertimemachinepy"&gt;&lt;/a&gt; &lt;div class="delfile"&gt;&lt;h4&gt;Deleted: trunk/Chandler-Platform/chandler/timemachine.py (31 =&gt; 32)&lt;/h4&gt; &lt;pre class="diff"&gt;&lt;span&gt; &lt;span class="info"&gt;--- 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) &lt;/span&gt;&lt;span class="lines"&gt;@@ -1,90 +0,0 @@ &lt;/span&gt;&lt;del&gt;-# Copyright (c) 2003-2007 Open Source Applications Foundation -# -# Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;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 &amp;quot;AS IS&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) + eastern = ICUtzinfo.getInstance(&amp;quot;US/Eastern&amp;quot;) + utc = ICUtzinfo.getInstance(&amp;quot;UTC&amp;quot;) &lt;/ins&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="trunkChandlerPlatformchandlertimemachinepy"&gt;&lt;/a&gt; &lt;div class="delfile"&gt;&lt;h4&gt;Deleted: trunk/Chandler-Platform/chandler/timemachine.py (31 =&gt; 32)&lt;/h4&gt; &lt;pre class="diff"&gt;&lt;span&gt; &lt;span class="info"&gt;--- 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) &lt;/span&gt;&lt;span class="lines"&gt;@@ -1,90 +0,0 @@ &lt;/span&gt;&lt;del&gt;-# Copyright (c) 2003-2007 Open Source Applications Foundation -# -# Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;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 &amp;quot;AS IS&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) + eastern = ICUtzinfo.getInstance(&amp;quot;US/Eastern&amp;quot;) + utc = ICUtzinfo.getInstance(&amp;quot;UTC&amp;quot;) &lt;/ins&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="trunkChandlerPlatformchandlertimemachinepy"&gt;&lt;/a&gt; &lt;div class="delfile"&gt;&lt;h4&gt;Deleted: trunk/Chandler-Platform/chandler/timemachine.py (31 =&gt; 32)&lt;/h4&gt; &lt;pre class="diff"&gt;&lt;span&gt; &lt;span class="info"&gt;--- 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) &lt;/span&gt;&lt;span class="lines"&gt;@@ -1,90 +0,0 @@ &lt;/span&gt;&lt;del&gt;-# Copyright (c) 2003-2007 Open Source Applications Foundation -# -# Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;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 &amp;quot;AS IS&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) + eastern = ICUtzinfo.getInstance(&amp;quot;US/Eastern&amp;quot;) + utc = ICUtzinfo.getInstance(&amp;quot;UTC&amp;quot;) &lt;/ins&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="trunkChandlerPlatformchandlertimemachinepy"&gt;&lt;/a&gt; &lt;div class="delfile"&gt;&lt;h4&gt;Deleted: trunk/Chandler-Platform/chandler/timemachine.py (31 =&gt; 32)&lt;/h4&gt; &lt;pre class="diff"&gt;&lt;span&gt; &lt;span class="info"&gt;--- 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) &lt;/span&gt;&lt;span class="lines"&gt;@@ -1,90 +0,0 @@ &lt;/span&gt;&lt;del&gt;-# Copyright (c) 2003-2007 Open Source Applications Foundation -# -# Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;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 &amp;quot;AS IS&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) + eastern = ICUtzinfo.getInstance(&amp;quot;US/Eastern&amp;quot;) + utc = ICUtzinfo.getInstance(&amp;quot;UTC&amp;quot;) &lt;/ins&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="trunkChandlerPlatformchandlertimemachinepy"&gt;&lt;/a&gt; &lt;div class="delfile"&gt;&lt;h4&gt;Deleted: trunk/Chandler-Platform/chandler/timemachine.py (31 =&gt; 32)&lt;/h4&gt; &lt;pre class="diff"&gt;&lt;span&gt; &lt;span class="info"&gt;--- 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) &lt;/span&gt;&lt;span class="lines"&gt;@@ -1,90 +0,0 @@ &lt;/span&gt;&lt;del&gt;-# Copyright (c) 2003-2007 Open Source Applications Foundation -# -# Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;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 &amp;quot;AS IS&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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(): + &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) + eastern = ICUtzinfo.getInstance(&amp;quot;US/Eastern&amp;quot;) + utc = ICUtzinfo.getInstance(&amp;quot;UTC&amp;quot;) &lt;/ins&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="trunkChandlerPlatformchandlertimemachinepy"&gt;&lt;/a&gt; &lt;div class="delfile"&gt;&lt;h4&gt;Deleted: trunk/Chandler-Platform/chandler/timemachine.py (31 =&gt; 32)&lt;/h4&gt; &lt;pre class="diff"&gt;&lt;span&gt; &lt;span class="info"&gt;--- 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) &lt;/span&gt;&lt;span class="lines"&gt;@@ -1,90 +0,0 @@ &lt;/span&gt;&lt;del&gt;-# Copyright (c) 2003-2007 Open Source Applications Foundation -# -# Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;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 &amp;quot;AS IS&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) - eastext/ht Tue, 18 Feb, 17:56
l..@fesourcing.com> lf._indexes.iteritems(): - index._clearDirties() &lt;/span&gt;&lt;span class="add"&gt;+ self._clearIndexDirties() &lt;/span&gt;&lt;span class="cx"&gt; def _copy_(self, orig): &lt;/span&gt; &lt;/pre&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;§2 Fri, 02 Jul, 00:02
l..@fesourcing.com> lf._indexes.iteritems(): - index._clearDirties() &lt;/span&gt;&lt;span class="add"&gt;+ self._clearIndexDirties() &lt;/span&gt;&lt;span class="cx"&gt; def _copy_(self, orig): &lt;/span&gt; &lt;/pre&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;§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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) + eastern = ICUtzinfo.getInstance(&amp;quot;US/Eastern&amp;quot;) + utc = ICUtzinfo.getInstance(&amp;quot;UTC&amp;quot;) &lt;/ins&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="trunkChandlerPlatformchandlertimemachinepy"&gt;&lt;/a&gt; &lt;div class="delfile"&gt;&lt;h4&gt;Deleted: trunk/Chandler-Platform/chandler/timemachine.py (31 =&gt; 32)&lt;/h4&gt; &lt;pre class="diff"&gt;&lt;span&gt; &lt;span class="info"&gt;--- 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) &lt;/span&gt;&lt;span class="lines"&gt;@@ -1,90 +0,0 @@ &lt;/span&gt;&lt;del&gt;-# Copyright (c) 2003-2007 Open Source Applications Foundation -# -# Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;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 &amp;quot;AS IS&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) - eastext/ht Fri, 02 Jul, 00:02
s f tz is None, otherwise - timezone is set to tz. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) - eastext/ht Tue, 21 May, 04:38
s f tz is None, otherwise - timezone is set to tz. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) - eastext/ht Sat, 07 Aug, 00:39
?Q?R=E9mi_Despr=E9s-Smyth?= rom PyICU import ICUtzinfo - -def getNow(tz=None): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) - eastext/ht Mon, 10 Dec, 07:07
?Q?R=E9mi_Despr=E9s-Smyth?= hange the default time zone, ``floating`` notices: + +&amp;gt;&amp;gt;&amp;gt; TimeZone.default = TimeZone.utc +&amp;gt;&amp;gt;&amp;gt; TimeZone.floating +FloatingTZ(&amp;lt;ICUtzinfo: UTC&amp;gt;) + +Because 714ec@mail.gmail.com> Mon, 10 Dec, 07:07
r..@tnir.org> t either &gt;&gt; 1) delete the mail from imap after it is read &gt;&gt; or &gt;&gt; 2) Make store a hash of the mail locally so it can recognize mails that &gt;&gt; have already been handled &gt;&gt; &gt;&gtš~z" Thu, 30 Jan, 06:45
<pef.go...@gmail.com> ICU import ICUtzinfo - -def getNow(tz=None): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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): + &amp;quot;&amp;quot;&amp;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. + &amp;quot;&amp;quot;&amp;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(): + &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) + eastern = ICUtzinfo.getInstance(&amp;quot;US/Eastern&amp;quot;) + utc = ICUtzinfo.getInstance(&amp;quot;UTC&amp;quot;) &lt;/ins&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="trunkChandlerPlatformchandlertimemachinepy"&gt;&lt;/a&gt; &lt;div class="delfile"&gt;&lt;h4&gt;Deleted: trunk/Chandler-Platform/chandler/timemachine.py (31 =&gt; 32)&lt;/h4&gt; &lt;pre class="diff"&gt;&lt;span&gt; &lt;span class="info"&gt;--- 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) &lt;/span&gt;&lt;span class="lines"&gt;@@ -1,90 +0,0 @@ &lt;/span&gt;&lt;del&gt;-# Copyright (c) 2003-2007 Open Source Applications Foundation -# -# Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;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 &amp;quot;AS IS&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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): + &amp;quot;&amp;quot;&amp;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. + &amp;quot;&amp;quot;&amp;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(): + &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) + eastern = ICUtzinfo.getInstance(&amp;quot;US/Eastern&amp;quot;) + utc = ICUtzinfo.getInstance(&amp;quot;UTC&amp;quot;) &lt;/ins&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="trunkChandlerPlatformchandlertimemachinepy"&gt;&lt;/a&gt; &lt;div class="delfile"&gt;&lt;h4&gt;Deleted: trunk/Chandler-Platform/chandler/timemachine.py (31 =&gt; 32)&lt;/h4&gt; &lt;pre class="diff"&gt;&lt;span&gt; &lt;span class="info"&gt;--- 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) &lt;/span&gt;&lt;span class="lines"&gt;@@ -1,90 +0,0 @@ &lt;/span&gt;&lt;del&gt;-# Copyright (c) 2003-2007 Open Source Applications Foundation -# -# Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;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 &amp;quot;AS IS&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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): + &amp;quot;&amp;quot;&amp;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. + &amp;quot;&amp;quot;&amp;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(): + &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;quot;) + eastern = ICUtzinfo.getInstance(&amp;quot;US/Eastern&amp;quot;) + utc = ICUtzinfo.getInstance(&amp;quot;UTC&amp;quot;) &lt;/ins&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt; &lt;a id="trunkChandlerPlatformchandlertimemachinepy"&gt;&lt;/a&gt; &lt;div class="delfile"&gt;&lt;h4&gt;Deleted: trunk/Chandler-Platform/chandler/timemachine.py (31 =&gt; 32)&lt;/h4&gt; &lt;pre class="diff"&gt;&lt;span&gt; &lt;span class="info"&gt;--- 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) &lt;/span&gt;&lt;span class="lines"&gt;@@ -1,90 +0,0 @@ &lt;/span&gt;&lt;del&gt;-# Copyright (c) 2003-2007 Open Source Applications Foundation -# -# Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;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 &amp;quot;AS IS&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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(&amp;quot;US/Pacific&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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(&amp;quot;US/Pacific&amp;quot;) - eastext/ht Tue, 19 Sep, 05:10
e - timezone is set to tz. - - &amp;quot;&amp;quot;&amp;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(): - &amp;quot;&amp;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(): - &amp;quot;&amp;quot;&amp;quot;The number of seconds betwen the UTC epoch and now.&amp;quot;&amp;quot;&amp;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 &amp;quot;FloatingTZ(%r)&amp;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(&amp;quot;US/Pacific&amp;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) &lt;/span&gt;&lt;span class="lines"&gt;@@ -1,90 +0,0 @@ &lt;/span&gt;&lt;del&gt;-# Copyright (c) 2003-2007 Open Source Applications Foundation -# -# Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;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 &amp;quot;AS IS&amp;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): - &amp;quot;&amp;quot;&amp;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. - - &amp;quot;&amp;quot;&amp;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