summaryrefslogtreecommitdiff
path: root/DysonInstaller/snack
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-09-08 18:30:56 +0400
committerIgor Pashev <pashev.igor@gmail.com>2013-09-08 18:30:56 +0400
commitf4b97d0af96c584a9b39f8492cfce185ffd993ae (patch)
tree8152cd1f3480d82ee5c18247dc027fa32e2bd5f0 /DysonInstaller/snack
parent6cae35f2f087a33e17e55857b2f08346b6992bfd (diff)
downloadlive-f4b97d0af96c584a9b39f8492cfce185ffd993ae.tar.gz
python-apt is bullshit
Diffstat (limited to 'DysonInstaller/snack')
-rw-r--r--DysonInstaller/snack/__init__.py61
1 files changed, 0 insertions, 61 deletions
diff --git a/DysonInstaller/snack/__init__.py b/DysonInstaller/snack/__init__.py
index 580aaba..15aa837 100644
--- a/DysonInstaller/snack/__init__.py
+++ b/DysonInstaller/snack/__init__.py
@@ -11,7 +11,6 @@ without prior consent from anybody.
from snack import *
import math
-import apt.progress.base
import os
class ProgressMessage(object):
@@ -141,63 +140,3 @@ class BaseProgress(object):
del self._progressbar
self._progressbar = None
-
-class DownloadProgress(apt.progress.base.AcquireProgress, BaseProgress):
- def pulse(self, acquire):
- self._progressbar.progress = (
- ((self.current_bytes + self.current_items) * 100.0) /
- float(self.total_bytes + self.total_items))
- return True
-
- def start(self):
- self._create_progressbar()
-
- def stop(self):
- self._destroy_progressbar()
-
-class OpenProgress(apt.progress.base.OpProgress, BaseProgress):
- def __init__(self, screen, title, text=''):
- BaseProgress.__init__(self, screen, title, text)
-
- def update(self, percent=None):
- if not self._progressbar:
- self._create_progressbar()
- if percent:
- self._progressbar.progress = percent
-
- def done(self):
- self._destroy_progressbar()
-
-class InstallProgress(apt.progress.base.InstallProgress, BaseProgress):
- _logfile = '/dev/null'
-
- def __init__(self, screen, title, text='', logfile=None):
- apt.progress.base.InstallProgress.__init__(self)
- BaseProgress.__init__(self, screen, title, text)
- if logfile:
- self._logfile = logfile
-
-
- def start_update(self):
- self._create_progressbar()
-
- def finish_update(self):
- self._destroy_progressbar()
-
- def status_change(self, pkg, percent, status):
- self._progressbar.progress = percent
- self._progressbar.text = status
-
- def dpkg_status_change(self, pkg, status):
- self._progressbar.progress = percent
- self._progressbar.text = status + ' ' + pkg
-
- def fork(self):
- """ Shut up dpkg """
- pid = os.fork()
- if pid == 0:
- log = os.open(self._logfile, os.O_WRONLY + os.O_CREAT)
- os.dup2(log, 1)
- os.dup2(log, 2)
- return pid
-