[openssl-commits] [tools] master update

Rich Salz rsalz at openssl.org
Wed Sep 6 18:29:24 UTC 2017


The branch master has been updated
       via  76acfcbc4c7798a29000208b888fbcf5e73c28db (commit)
       via  6f876bb75f08a2aabdb1eac4124395e2f6d34c29 (commit)
      from  9685c0e6552d24d1ab2ae8392d6078513524bbfc (commit)


- Log -----------------------------------------------------------------
commit 76acfcbc4c7798a29000208b888fbcf5e73c28db
Author: Rich Salz <rsalz at openssl.org>
Date:   Wed Sep 6 14:29:05 2017 -0400

    Add get-followups

commit 6f876bb75f08a2aabdb1eac4124395e2f6d34c29
Author: Rich Salz <rsalz at openssl.org>
Date:   Wed Sep 6 14:28:55 2017 -0400

    Some cleanups

-----------------------------------------------------------------------

Summary of changes:
 license/finduser      |  8 +++-----
 license/get-followups | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 5 deletions(-)
 create mode 100755 license/get-followups

diff --git a/license/finduser b/license/finduser
index cea3dc7..13caad4 100755
--- a/license/finduser
+++ b/license/finduser
@@ -19,7 +19,6 @@ dbconfig = {
         }
 conn = mysql.connector.connect(**dbconfig)
 cursor = conn.cursor()
-raw = open("request-approval.txt").read()
 
 single = 0
 opts, args = getopt.getopt(sys.argv[1:], "1")
@@ -30,11 +29,10 @@ for o,a in opts:
         print __doc__
         raise SystemExit
 
-# Get dict of matching users
+q = ('SELECT users.uid,email,reply,name,count(log.uid) FROM users'
+        ' LEFT JOIN log ON log.uid = users.uid'
+        ' WHERE email like %s GROUP BY email' )
 for email in args:
-    q = ('SELECT users.uid,email,reply,name,count(log.uid) FROM users'
-            ' LEFT JOIN log ON log.uid = users.uid'
-            ' WHERE email like %s GROUP BY email' )
     pat = '%' + email + '%'
     cursor.execute(q, (pat,))
     for row in cursor:
diff --git a/license/get-followups b/license/get-followups
new file mode 100755
index 0000000..ba08f1f
--- /dev/null
+++ b/license/get-followups
@@ -0,0 +1,33 @@
+#! /usr/bin/env python
+"""get-followups
+
+Get list of users (in CSV format) who have not been reached.
+"""
+
+import mysql.connector
+import datetime, os, re, subprocess, sys, string, random
+import getopt
+
+urlbase = 'https://license.openssl.org/cgi-bin/lookup.py?uid='
+dbconfig = {
+        'user': 'licensereader',
+        'password': open('ropass.txt').read().strip(),
+        'database': 'license'
+        }
+conn = mysql.connector.connect(**dbconfig)
+cursor = conn.cursor()
+
+single = 0
+opts, args = getopt.getopt(sys.argv[1:], "")
+for o,a in opts:
+    print __doc__
+    raise SystemExit
+
+q = ('SELECT users.uid,email,reply,name,count(log.uid) FROM users'
+        ' LEFT JOIN log ON log.uid = users.uid'
+        ' WHERE reply = "-" GROUP BY email' )
+cursor.execute(q)
+fmtstring = urlbase + '%d, %s, %d, "%s"'
+for row in cursor:
+    uid,email,reply,name,count = row
+    print fmtstring % (uid, email, count, name)


More information about the openssl-commits mailing list