aboutsummaryrefslogtreecommitdiff
path: root/bugzilla_product_info.py
diff options
context:
space:
mode:
authorcpettet <rush@wikimedia.org>2014-10-21 14:32:37 -0500
committercpettet <rush@wikimedia.org>2014-10-21 14:32:37 -0500
commit089734d5af58c85b0874c5380e4ff74c6f11487d (patch)
treecc9410cfac95efa86447c19807af819b23ef3a1c /bugzilla_product_info.py
parent1dea599e81748ac6f0171ddae020545450bd74c8 (diff)
cleanup and fixes esp. T702
Diffstat (limited to 'bugzilla_product_info.py')
-rwxr-xr-xbugzilla_product_info.py48
1 files changed, 29 insertions, 19 deletions
diff --git a/bugzilla_product_info.py b/bugzilla_product_info.py
index 91303a0..78b52f5 100755
--- a/bugzilla_product_info.py
+++ b/bugzilla_product_info.py
@@ -10,39 +10,49 @@ import subprocess
import os
import re
import MySQLdb
-from phabdb import archive_project
from wmfphablib import config
from wmfphablib import log
from wmfphablib import vlog
import phabricator
from phabricator import Phabricator
+from wmfphablib import Phab as phabmacros
+from wmfphablib import return_bug_list
+from wmfphablib import phdb
+from wmfphablib import mailinglist_phid
+from wmfphablib import set_project_icon
+from wmfphablib import phabdb
-def main(bugid):
+def main():
phab = Phabricator(config.phab_user,
config.phab_cert,
config.phab_host)
+ phabm = phabmacros('', '', '')
+ phabm.con = phab
pmig = phabdb.phdb(db=config.bzmigrate_db,
user=config.bzmigrate_user,
passwd=config.bzmigrate_passwd)
server = xmlrpclib.ServerProxy(config.Bugzilla_url, use_datetime=True)
- kwargs = { 'names': 'Wikimedia',
- 'Bugzilla_login': config.Bugzilla_login,
- 'Bugzilla_password': config.Bugzilla_password}
-
- #http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Bug.html#attachments
- attached = server.Product.get(kwargs)['products']
- print attached
-
-
-if sys.stdin.isatty():
- bugs = sys.argv[1:]
-else:
- bugs = sys.stdin.read().strip('\n').strip().split()
-
-for i in bugs:
- if i.isdigit():
- main(i)
+ bzdata = open("data/bugzilla.yaml", 'r')
+ bzdata_yaml = yaml.load(bzdata)
+ #product = 'Wikimedia'
+
+ kwargs = {
+ 'Bugzilla_login': config.Bugzilla_login,
+ 'Bugzilla_password': config.Bugzilla_password}
+ products = server.Product.get_selectable_products(kwargs)['ids']
+ print products
+ for p in products:
+ kwargs = { 'ids': p,
+ 'Bugzilla_login': config.Bugzilla_login,
+ 'Bugzilla_password': config.Bugzilla_password}
+ pi = server.Product.get(kwargs)['products'][0]
+ print pi['name'], pi['description']
+ for c in pi['components']:
+ pname = "\n%s-%s\n\n%s" % (pi['name'], c['name'])
+ print pname
+ #phabm.ensure_project(pname, description=c['description'])
+main()