|
26 | 26 | # Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/ |
27 | 27 | # Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic |
28 | 28 | # changes) |
29 | | -SERVER_VERSION = "1.3.57" |
| 29 | +SERVER_VERSION = "1.3.58" |
30 | 30 |
|
31 | 31 | OLD_VERSION = '2.15.0' |
32 | 32 |
|
@@ -128,6 +128,8 @@ def overviewReport() -> str: |
128 | 128 | html += '<a href="head-DacaWrongData">DacaWrongData</a><br>\n' |
129 | 129 | html += '<a href="head-dacaWrongSplitTemplateRightAngleBrackets">dacaWrongSplitTemplateRightAngleBrackets</a><br>\n' |
130 | 130 | html += '<br>\n' |
| 131 | + html += '<a href="clients.html">clients</a><br>\n' |
| 132 | + html += '<br>\n' |
131 | 133 | html += 'version ' + SERVER_VERSION + '\n' |
132 | 134 | html += '</body></html>' |
133 | 135 | return html |
@@ -1070,6 +1072,79 @@ def check_library_function_name(result_path: str, function_name: str, query_para |
1070 | 1072 | return ''.join(output_lines_list) |
1071 | 1073 |
|
1072 | 1074 |
|
| 1075 | +def clientsReport(results_path: str): |
| 1076 | + html = '<!DOCTYPE html>\n' |
| 1077 | + html += '<html><head><title>Clients report</title></head><body>\n' |
| 1078 | + html += '<h1>Clients report</h1>\n' |
| 1079 | + current_year = datetime.date.today().year |
| 1080 | + # TODO: use full profiles? |
| 1081 | + # TODO: add jobs |
| 1082 | + platforms = {} |
| 1083 | + py_versions = {} |
| 1084 | + client_versions = {} |
| 1085 | + compilers = {} |
| 1086 | + for filename in sorted(glob.glob(os.path.expanduser(results_path + '/*'))): |
| 1087 | + if not os.path.isfile(filename) or filename.endswith('.diff'): |
| 1088 | + continue |
| 1089 | + with open(filename, 'rt') as file_: |
| 1090 | + datestr = None |
| 1091 | + platform = None |
| 1092 | + py_version = None |
| 1093 | + client_version = None |
| 1094 | + compiler = None |
| 1095 | + for line in file_: |
| 1096 | + line = line.strip() |
| 1097 | + if line.startswith('cppcheck: '): |
| 1098 | + if OLD_VERSION not in line: |
| 1099 | + # Package results seem to be too old, skip |
| 1100 | + break |
| 1101 | + if not datestr: |
| 1102 | + break |
| 1103 | + |
| 1104 | + dt = dateTimeFromStr(datestr) |
| 1105 | + |
| 1106 | + if platform and not platform in platforms or dt < dateTimeFromStr(platforms[platform]): |
| 1107 | + platforms[platform] = datestr |
| 1108 | + if py_version and not py_version in py_versions or dt < dateTimeFromStr(py_versions[py_version]): |
| 1109 | + py_versions[py_version] = datestr |
| 1110 | + if client_version and not client_version in client_versions or dt < dateTimeFromStr(client_versions[client_version]): |
| 1111 | + client_versions[client_version] = datestr |
| 1112 | + if compiler and not compiler in compilers or dt < dateTimeFromStr(compilers[compiler]): |
| 1113 | + compilers[compiler] = datestr |
| 1114 | + break # stop processing |
| 1115 | + |
| 1116 | + if datestr is None and line.startswith(str(current_year) + '-') or line.startswith(str(current_year - 1) + '-'): |
| 1117 | + datestr = line |
| 1118 | + elif line.startswith('platform:'): |
| 1119 | + platform = line.split(' ', 1)[1] |
| 1120 | + elif line.startswith('python:'): |
| 1121 | + py_version = line.split(' ',1 )[1] |
| 1122 | + elif line.startswith('client-version:'): |
| 1123 | + client_version = line.split(' ', 1)[1] |
| 1124 | + elif line.startswith('compiler:'): |
| 1125 | + compiler = line.split(' ', 1)[1] |
| 1126 | + |
| 1127 | + html += '<pre>\n' |
| 1128 | + html += 'Client versions:\n' |
| 1129 | + for clv in client_versions: |
| 1130 | + html += clv + ' - ' + client_versions[clv] + '\n' |
| 1131 | + html += '\n' |
| 1132 | + html += 'Python versions:\n' |
| 1133 | + for pyv in py_versions: |
| 1134 | + html += pyv + ' - ' + py_versions[pyv] + '\n' |
| 1135 | + html += '\n' |
| 1136 | + html += 'Platforms:\n' |
| 1137 | + for pl in platforms: |
| 1138 | + html += pl + ' - ' + platforms[pl] + '\n' |
| 1139 | + html += '\n' |
| 1140 | + html += 'Compilers:\n' |
| 1141 | + for cmp in compilers: |
| 1142 | + html += cmp + ' - ' + compilers[cmp] + '\n' |
| 1143 | + html += '</pre>\n' |
| 1144 | + html += '</body></html>\n' |
| 1145 | + return html |
| 1146 | + |
| 1147 | + |
1073 | 1148 | def sendAll(connection: socket.socket, text: str) -> None: |
1074 | 1149 | data = text.encode('utf-8', 'ignore') |
1075 | 1150 | while data: |
@@ -1203,6 +1278,9 @@ def run(self): |
1203 | 1278 | var_name = url[len('/unknown_macro-'):] |
1204 | 1279 | text = check_library_function_name(self.resultPath, var_name, queryParams, nonfunc_id='unknownMacro') |
1205 | 1280 | httpGetResponse(self.connection, text, 'text/plain') |
| 1281 | + elif url.startswith('/clients.html'): |
| 1282 | + text = clientsReport(self.resultPath) |
| 1283 | + httpGetResponse(self.connection, text, 'text/html') |
1206 | 1284 | else: |
1207 | 1285 | filename = self.resultPath + url |
1208 | 1286 | if not os.path.isfile(filename): |
|
0 commit comments