launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #05800
[Merge] lp:~allenap/txfixtures/get-pid-in-tachandler into lp:txfixtures
Gavin Panella has proposed merging lp:~allenap/txfixtures/get-pid-in-tachandler into lp:txfixtures.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~allenap/txfixtures/get-pid-in-tachandler/+merge/84326
Remove spurious copy of get_pid_from_file() from txfixtures.tachandler. Fix lint too.
--
https://code.launchpad.net/~allenap/txfixtures/get-pid-in-tachandler/+merge/84326
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~allenap/txfixtures/get-pid-in-tachandler into lp:txfixtures.
=== modified file '.bzrignore'
--- .bzrignore 2011-11-04 02:07:28 +0000
+++ .bzrignore 2011-12-02 20:45:32 +0000
@@ -1,3 +1,5 @@
-build
-dist
-MANIFEST
+./build
+./dist
+./MANIFEST
+./TAGS
+./tags
=== modified file 'setup.py'
--- setup.py 2011-11-07 06:40:43 +0000
+++ setup.py 2011-12-02 20:45:32 +0000
@@ -28,7 +28,9 @@
description=('Treat Twisted applications as Python test fixtures'),
long_description=get_long_description(),
version=get_version(),
- classifiers=["License :: OSI Approved :: GNU General Public License (GPL)"],
+ classifiers=[
+ "License :: OSI Approved :: GNU General Public License (GPL)",
+ ],
packages=['txfixtures'],
requires=[
'fixtures',
=== modified file 'txfixtures/osutils.py'
--- txfixtures/osutils.py 2011-11-04 01:56:36 +0000
+++ txfixtures/osutils.py 2011-12-02 20:45:32 +0000
@@ -8,7 +8,6 @@
import errno
import os
import os.path
-import shutil
from signal import (
SIGKILL,
SIGTERM,
@@ -73,7 +72,6 @@
_kill_may_race(pid, SIGKILL)
-
def kill_by_pidfile(pidfile_path, poll_interval=0.1, num_polls=50):
"""Kill a process identified by the pid stored in a file.
@@ -124,5 +122,3 @@
raise
else:
raise
-
-
=== modified file 'txfixtures/tachandler.py'
--- txfixtures/tachandler.py 2011-11-07 07:39:00 +0000
+++ txfixtures/tachandler.py 2011-12-02 20:45:32 +0000
@@ -38,15 +38,16 @@
You must override setUpRoot to set up a root directory for the daemon.
- You may override _hasDaemonStarted, typically by calling _isPortListening, to
- tell how long to wait before the daemon is available.
+ You may override _hasDaemonStarted, typically by calling _isPortListening,
+ to tell how long to wait before the daemon is available.
"""
- def setUp(self, spew=False, umask=None, python_path=None, twistd_script=None):
+ def setUp(self, spew=False, umask=None,
+ python_path=None, twistd_script=None):
"""Initialize a new TacTestFixture fixture.
:param python_path: If set, run twistd under this Python interpreter.
- :param twistd_script: If set, run this twistd script rather than the
+ :param twistd_script: If set, run this twistd script rather than the
system default. Must be provided if python_path is given.
"""
Fixture.setUp(self)
@@ -79,7 +80,7 @@
python_path = sys.executable
if twistd_script is None:
twistd_script = '/usr/bin/twistd'
- args = [python_path,
+ args = [python_path,
'-Wignore::DeprecationWarning',
twistd_script,
'-o', '-y', self.tacfile, '--pidfile', self.pidfile,
@@ -202,18 +203,3 @@
@property
def daemon_port(self):
raise NotImplementedError
-
-def get_pid_from_file(pidfile_path):
- """Retrieve the PID from the given file, if it exists, None otherwise."""
- if not os.path.exists(pidfile_path):
- return None
- # Get the pid.
- pid = open(pidfile_path, 'r').read().split()[0]
- try:
- pid = int(pid)
- except ValueError:
- # pidfile contains rubbish
- return None
- return pid
-
-