on xenial help sign in
rename variables
59f23fdAndrea Cimitan
tests/imports/check_imports.py+5−5
@@ -89,7 +89,7 @@ flickable_pats = [flickable_pat, listview_pat, gridview_pat]
89unity_components_pat = re.compile(r'.*import ".*Components"')
89unity_components_pat = re.compile(r'.*import ".*Components"')
90components_path = re.compile(r'.*qml/Components.*')
90components_path = re.compile(r'.*qml/Components.*')
91
91
92−def scan_for_flickable_imports(file_path, component_pats, qtquick_pat, uitk_pat):
92+def scan_for_flickable_imports(file_path, component_pats, qtquick_pat, unitycomponents_pat):
93 errors = []
93 errors = []
94 with open(file_path, 'rt', encoding='utf-8') as ifile, open(file_path, 'rt', encoding='utf-8') as i2file:
94 with open(file_path, 'rt', encoding='utf-8') as ifile, open(file_path, 'rt', encoding='utf-8') as i2file:
95 flickable_found = False
95 flickable_found = False
@@ -99,17 +99,17 @@ def scan_for_flickable_imports(file_path, component_pats, qtquick_pat, uitk_pat)
99 flickable_found = True
99 flickable_found = True
100 if flickable_found:
100 if flickable_found:
101 qtquick_found = False
101 qtquick_found = False
102− uitk_found = False
102+ unitycomponents_found = False
103 for lino, line in enumerate(i2file, start=1):
103 for lino, line in enumerate(i2file, start=1):
104 if not qtquick_found and qtquick_pat.match(line):
104 if not qtquick_found and qtquick_pat.match(line):
105 qtquick_found = True
105 qtquick_found = True
106− if uitk_pat.match(line):
106+ if unitycomponents_pat.match(line):
107− uitk_found = True
107+ unitycomponents_found = True
108 if not qtquick_found:
108 if not qtquick_found:
109 errors.append(lino)
109 errors.append(lino)
110 else:
110 else:
111 return
111 return
112− if not uitk_found:
112+ if not unitycomponents_found:
113 errors.append(lino)
113 errors.append(lino)
114 if 0 < len(errors) <= 10:
114 if 0 < len(errors) <= 10:
115 if len(errors) > 1:
115 if len(errors) > 1: