summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'common.py')
-rw-r--r--common.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/common.py b/common.py
index 16abf70..cf89eb7 100644
--- a/common.py
+++ b/common.py
@@ -43,6 +43,15 @@ def expand_braces(orig):
return list(set(res))
+def detect_cpvs(text):
+ cpvs = []
+ for cpv_string in list(set([text] + expand_braces(text))):
+ for cpv_candidate in CPV_REGEX.findall(cpv_string):
+ if portage.db["/"]["porttree"].dbapi.cpv_exists(cpv_candidate):
+ cpvs.append(cpv_candidate)
+ return list(set(cpvs))
+
+
def get_input(prompt):
return raw_input(prompt)
@@ -63,6 +72,8 @@ def login(bugzilla):
print 'Logging in'
bugzilla.User.login(params)
+ return user
+
class Bug:
def __init__(self, xml=None, id_number=None, summary=None, status=None):
@@ -91,11 +102,7 @@ class Bug:
def detect_cpvs(self):
if self.__cpvs_detected:
return
- for cpv_string in list(set([self.summary()] + expand_braces(self.summary()))):
- for cpv_candidate in CPV_REGEX.findall(cpv_string):
- if portage.db["/"]["porttree"].dbapi.cpv_exists(cpv_candidate):
- self.__cpvs.append(cpv_candidate)
- self.__cpvs = list(set(self.__cpvs))
+ self.__cpvs = detect_cpvs(self.summary())
self.__cpvs_detected = True
def id_number(self):