summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2010-01-15 15:42:44 +0100
committerJulian Andres Klode <jak@debian.org>2010-01-15 15:42:44 +0100
commit6dae07e834445c193f392cf53a252b83c68f2bcd (patch)
treed660e8ad24c9c1bf028526606ddc02b7433dcf09 /apt
parentfec0cfe1617ccfcbb7b291ba00dedacdd3f133f7 (diff)
downloadpython-apt-6dae07e834445c193f392cf53a252b83c68f2bcd.tar.gz
Make all class-level constants have uppercase names.
Diffstat (limited to 'apt')
-rw-r--r--apt/cache.py14
-rw-r--r--apt/package.py4
-rw-r--r--apt/progress/base.py2
-rw-r--r--apt/progress/text.py2
4 files changed, 11 insertions, 11 deletions
diff --git a/apt/cache.py b/apt/cache.py
index eea06d56..d339f377 100644
--- a/apt/cache.py
+++ b/apt/cache.py
@@ -223,9 +223,9 @@ class Cache(object):
transient = False
err_msg = ""
for item in fetcher.items:
- if item.status == item.stat_done:
+ if item.status == item.STAT_DONE:
continue
- if item.stat_idle:
+ if item.STAT_IDLE:
transient = True
continue
err_msg += "Failed to fetch %s %s\n" % (item.desc_uri,
@@ -311,7 +311,7 @@ class Cache(object):
pulse_interval)
if res == apt_pkg.Acquire.result_cancelled and raise_on_error:
raise FetchCancelledException()
- if res == apt_pkg.Acquire.result_failed and raise_on_error:
+ if res == apt_pkg.Acquire.RESULT_FAILED and raise_on_error:
raise FetchFailedException()
else:
return res
@@ -369,17 +369,17 @@ class Cache(object):
# then install
res = self.install_archives(pm, install_progress)
- if res == pm.result_completed:
+ if res == pm.RESULT_COMPLETED:
break
- elif res == pm.result_failed:
+ elif res == pm.RESULT_FAILED:
raise SystemError("installArchives() failed")
- elif res == pm.result_incomplete:
+ elif res == pm.RESULT_INCOMPLETE:
pass
else:
raise SystemError("internal-error: unknown result code from InstallArchives: %s" % res)
# reload the fetcher for media swaping
fetcher.shutdown()
- return (res == pm.result_completed)
+ return (res == pm.RESULT_COMPLETED)
def clear(self):
""" Unmark all changes """
diff --git a/apt/package.py b/apt/package.py
index 315a7589..8171f57d 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -500,7 +500,7 @@ class Version(object):
self.size, base, destfile=destfile)
acq.run()
- if acqfile.status != acqfile.stat_done:
+ if acqfile.status != acqfile.STAT_DONE:
raise FetchError("The item %r could not be fetched: %s" %
(acqfile.destfile, acqfile.error_text))
print self._records.filename
@@ -548,7 +548,7 @@ class Version(object):
acq.run()
for item in acq.items:
- if item.status != item.stat_done:
+ if item.status != item.STAT_DONE:
raise FetchError("The item %r could not be fetched: %s" %
(item.destfile, item.error_text))
diff --git a/apt/progress/base.py b/apt/progress/base.py
index fd6bc475..adb39e93 100644
--- a/apt/progress/base.py
+++ b/apt/progress/base.py
@@ -192,7 +192,7 @@ class InstallProgress(object):
os._exit(os.spawnlp(os.P_WAIT, "dpkg", "dpkg", "--status-fd",
str(self.writefd.fileno()), "-i", obj))
except Exception:
- os._exit(apt_pkg.PackageManager.result_failed)
+ os._exit(apt_pkg.PackageManager.RESULT_FAILED)
self.child_pid = pid
res = self.wait_child()
diff --git a/apt/progress/text.py b/apt/progress/text.py
index 3a6d3e65..796577e2 100644
--- a/apt/progress/text.py
+++ b/apt/progress/text.py
@@ -125,7 +125,7 @@ class AcquireProgress(base.AcquireProgress, TextProgress):
def fail(self, item):
"""Called when an item is failed."""
base.AcquireProgress.fail(self, item)
- if item.owner.status == item.owner.stat_done:
+ if item.owner.status == item.owner.STAT_DONE:
self._write(_("Ign ") + item.description)
else:
self._write(_("Err ") + item.description)