Skip to content
Snippets Groups Projects
Commit f28dae23 authored by Patrick Cernko's avatar Patrick Cernko
Browse files

--sympa and --kv (keywords) mode

parent 5a9447ea
No related branches found
No related tags found
No related merge requests found
......@@ -239,9 +239,9 @@ class MailmanHTMLParser(HTMLParser):
def main():
global maxchunk, letters, url_path, page_cset
try:
opts, args = getopt.getopt(sys.argv[1:], "ho:rd:fn:cu:Uvs",
opts, args = getopt.getopt(sys.argv[1:], "ho:rd:fn:cKu:Uvs",
["help", "output=", "regular", "digest=", "fullnames",
"nomail=", "csv", "url_path=", "unhide", "verbose",
"nomail=", "sympa", "csv", "kv", "url_path=", "unhide", "verbose",
"ssl"])
except:
usage(2)
......@@ -251,7 +251,9 @@ def main():
verbose = False
regular = False
digest = None
sympa = False
csv = False
kv = False
unhide = False
protocol = 'http'
url_path = '/mailman/admin'
......@@ -270,6 +272,10 @@ def main():
regular = True
if o in ("-d", "--digest"):
digest = a.lower()
if o in ("-S", "--sympa"):
sympa = True
if o in ("-K", "--kv"):
kv = True
if o in ("-c", "--csv"):
csv = True
if o in ("-u", "--url_path"):
......@@ -382,6 +388,53 @@ or you may need to specify --url_path.
d['_nomail'], d['_ack'], d['_notmetoo'],
d['_nodupes'], d['_digest'], d['_plain']), file=fp)
continue
if kv:
print('''%s:name=%s
%s:mod=%s
%s:hide=%s
%s:nomail=%s
%s:ack=%s
%s:notmetoo=%s
%s:nodups=%s
%s:digest=%s
%s:plain=%s
''' % (
email, d['_realname'],
email, d['_mod'],
email, d['_hide'],
email, d['_nomail'],
email, d['_ack'],
email, d['_notmetoo'],
email, d['_nodupes'],
email, d['_digest'],
email, d['_plain']), file=fp)
continue
if sympa:
reception = 'mail'
if d['_nomail'] != "off":
reception = 'nomail'
elif d['_digest'] == 'on':
if d['_plain'] == 'on':
reception = 'digestplain'
else:
reception = 'digest'
elif d['_notmetoo'] == 'on':
reception = 'not_me'
visibility = 'noconceal'
if d['_hide'] == 'on':
visibility = 'conceal'
print(u"""email %s
gecos %s
reception %s
subscribed 1
visibility %s
""" % (
email,
d['_realname'],
reception,
visibility
), file=fp)
continue
if nomail == 'enabled' and d['_nomail'] != "off":
continue
if nomail == 'any' and d['_nomail'] == "off":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment