• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import csv
2import hashlib
3import sys
4
5
6DISPLAY_TO_CANONICAL_TECH_AREA = {
7    "bluetooth": "Bluetooth",
8    "audio": "Audio",
9    "surfaceflinger": "SurfaceFlinger",
10    "vold": "Vold",
11    "telephony": "Telephony",
12    "wifi": "WiFi",
13    "sepolicy": "SEPolicy",
14    "contacts": "Contacts",
15    "clock": "Clock",
16    "networking": "Networking",
17    "settings": "Settings",
18    "build": "Build",
19    "camera": "Camera",
20    "video": "Video",
21    "email": "EMail",
22    "systemui": "SystemUI",
23    "nfc": "NFC",
24    "music app": "MusicApp",
25    "unknown": "Unknown",
26}
27
28
29def print_to_golang_code(fname):
30  with open(fname, "rb") as csv_file:
31    reader = csv.reader(csv_file, skipinitialspace=True, delimiter=",", quoting=csv.QUOTE_NONE)
32    for row in list(reader)[1:]:
33      email_address, tech_area = row
34      print "\"%s\":" % hashlib.sha256(email_address).hexdigest(),
35      print "%s," % DISPLAY_TO_CANONICAL_TECH_AREA[tech_area.lower()]
36
37
38if __name__ == "__main__":
39  csv_file = sys.argv[1]
40  print_to_golang_code(csv_file)
41