whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curc...@apache.org
Subject [whimsy] branch master updated: Helper to create IRC attendance lines for proxies
Date Wed, 21 Mar 2018 13:28:35 GMT
This is an automated email from the ASF dual-hosted git repository.

curcuru pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new d5c6a0c  Helper to create IRC attendance lines for proxies
d5c6a0c is described below

commit d5c6a0ce9f12479e83486541dd6048a963417579
Author: Shane Curcuru <asf@shanecurcuru.org>
AuthorDate: Wed Mar 21 09:28:29 2018 -0400

    Helper to create IRC attendance lines for proxies
---
 tools/proxyhelper.rb | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/tools/proxyhelper.rb b/tools/proxyhelper.rb
new file mode 100644
index 0000000..d9c5daa
--- /dev/null
+++ b/tools/proxyhelper.rb
@@ -0,0 +1,44 @@
+#!/usr/bin/env ruby
+# Analyze proxies file and output data to remind proxies of IRC attendance lines
+# TODO Add function to email proxies with their info
+# TODO Add function to cross-check irc log that all proxy/attendee were marked
+
+$LOAD_PATH.unshift File.realpath(File.expand_path('../../lib', __FILE__))
+require 'whimsy/asf'
+require 'mail'
+
+MEETINGS = ASF::SVN['private/foundation/Meetings']
+
+# Get IRC attendance copy/paste lines for all proxies at a meeting
+# @param meeting dir name of current meeting
+# @return reminders {"proxy@apache.org" => ["IRC line", ...]}
+# @see foundation/Meetings/*.rb for other scripts that deal with 
+#   IRC log parsing, attendance marking, and proxy handling
+def reminder_lines(meeting = File.basename(Dir["#{MEETINGS}/2*"].sort.last).untaint)
+  lines = IO.read("#{MEETINGS}/#{meeting}/proxies")
+  proxylist = lines.scan(/\s\s(.{25})(.*?)\((.*?)\)/).map { |l| [l[0].strip, l[1].strip,
l[2]]} # [["Shane Curcuru    ", "David Fisher ", "wave"], ...]
+  copyproxy = Hash.new{|h,k| h[k] = [] }
+  proxylist.each do |arr|
+    copyproxy[arr[0]] << "#{arr[2].ljust(12)} | #{arr[1].strip} (proxy)"
+  end
+  copyproxy.delete('<name>')
+  reminders = {}
+  copyproxy.each do |nam, proxies|
+    user = ASF::Person.list("(cn=#{nam})")
+    if user.length == 1 # Copy to new array with their email instead of cn
+      reminders[user[0].mail[0]] = ["#{user[0].id.ljust(12)} | #{user[0].cn}"]
+      proxies.each do |l|
+        reminders[user[0].mail[0]]  << "#{l}"
+      end
+    else
+      # "Bogus: ASF::Person.list(#{nam}) not found, skipped!"
+    end
+  end
+  return reminders
+end
+
+#### Main method - TODO needs to be integrated into meeting process
+puts "START: reminder_lines()"
+p = reminder_lines
+puts p
+

-- 
To stop receiving notification emails like this one, please contact
curcuru@apache.org.

Mime
View raw message