|
37 | 37 | $source_url = strtolower($source_url);
|
38 | 38 |
|
39 | 39 | if( preg_match(",^https://kbdlayout.info/kbd([a-zA-Z0-9_-]+)$,", $source_url, $m) ) {
|
40 |
| - $filepath_xml = "data/kbdlaytout-info-" . $m[1] . ".xml"; |
| 40 | + $filepath_xml = "data/kbdlayout-info-" . $m[1] . ".xml"; |
41 | 41 | $fileurl = $source_url . "/download/xml";
|
42 | 42 |
|
43 | 43 | if( $lang == "") {
|
|
57 | 57 | } else {
|
58 | 58 | # other platforms or sources
|
59 | 59 | header("HTTP/1.1 500 Internal Server Error");
|
60 |
| - print("The source could not be interpreted, or is not supported, check the spelling."); |
| 60 | + print("<pre>The source could not be interpreted, or is not supported, check the spelling.\n".htmlentities($source_url)."</pre>"); |
61 | 61 | exit(0);
|
62 | 62 | }
|
63 | 63 |
|
64 | 64 | $layout_out = array();
|
65 |
| -exec("python3 -m generator -k ".$filepath_xml." -v layout", $layout_out, $result_code); |
| 65 | +$layout_command = "python3 -m generator --keyboard ".$filepath_xml." -v layout"; |
| 66 | +exec($layout_command, $layout_out, $result_code); |
66 | 67 | $layout = join("\n", $layout_out);
|
67 | 68 | if($result_code != 0) { $ERRORS[] = "Error Layout\n"; }
|
68 | 69 |
|
69 | 70 | $layout = preg_replace("/".preg_quote($VERSION0)."/", $VERSION, $layout);
|
70 | 71 |
|
71 | 72 | $keycodes_out = array();
|
72 |
| -exec("python3 -m generator -k ".$filepath_xml." -v keycode", $keycodes_out, $result_code); |
| 73 | +$keycodes_command = "python3 -m generator --keyboard ".$filepath_xml." -v keycode"; |
| 74 | +exec($keycodes_command, $keycodes_out, $result_code); |
73 | 75 | $keycodes = join("\n", $keycodes_out);
|
74 | 76 | if($result_code != 0) { $ERRORS[] = "Error Keycodes\n"; }
|
75 | 77 |
|
| 78 | +# $ERRORS[] = $layout_command; |
| 79 | +# $ERRORS[] = $keycodes_command; |
| 80 | + |
76 | 81 | $keycodes = preg_replace("/".preg_quote($VERSION0)."/", $VERSION, $keycodes);
|
77 | 82 |
|
78 | 83 | if( !file_exists("src/keyboard_layout6.mpy") ) {
|
@@ -173,7 +178,12 @@ function make_zip($layout, $keycodes, $cpversion, $platform, $lang) {
|
173 | 178 |
|
174 | 179 | if( count($ERRORS) > 0 ) {
|
175 | 180 | header("HTTP/1.1 500 Internal Server Error");
|
176 |
| - print("The source could not be interpreted, or is not supported, check the spelling."); |
| 181 | + print("<pre>\n"); |
| 182 | + print("The source could not be interpreted, or is not supported, check the spelling.\n"); |
| 183 | + print(htmlentities($source_url)."\n"); |
| 184 | + print(htmlentities($filepath_xml)."\n"); |
| 185 | + print(join("\n", $ERRORS)); |
| 186 | + print("\n</pre>"); |
177 | 187 | } else {
|
178 | 188 | make_zip($layout, $keycodes, $cpversion, $platform, $lang);
|
179 | 189 | }
|
0 commit comments