Skip to content

Commit

Permalink
Merge pull request #125 from JGreenlee/admin-emails
Browse files Browse the repository at this point in the history
Update admin emails, add `find_emails` script
  • Loading branch information
shankari authored Jan 8, 2025
2 parents fedc8a7 + ca8a090 commit bced481
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

.DS_Store
.vscode/settings.json
2 changes: 1 addition & 1 deletion configs/cortezebikes.nrel-op.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"start_month": "06",
"start_year": "2023",
"mode_studied": "e-bike",
"program_admin_contact": "Elijah Fenton: [email protected]. 4CORE office: 970-259-1916.",
"program_admin_contact": "4CORE office: 970-259-1916.",
"deployment_partner_name": "Four Corners Office for Resource Efficiency (4CORE)",
"translated_text": {
"en": {
Expand Down
2 changes: 1 addition & 1 deletion configs/ride2own.nrel-op.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"trip_end_notification": false
},
"admin_dashboard": {
"admin_access": ["[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]"],
"admin_access": ["[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]"],
"overview_users": true,
"overview_active_users": true,
"overview_trips": true,
Expand Down
2 changes: 1 addition & 1 deletion configs/usaid-laos-ev.nrel-op.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"trip_end_notification": false
},
"admin_dashboard": {
"admin_access": ["[email protected]", "[email protected]", "sebastian.barry@nrel.gov", "[email protected]", "Kosol.Kiatreungwattana@nrel.gov", "Dustin.Weigl@nrel.gov", "[email protected]", "[email protected]", "[email protected]"],
"admin_access": ["[email protected]", "[email protected]", "Jack.Greenlee@nrel.gov", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]"],
"overview_users": true,
"overview_active_users": true,
"overview_trips": true,
Expand Down
31 changes: 31 additions & 0 deletions scripts/find_emails.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# prints a comma-separated list of all email addresses found in the program configs

import os
import re

# get a list of all programs from the configs directory
programs = os.listdir('configs')

# or, specify programs manually:
# programs = [
# 'denver-casr.nrel-op.json',
# 'nrel-commute.nrel-op.json',
# 'open-access.nrel-op.json',
# 'ride2own.nrel-op.json',
# 'smart-commute-ebike.nrel-op.json',
# # ...
# ]

print('Checking %d programs for email addresses...\n' % len(programs))

emails = []
for program in programs:
with open('configs/'+program, 'r') as f:
emails_for_program = re.findall(r'[\w.+-]+@[\w-]+\.[\w.-]+', f.read())
emails_for_program = [e.rstrip(' .,') for e in emails_for_program]
print(program + ' has emails: ' + str(emails_for_program))
emails.extend(emails_for_program)

emails = list(set([e.lower() for e in emails]))
print('\nIn total, found ' + str(len(emails)) + ' emails:')
print(', '.join(emails))

0 comments on commit bced481

Please sign in to comment.