Browse Source

allow the user to specify which domains to categorize by

George C. Privon 7 năm trước cách đây
mục cha
commit
c1302c9825
1 tập tin đã thay đổi với 8 bổ sung9 xóa
  1. 8 9
      email_stats.py

+ 8 - 9
email_stats.py

@@ -6,7 +6,7 @@
 # - Time vs date plots of emails
 # - Recipients domains as a function of time
 #
-# Copyright 2015-2017 George C. Privon
+# Copyright 2015-2018 George C. Privon
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -38,8 +38,11 @@ parser.add_argument('--title', '-t', default='',
                     action='store', help='Plot title root.')
 parser.add_argument('--sendercolors', '-s', default=False, action='store',
                     help='Comma separated list of search strings for the \
-                          sender field. Each will be displayed with a \
-                          different color.')
+sender field. Each will be displayed with a different color.')
+parser.add_argument('--domains', '-d', action='store',
+                    default='gmail,hotmail,aol,comcast,yahoo',
+                    help='Comma separated list of domains to use in \
+categorizing recipient domains.')
 args = parser.parse_args()
 
 pldata = {}
@@ -50,12 +53,8 @@ if args.sendercolors:
         pldata[item] = []
 pldata['unknown'] = []
 
-domains = ['gmail',
-           'hotmail',
-           'aol',
-           'comcast',
-           'yahoo',
-           'privon']
+domains = args.domains.split(',')
+
 senders = {}
 
 a = mailbox.mbox(args.mbox)