Commits

anatoly techtonik committed ba19174

+modstats.py: Draft for tracker stats.

Comments (0)

Files changed (1)

+#---
+#
+# Get statistics for modules from standard Python library
+#
+#---
+"""
+  [ ] open patches per module
+    [ ] get list of all open issues with patches
+      [ ] patch keyword is not reliable
+          http://bugs.python.org/issue15849
+        [ ] get list of all issues with attachments
+        [ ] filter patches
+    [ ] get patch files for each issue
+    [ ] extract paths from each patch
+    [ ] detect modules for the issue using paths
+    [ ] print list of modules and issues
+
+"""
+
+# -- 1. Get list of all open issues with patches --
+#
+# Using http://roundup.sourceforge.net/docs/xmlrpc.html
+
+try:
+  import xmlrpclib
+except ImportError:  # Python 3
+  import xmlrpc.client as xmlrpclib
+
+bpo = xmlrpclib.ServerProxy('http://bugs.python.org', allow_none=True)
+
+open_status = [bpo.lookup('status', x) for x in bpo.list('status')
+               if x != 'closed']
+patch_keyword = bpo.lookup('keyword', 'patch')
+
+open_issues = bpo.filter('issue', None, {'status':open_status, 'keywords':patch_keyword})
+#print(open_issues)
+print('Opened issues with patch keyword: %s' % len(open_issues))