summaryrefslogtreecommitdiff
path: root/lib/thandy/packagesys
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-01-22 10:54:34 -0500
committerNick Mathewson <nickm@torproject.org>2009-01-22 10:56:31 -0500
commitb64339f48280872deec7bb980a61e494f6f38c92 (patch)
treefe8262b8a6e7ca572cfe8c5c26720670697d8f8d /lib/thandy/packagesys
parent2068158fd08ca042b874422ee3826f40803f31d8 (diff)
Fix multiple pychecker-spotted typos.
These are mostly typos in methods that don't get used in the current Thandy, error in error-handling paths, modules we imported unnecessarily, etc.
Diffstat (limited to 'lib/thandy/packagesys')
-rw-r--r--lib/thandy/packagesys/ExePackages.py4
-rw-r--r--lib/thandy/packagesys/PackageDB.py6
-rw-r--r--lib/thandy/packagesys/PackageSystem.py6
-rw-r--r--lib/thandy/packagesys/RPMPackages.py4
4 files changed, 10 insertions, 10 deletions
diff --git a/lib/thandy/packagesys/ExePackages.py b/lib/thandy/packagesys/ExePackages.py
index 59be63e..1928ef3 100644
--- a/lib/thandy/packagesys/ExePackages.py
+++ b/lib/thandy/packagesys/ExePackages.py
@@ -36,8 +36,8 @@ class CommandInstaller(PS.Installer):
def __repr__(self):
parts = [ "CommandInstaller(%r, %r" %(self._relPath,
self._installCommand) ]
- if self.removeCommand:
- parts.append(", %r"%self.removeCommand)
+ if self._removeCommand:
+ parts.append(", %r"%self._removeCommand)
parts.append(")")
return "".join(parts)
diff --git a/lib/thandy/packagesys/PackageDB.py b/lib/thandy/packagesys/PackageDB.py
index 94a5ad9..7420868 100644
--- a/lib/thandy/packagesys/PackageDB.py
+++ b/lib/thandy/packagesys/PackageDB.py
@@ -42,7 +42,7 @@ class SimplePackageDB:
return self._db.get('pi_%s'%str(package))
def getManifest(self, package):
- return self._db.get('mf_%'%str(package), {})
+ return self._db.get('mf_%s'%str(package), {})
def removeAll(self, package):
for template in ["pv_%s", "ip_%s", "mf_%s"]:
@@ -59,7 +59,7 @@ def getPackageDBInstance():
fname = thandy.util.userFilename("db/packages")
logging.info("Opening package database in %s", fname)
_DB_INSTANCE = SimplePackageDB(fname)
- return _DB_INSTANCEx
+ return _DB_INSTANCE
class _DBMixin:
def setDB(self, db):
@@ -110,7 +110,7 @@ class DBChecker(PS.Checker, _DBMixin):
return [ self.getDB().getCurVersion(self._name) ]
def isInstalled(self):
- return self._version in self.getInstalledVersions(transaction)
+ return self._version in self.getInstalledVersions()
class DBInstaller(PS.Installer, _DBMixin):
def __init__(self, name, version, relPath, installer):
diff --git a/lib/thandy/packagesys/PackageSystem.py b/lib/thandy/packagesys/PackageSystem.py
index a521ca8..41d75e5 100644
--- a/lib/thandy/packagesys/PackageSystem.py
+++ b/lib/thandy/packagesys/PackageSystem.py
@@ -124,7 +124,7 @@ class PackageItem:
def setTransaction(self, transaction):
"""Set the transaction context for this item to 'transaction'.
"""
- if self._cheker is not None:
+ if self._checker is not None:
self._checker.setTransaction(transaction)
if self._installer is not None:
self._installer.setTransaction(transaction)
@@ -174,12 +174,12 @@ class Checker:
installed. Version types are item-dependent: a tuple or a
string is most common.
"""
- raise NotImplemented
+ raise NotImplemented()
def isInstalled(self):
"""Return true iff this particular version of this item is installed.
"""
- raise NotImplemented
+ raise NotImplemented()
class Installer:
"""Abstract base class. An Installer knows how to install or remove an
diff --git a/lib/thandy/packagesys/RPMPackages.py b/lib/thandy/packagesys/RPMPackages.py
index c710b8d..2c793e3 100644
--- a/lib/thandy/packagesys/RPMPackages.py
+++ b/lib/thandy/packagesys/RPMPackages.py
@@ -106,7 +106,7 @@ def checkRPMInstall(name, version, ts=None):
for fname, flags, md5sum in zip(h['filenames'], h['fileflags'], h['filemd5s']):
haveMD5 = fileMD5(fname)
if not haveMD5:
- if flags & RPMFILE_MISSINGOK:
+ if (flags & rpm.RPMFILE_MISSINGOK):
logging.info("%s is missing or unreadable from %s %s; "
"that's ok.", fname, name, h['version'])
else:
@@ -118,7 +118,7 @@ def checkRPMInstall(name, version, ts=None):
fname, name, h['version'])
else:
# file changed. If it's not configuration, that's a problem.
- if not flags & RPMFILE_CONFIG:
+ if not (flags & rpm.RPMFILE_CONFIG):
logging.warn("%s changed from installed version of %s %s",
fname, name, h['version'])
all_ok = False