[Zope-Checkins] SVN: Zope/branches/slinkp-zopectl-exitcode-143813/ Making a branch to fix https://bugs.launchpad.net/zope2/+bug/143813

2008-05-04 Thread Paul Winkler
Log message for revision 85724:
  Making a branch to fix https://bugs.launchpad.net/zope2/+bug/143813
  

Changed:
  A   Zope/branches/slinkp-zopectl-exitcode-143813/

-=-
Copied: Zope/branches/slinkp-zopectl-exitcode-143813 (from rev 85723, 
Zope/trunk)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/slinkp-zopectl-exitcode-143813/lib/python/Zope2/Startup/zopectl.py Fixes bug 143813: zopectl should exit non-zero if child processes fail.

2008-05-04 Thread Paul Winkler
Log message for revision 85725:
  Fixes bug 143813: zopectl should exit non-zero if child processes fail.

Changed:
  U   
Zope/branches/slinkp-zopectl-exitcode-143813/lib/python/Zope2/Startup/zopectl.py

-=-
Modified: 
Zope/branches/slinkp-zopectl-exitcode-143813/lib/python/Zope2/Startup/zopectl.py
===
--- 
Zope/branches/slinkp-zopectl-exitcode-143813/lib/python/Zope2/Startup/zopectl.py
2008-04-25 16:07:13 UTC (rev 85724)
+++ 
Zope/branches/slinkp-zopectl-exitcode-143813/lib/python/Zope2/Startup/zopectl.py
2008-04-25 17:02:19 UTC (rev 85725)
@@ -147,6 +147,8 @@
 
 class ZopeCmd(ZDCmd):
 
+_exitstatus = 0
+
 def _get_override(self, opt, name, svalue=None, flag=0):
 # Suppress the config file, and pass all configuration via the
 # command line.  This avoids needing to specialize the zdrun
@@ -265,7 +267,7 @@
 cmd += '[sys.argv.append(x) for x in %s];' % argv
 cmd += 'import Zope2; app=Zope2.app(); execfile(\'%s\')' % script
 cmdline = self.get_startup_cmd(self.options.python, cmd)
-os.system(cmdline)
+self._exitstatus = os.system(cmdline)
 
 def help_run(self):
 print run script [args] -- run a Python script with the Zope 
@@ -335,10 +337,11 @@
 # Parent process running (execv replaces process in child
 while True:
 try:
-os.waitpid(pid, 0)
+pid, status = os.waitpid(pid, 0)
 except (OSError, KeyboardInterrupt):
 continue
 else:
+self._exitstatus = status
 break
 
 def help_test(self):
@@ -364,6 +367,8 @@
 print program:,  .join(options.program)
 c.do_status()
 c.cmdloop()
+else:
+return min(c._exitstatus, 1)
 
 def _ignoreSIGCHLD(*unused):
 while 1:
@@ -393,4 +398,5 @@
 # SIGCHILD is unset, just don't bother registering a SIGCHILD
 # signal handler at all.
 signal.signal(signal.SIGCHLD, _ignoreSIGCHLD)
-main()
+exitstatus = main()
+sys.exit(exitstatus)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.11/ Fixes bug 143813: zopectl should exit non-zero if child processes fail.

2008-05-04 Thread Paul Winkler
Log message for revision 85727:
  Fixes bug 143813: zopectl should exit non-zero if child processes fail.

Changed:
  U   Zope/branches/2.11/doc/CHANGES.txt
  U   Zope/branches/2.11/lib/python/Zope2/Startup/zopectl.py

-=-
Modified: Zope/branches/2.11/doc/CHANGES.txt
===
--- Zope/branches/2.11/doc/CHANGES.txt  2008-04-25 17:07:36 UTC (rev 85726)
+++ Zope/branches/2.11/doc/CHANGES.txt  2008-04-25 18:37:03 UTC (rev 85727)
@@ -8,6 +8,9 @@
 
 Bugs Fixed
 
+  - Launchpad #143813: zopectl now exits non-zero when
+child processes fail.
+
   - Products.Five: Resynced browser.adding with zope.app.container.
 This fixes some minor bugs and removes deprecated code.
 

Modified: Zope/branches/2.11/lib/python/Zope2/Startup/zopectl.py
===
--- Zope/branches/2.11/lib/python/Zope2/Startup/zopectl.py  2008-04-25 
17:07:36 UTC (rev 85726)
+++ Zope/branches/2.11/lib/python/Zope2/Startup/zopectl.py  2008-04-25 
18:37:03 UTC (rev 85727)
@@ -147,6 +147,8 @@
 
 class ZopeCmd(ZDCmd):
 
+_exitstatus = 0
+
 def _get_override(self, opt, name, svalue=None, flag=0):
 # Suppress the config file, and pass all configuration via the
 # command line.  This avoids needing to specialize the zdrun
