| 15 | namespace build_style |
| 16 | { |
| 17 | QString GetStyleStatistics(QString const & mapcssMappingFile, QString const & drulesFile) |
| 18 | { |
| 19 | if (!QFile(mapcssMappingFile).exists()) |
| 20 | throw std::runtime_error("mapcss-mapping file does not exist at " + mapcssMappingFile.toStdString()); |
| 21 | |
| 22 | if (!QFile(drulesFile).exists()) |
| 23 | throw std::runtime_error("drawing-rules file does not exist at " + drulesFile.toStdString()); |
| 24 | |
| 25 | // Add path to the protobuf EGG in the PROTOBUF_EGG_PATH environment variable. |
| 26 | QProcessEnvironment env{QProcessEnvironment::systemEnvironment()}; |
| 27 | env.insert("PROTOBUF_EGG_PATH", GetProtobufEggPath()); |
| 28 | |
| 29 | // Run the script. |
| 30 | #if defined(OMIM_OS_MAC) |
| 31 | return ExecProcess("python3", |
| 32 | { |
| 33 | GetExternalPath("drules_info.py", "kothic/src", "../tools/python/stylesheet"), |
| 34 | mapcssMappingFile, |
| 35 | drulesFile, |
| 36 | }, |
| 37 | &env); |
| 38 | #else |
| 39 | return ExecProcess("python", |
| 40 | { |
| 41 | GetExternalPath("drules_info.py", "kothic/src", "../tools/python/stylesheet"), |
| 42 | mapcssMappingFile, |
| 43 | drulesFile, |
| 44 | }, |
| 45 | &env); |
| 46 | #endif |
| 47 | } |
| 48 | |
| 49 | QString GetCurrentStyleStatistics() |
| 50 | { |
no test coverage detected