[cedar-backup-svn] SF.net SVN: cedar-backup:[1002] cedar-backup2/trunk
Brought to you by:
pronovic
|
From: <pro...@us...> - 2010-07-07 20:23:06
|
Revision: 1002
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=1002&view=rev
Author: pronovic
Date: 2010-07-07 20:23:00 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
Remove Python 2.3-compatible versions of util.nullDevice() and util.Pipe
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/util.py
cedar-backup2/trunk/TODO
Modified: cedar-backup2/trunk/CedarBackup2/util.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 20:20:16 UTC (rev 1001)
+++ cedar-backup2/trunk/CedarBackup2/util.py 2010-07-07 20:23:00 UTC (rev 1002)
@@ -855,11 +855,6 @@
never writes to it. Second, C{executeCommand} needs a way to discard all
output written to C{stderr}, as a means of simulating the shell
C{2>/dev/null} construct.
-
- All of this functionality is provided (in Python 2.4 or later) by the
- C{subprocess.Popen} class, so when that class is available, we'll use it.
- Otherwise, there's another implementation based on C{popen2.Popen4},
- which unfortunately only works on UNIX platforms.
"""
def __init__(self, cmd, bufsize=-1, ignoreStderr=False):
stderr = STDOUT
@@ -867,7 +862,6 @@
devnull = nullDevice()
stderr = os.open(devnull, os.O_RDWR)
Popen.__init__(self, shell=False, args=cmd, bufsize=bufsize, stdin=None, stdout=PIPE, stderr=stderr)
- self.fromchild = self.stdout # for compatibility with original interface based on popen2.Popen4
########################################################################
@@ -1485,7 +1479,7 @@
# The problem appears to be that we sometimes get a bad stderr file descriptor.
pipe = Pipe(fields, ignoreStderr=ignoreStderr)
while True:
- line = pipe.fromchild.readline()
+ line = pipe.stdout.readline()
if not line: break
if returnOutput: output.append(line)
if outputFile is not None: outputFile.write(line)
Modified: cedar-backup2/trunk/TODO
===================================================================
--- cedar-backup2/trunk/TODO 2010-07-07 20:20:16 UTC (rev 1001)
+++ cedar-backup2/trunk/TODO 2010-07-07 20:23:00 UTC (rev 1002)
@@ -98,9 +98,6 @@
- or maybe we have a flag (or several different parent classes) that control this behavior?
isn't buildPath() redundant -- doesn't os.path.join() do this?
what about captureOutput() -- can this kind of thing be done with a decorator now?
-implement Pipe only in terms of subprocess.Popen (get rid of popen2.Popen4-based implementation)
- - might be able to remove self.fromchild attribute (there for backwards compatibility)
-get rid of nullDevice(), since Python 2.5 should have os.devnull
remove writer.py
prune IsoImage and CdWriter to include only methods and attributes that we actually use
Pull out common functionality like openTray() and closeTray() somehow?
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|