Push the rpmtsGetKeys() stuff over to python completely
[platform/upstream/rpm.git] / python / rpm / transaction.py
1 #!/usr/bin/python
2
3 import _rpm
4
5 # TODO: migrate relevant documentation from C-side
6 class TransactionSet(_rpm.ts):
7     def _wrapSetGet(self, attr, val):
8         oval = getattr(self, attr)
9         setattr(self, attr, val)
10         return oval
11         
12     def setVSFlags(self, flags):
13         return _wrapSetGet('_vsflags', flags)
14
15     def getVSFlags(self):
16         return self._vsflags
17
18     def setColor(self, color):
19         return _wrapSetGet('_color', color)
20
21     def setPrefColor(self, color):
22         return _wrapSetGet('_prefcolor', color)
23
24     def setFlags(self, flags):
25         return _wrapSetGet('_flags', flags)
26
27     def setProbFilter(self, ignoreSet):
28         return _wrapSetGet('_probFilter', ignoreSet)
29
30     def parseSpec(self, specfile):
31         import _rpmb
32         return _rpmb.spec(specfile)
33
34     def getKeys(self):
35         keys = []
36         for te in self:
37             keys.append(te.Key())
38         # Backwards compatibility goo - WTH does this return a *tuple* ?!
39         if not keys:
40             return None
41         else:
42             return tuple(keys)