diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-02-17 16:52:33 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-02-17 16:52:33 +0100 |
| commit | 178f73f96a3752d492927bd6b8925b7967a0285c (patch) | |
| tree | b7770b231c66349692bb48c63c0a0e202e1a266e /apt | |
| parent | 972bf036a69f3f41ae5709568e246529b8e40ba5 (diff) | |
| download | python-apt-178f73f96a3752d492927bd6b8925b7967a0285c.tar.gz | |
apt/progress/base.py: call pipe ends {write,status}_stream
Diffstat (limited to 'apt')
| -rw-r--r-- | apt/progress/base.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apt/progress/base.py b/apt/progress/base.py index ccf618f9..88fee206 100644 --- a/apt/progress/base.py +++ b/apt/progress/base.py @@ -140,8 +140,8 @@ class InstallProgress(object): def __init__(self): (self.statusfd, self.writefd) = os.pipe() - self.write_pipe = os.fdopen(self.writefd, "w") - self.status_pipe = os.fdopen(self.statusfd, "r") + self.write_stream = os.fdopen(self.writefd, "w") + self.status_stream = os.fdopen(self.statusfd, "r") fcntl.fcntl(self.statusfd, fcntl.F_SETFL, os.O_NONBLOCK) def start_update(self): @@ -190,10 +190,10 @@ class InstallProgress(object): # and the execution continues in the # parent code leading to very confusing bugs try: - os._exit(obj.do_install(self.write_pipe.fileno())) + os._exit(obj.do_install(self.write_stream.fileno())) except AttributeError: os._exit(os.spawnlp(os.P_WAIT, "dpkg", "dpkg", "--status-fd", - str(self.write_pipe.fileno()), "-i", obj)) + str(self.write_stream.fileno()), "-i", obj)) except Exception: os._exit(apt_pkg.PackageManager.RESULT_FAILED) @@ -208,7 +208,7 @@ class InstallProgress(object): def update_interface(self): """Update the interface.""" try: - line = self.status_pipe.readline() + line = self.status_stream.readline() except IOError, err: # resource temporarly unavailable is ignored if err.errno != errno.EAGAIN and err.errno != errno.EWOULDBLOCK: @@ -263,7 +263,7 @@ class InstallProgress(object): (pid, res) = (0, 0) while True: try: - select.select([self.status_pipe], [], [], self.select_timeout) + select.select([self.status_stream], [], [], self.select_timeout) except select.error, (errno_, errstr): if errno_ != errno.EINTR: raise |
