projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c0af31c
)
QueryCommand: add get_db() classmethod
author
Zac Medico
<zmedico@gentoo.org>
Mon, 11 Jun 2012 22:37:30 +0000
(15:37 -0700)
committer
Zac Medico
<zmedico@gentoo.org>
Mon, 11 Jun 2012 22:37:30 +0000
(15:37 -0700)
pym/portage/package/ebuild/_ipc/QueryCommand.py
patch
|
blob
|
history
diff --git
a/pym/portage/package/ebuild/_ipc/QueryCommand.py
b/pym/portage/package/ebuild/_ipc/QueryCommand.py
index 7bbb0e83bdc7c1e522805894a5a5188f9b91db82..d200fe80d12533dff6ef144ffb75e746b2b169fb 100644
(file)
--- a/
pym/portage/package/ebuild/_ipc/QueryCommand.py
+++ b/
pym/portage/package/ebuild/_ipc/QueryCommand.py
@@
-20,6
+20,12
@@
class QueryCommand(IpcCommand):
_db = None
+ @classmethod
+ def get_db(cls):
+ if cls._db is not None:
+ return cls._db
+ return portage.db
+
def __init__(self, settings, phase):
IpcCommand.__init__(self)
self.settings = settings
@@
-52,9
+58,7
@@
class QueryCommand(IpcCommand):
use = frozenset(use.split())
atom = atom.evaluate_conditionals(use)
- db = self._db
- if db is None:
- db = portage.db
+ db = self.get_db()
warnings_str = ''
if warnings: