Import the C-level ts python object as TransactionSetCore
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 15 Feb 2011 11:49:44 +0000 (13:49 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 15 Feb 2011 11:52:19 +0000 (13:52 +0200)
- The previous _rpmts name suggests its some scary internal stuff
  that shouldn't be used when that's not the case, it's just a
  lower level interface to the same thing.

python/rpm/transaction.py

index 153206f..adcb1bb 100644 (file)
@@ -1,10 +1,10 @@
 #!/usr/bin/python
 
 import rpm
-from rpm._rpm import ts as _rpmts
+from rpm._rpm import ts as TransactionSetCore
 
 # TODO: migrate relevant documentation from C-side
-class TransactionSet(_rpmts):
+class TransactionSet(TransactionSetCore):
     _probFilter = 0
 
     def _wrapSetGet(self, attr, val):
@@ -58,7 +58,7 @@ class TransactionSet(_rpmts):
             raise ValueError('how argument must be "u" or "i"')
         upgrade = (how == "u")
 
-        if not _rpmts.addInstall(self, header, key, upgrade):
+        if not TransactionSetCore.addInstall(self, header, key, upgrade):
             raise rpm.error("adding package to transaction failed")
 
     def addErase(self, item):
@@ -75,7 +75,7 @@ class TransactionSet(_rpmts):
             raise TypeError("invalid type %s" % type(item))
 
         for h in hdrs:
-            if not _rpmts.addErase(self, h):
+            if not TransactionSetCore.addErase(self, h):
                 raise rpm.error("package not installed")
 
         # garbage collection should take care but just in case...
@@ -83,7 +83,7 @@ class TransactionSet(_rpmts):
             del hdrs
 
     def run(self, callback, data):
-        rc = _rpmts.run(self, callback, data, self._probFilter)
+        rc = TransactionSetCore.run(self, callback, data, self._probFilter)
 
         # crazy backwards compatibility goo: None for ok, list of problems
         # if transaction didnt complete and empty list if it completed
@@ -99,7 +99,7 @@ class TransactionSet(_rpmts):
         return res
 
     def check(self, *args, **kwds):
-        _rpmts.check(self, *args, **kwds)
+        TransactionSetCore.check(self, *args, **kwds)
 
         # compatibility: munge problem strings into dependency tuples of doom
         res = []
@@ -134,7 +134,7 @@ class TransactionSet(_rpmts):
         return res
 
     def hdrCheck(self, blob):
-        res, msg = _rpmts.hdrCheck(self, blob)
+        res, msg = TransactionSetCore.hdrCheck(self, blob)
         # generate backwards compatibly broken exceptions
         if res == rpm.RPMRC_NOKEY:
             raise rpm.error("public key not available")
@@ -144,7 +144,7 @@ class TransactionSet(_rpmts):
             raise rpm.error(msg)
 
     def hdrFromFdno(self, fd):
-        res, h = _rpmts.hdrFromFdno(self, fd)
+        res, h = TransactionSetCore.hdrFromFdno(self, fd)
         # generate backwards compatibly broken exceptions
         if res == rpm.RPMRC_NOKEY:
             raise rpm.error("public key not available")