| 869 | } |
| 870 | |
| 871 | PyObject* ApplicationPy::sGetExportType(PyObject* /*self*/, PyObject* args) |
| 872 | { |
| 873 | char* psKey = nullptr; |
| 874 | |
| 875 | if (!PyArg_ParseTuple(args, "|s", &psKey)) { |
| 876 | return nullptr; |
| 877 | } |
| 878 | |
| 879 | if (psKey) { |
| 880 | Py::List list; |
| 881 | std::vector<std::string> modules = GetApplication().getExportModules(psKey); |
| 882 | for (const auto& it : modules) { |
| 883 | list.append(Py::String(it)); |
| 884 | } |
| 885 | |
| 886 | return Py::new_reference_to(list); |
| 887 | } |
| 888 | |
| 889 | Py::Dict dict; |
| 890 | std::vector<std::string> types = GetApplication().getExportTypes(); |
| 891 | for (const auto& it : types) { |
| 892 | std::vector<std::string> modules = GetApplication().getExportModules(it.c_str()); |
| 893 | if (modules.empty()) { |
| 894 | dict.setItem(it.c_str(), Py::None()); |
| 895 | } |
| 896 | else if (modules.size() == 1) { |
| 897 | dict.setItem(it.c_str(), Py::String(modules.front())); |
| 898 | } |
| 899 | else { |
| 900 | Py::List list; |
| 901 | for (const auto& jt : modules) { |
| 902 | list.append(Py::String(jt)); |
| 903 | } |
| 904 | dict.setItem(it.c_str(), list); |
| 905 | } |
| 906 | } |
| 907 | |
| 908 | return Py::new_reference_to(dict); |
| 909 | } |
| 910 | |
| 911 | PyObject* ApplicationPy::sGetResourcePath(PyObject* /*self*/, PyObject* args) |
| 912 | { |
nothing calls this directly
no test coverage detected