@@ -265,7 +267,7 @@
 cmd += '[sys.argv.append(x) for x in %s];' % argv
 cmd += 'import Zope2; app=Zope2.app(); execfile(\'%s\')' % script
 cmdline = self.get_startup_cmd(self.options.python, cmd)
-os.system(cmdline)
+self._exitstatus = os.system(cmdline)
 
 def help_run(self):
 print run script [args] -- run a Python script with the Zope 
@@ -335,10 +337,11 @@
 # Parent process running (execv replaces process in child
 while True:
 try:
-os.waitpid(pid, 0)
+pid, status = os.waitpid(pid, 0)
 except (OSError, KeyboardInterrupt):
 continue
 else:
+self._exitstatus = status
 break
 
 def help_test(self):
@@ -364,6 +367,8 @@
 print program:,  .join(options.program)
 c.do_status()
 c.cmdloop()
+else:
+return min(c._exitstatus, 1)
 
 def _ignoreSIGCHLD(*unused):
 while 1:
@@ -393,4 +398,5 @@
 # SIGCHILD is unset, just don't bother registering a SIGCHILD
 # signal handler at all.
 signal.signal(signal.SIGCHLD, _ignoreSIGCHLD)
-main()
+exitstatus = main()
+sys.exit(exitstatus)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/slinkp-datetime-200007/ branch for fixing https://bugs.launchpad.net/zope2/+bug/200007

2008-05-04 Thread Paul Winkler
Log message for revision 85733:
  branch for fixing https://bugs.launchpad.net/zope2/+bug/27
  

Changed:
  A   Zope/branches/slinkp-datetime-27/

-=-
Copied: Zope/branches/slinkp-datetime-27 (from rev 85732, Zope/trunk)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/slinkp-datetime-200007/lib/python/DateTime/ Fix for launchpad #200007: DateTime() surprisingly changes timezone if passed a DateTime instance.

2008-05-04 Thread Paul Winkler
Log message for revision 85734:
  Fix for launchpad #27: DateTime() surprisingly changes timezone if passed 
a DateTime instance.

Changed:
  U   Zope/branches/slinkp-datetime-27/lib/python/DateTime/DateTime.py
  U   
Zope/branches/slinkp-datetime-27/lib/python/DateTime/tests/testDateTime.py

-=-
Modified: Zope/branches/slinkp-datetime-27/lib/python/DateTime/DateTime.py
===
--- Zope/branches/slinkp-datetime-27/lib/python/DateTime/DateTime.py
2008-04-25 20:22:51 UTC (rev 85733)
+++ Zope/branches/slinkp-datetime-27/lib/python/DateTime/DateTime.py
2008-04-25 20:58:04 UTC (rev 85734)
@@ -68,7 +68,7 @@
   (?:-? # one optional dash
(?:  # followed by:
 (?Pyear_day\d\d\d #  three digits year day
- (?!\d))#  when there's no fourth digit
+ (?!\d))#  when there is no fourth digit
|# or:
 W   #  one W
 (?Pweek\d\d)  #  two digits week
@@ -586,12 +586,11 @@
 DateTime instance.
 
 t = arg.timeTime()
-lt = safelocaltime(t)
-tz = self.localZone(lt)
+tz = arg.timezone()
 ms = (t - math.floor(t))
 s,d = _calcSD(t)
-yr,mo,dy,hr,mn,sc=lt[:6]
-sc=sc+ms
+yr,mo,dy,hr,mn,sc = gmtime(t)[:6]
+sc = sc + ms
 
 elif isinstance(arg, datetime):
 
yr,mo,dy,hr,mn,sc,numerictz,tznaive=self._parse_iso8601_preserving_tznaive(arg.isoformat())

Modified: 
Zope/branches/slinkp-datetime-27/lib/python/DateTime/tests/testDateTime.py
===
--- 
Zope/branches/slinkp-datetime-27/lib/python/DateTime/tests/testDateTime.py  
2008-04-25 20:22:51 UTC (rev 85733)
+++ 
Zope/branches/slinkp-datetime-27/lib/python/DateTime/tests/testDateTime.py  
2008-04-25 20:58:04 UTC (rev 85734)
@@ -386,6 +386,19 @@
 d = DateTime('1999/04/12')
 self.assertEqual(DateTime(d), d)
 
+def testCopyConstructorPreservesTimezone(self):
+# test for https://bugs.launchpad.net/zope2/+bug/27
+# This always worked in the local timezone, so we need at least
+# two tests with different zones to be sure at least one of them
+# is not local.
+d = DateTime('2004/04/04')
+self.assertEqual(DateTime(d).timezone(), d.timezone())
+d2 = DateTime('2008/04/25 12:00:00 EST')
+self.assertEqual(DateTime(d2).timezone(), d2.timezone())
+d3 = DateTime('2008/04/25 12:00:00 PST')
+self.assertEqual(DateTime(d3).timezone(), d3.timezone())
+
+
 def testRFC822(self):
 # rfc822 conversion
 dt = DateTime('2002-05-02T08:00:00+00:00')

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins