[Python-apps-commits] r4643 - in packages/autokey/trunk/debian (3 files)
ffm-guest at users.alioth.debian.org
ffm-guest at users.alioth.debian.org
Wed Feb 3 14:19:06 UTC 2010
Date: Wednesday, February 3, 2010 @ 14:19:01
Author: ffm-guest
Revision: 4643
Add files not included in last commit
Added:
packages/autokey/trunk/debian/patches/0001-daemon-handle-invalid-pids.dpatch
packages/autokey/trunk/debian/patches/README
packages/autokey/trunk/debian/pyversions
Added: packages/autokey/trunk/debian/patches/0001-daemon-handle-invalid-pids.dpatch
===================================================================
--- packages/autokey/trunk/debian/patches/0001-daemon-handle-invalid-pids.dpatch (rev 0)
+++ packages/autokey/trunk/debian/patches/0001-daemon-handle-invalid-pids.dpatch 2010-02-03 14:19:01 UTC (rev 4643)
@@ -0,0 +1,60 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 0001-daemon-handle-invalid-pids.dpatch by <luke at faraone.cc>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad trunk~/src/lib/daemon.py trunk/src/lib/daemon.py
+--- trunk~/src/lib/daemon.py 2009-12-06 14:20:07.000000000 -0500
++++ trunk/src/lib/daemon.py 2010-02-03 09:09:34.200496881 -0500
+@@ -62,18 +62,27 @@
+
+ def delpid(self):
+ os.remove(self.pidfile)
+-
+- def start(self):
+- """
+- Start the daemon
+- """
+- # Check for a pidfile to see if the daemon already runs
++ def checkpid(self):
++ """Check for a pidfile to see if the daemon already runs
++
++ @references self.pidfile
++ @returns pid, an int representing the running daemon or None"""
+ try:
+ pf = file(self.pidfile,'r')
+ pid = int(pf.read().strip())
+ pf.close()
+ except IOError:
+ pid = None
++ except ValueError:
++ # the pidfile doesn't match our syntax, ignore it
++ pid = None
++ return pid
++
++ def start(self):
++ """
++ Start the daemon
++ """
++ pid = self.checkpid()
+
+ if pid:
+ message = "pidfile %s already exist. Daemon already running?\n"
+@@ -89,13 +98,8 @@
+ Stop the daemon
+ """
+ # Get the pid from the pidfile
+- try:
+- pf = file(self.pidfile,'r')
+- pid = int(pf.read().strip())
+- pf.close()
+- except IOError:
+- pid = None
+-
++ pid = self.checkpid()
++
+ if not pid:
+ message = "pidfile %s does not exist. Daemon not running?\n"
+ sys.stderr.write(message % self.pidfile)
Property changes on: packages/autokey/trunk/debian/patches/0001-daemon-handle-invalid-pids.dpatch
___________________________________________________________________
Added: svn:executable
+ *
Added: packages/autokey/trunk/debian/patches/README
===================================================================
--- packages/autokey/trunk/debian/patches/README (rev 0)
+++ packages/autokey/trunk/debian/patches/README 2010-02-03 14:19:01 UTC (rev 4643)
@@ -0,0 +1,4 @@
+0xxx: Grabbed from upstream development.
+1xxx: Possibly relevant for upstream adoption.
+2xxx: Only relevant for official Debian release.
+
Added: packages/autokey/trunk/debian/pyversions
===================================================================
--- packages/autokey/trunk/debian/pyversions (rev 0)
+++ packages/autokey/trunk/debian/pyversions 2010-02-03 14:19:01 UTC (rev 4643)
@@ -0,0 +1 @@
+2.5-
More information about the Python-apps-commits
mailing list