summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'common.py')
-rw-r--r--common.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/common.py b/common.py
index ad25ad8..16abf70 100644
--- a/common.py
+++ b/common.py
@@ -3,6 +3,7 @@
import cStringIO
import datetime
+import getpass
import re
import portage
@@ -42,6 +43,27 @@ def expand_braces(orig):
return list(set(res))
+def get_input(prompt):
+ return raw_input(prompt)
+
+
+def login(bugzilla):
+ """Authenticate a session.
+ """
+ # prompt for username
+ user = get_input('Bugzilla Username: ')
+
+ # prompt for password
+ password = getpass.getpass()
+
+ # perform login
+ params = {}
+ params['login'] = user
+ params['password'] = password
+ print 'Logging in'
+ bugzilla.User.login(params)
+
+
class Bug:
def __init__(self, xml=None, id_number=None, summary=None, status=None):
if xml is not None: