summaryrefslogtreecommitdiff
path: root/DysonInstaller/snack/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'DysonInstaller/snack/__init__.py')
-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
-