-
Notifications
You must be signed in to change notification settings - Fork 4
/
infra.py
41 lines (34 loc) · 1.03 KB
/
infra.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# -*- coding: utf-8 -*-
# !/usr/bin/env python
#
import glob
import os
import re
import sys
services = ['Home', 'keyboard', 'converter', 'convertUI', 'downloads', 'encodingRules',
'diacritic', 'wordsearch', 'calendar'
]
pyFiles = glob.glob('*.py')
print(pyFiles)
for f in pyFiles:
print(f)
i = 0 # line
with open(f) as f:
lines = f.readlines()
for line in lines:
match = re.match(r'Language = \W+(\w+)\W+', line)
if match:
print('match" %s' % match.groups())
if re.search('Language =', line):
langName = line
print(langName)
if re.search('LanguageCode =', line):
langCode = line
print(langCode)
pattern = 'Handler'
pattern = "\('/"
# Find line with "WSGIApplication"
if re.search(pattern, line):
print('%d: %s' % (i, line))
i += 1
# TODO: record the handlers for each