wowool-sdk-cpp 3.6.3__tar.gz → 3.6.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/PKG-INFO +1 -1
- wowool_sdk_cpp-3.6.4/sdk_version.txt +1 -0
- wowool_sdk_cpp-3.6.4/version.txt +1 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool/native/core/wowool_sdk.cpp +43 -43
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool_sdk_cpp.egg-info/PKG-INFO +1 -1
- wowool_sdk_cpp-3.6.3/sdk_version.txt +0 -1
- wowool_sdk_cpp-3.6.3/version.txt +0 -1
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/MANIFEST.in +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/common_setup.py +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/install_requires.txt +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/install_requires_wowool.txt +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/long_description.md +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/pre_setup.py +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/pyproject.toml +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/setup.cfg +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/setup.py +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool/package/lib/wowool_plugin.py +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool/package/lib/wowool_sdk.py +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool/plugin/wowool_plugin.cpp +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool/plugin/wowool_plugin.hpp +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool_sdk_cpp.egg-info/SOURCES.txt +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool_sdk_cpp.egg-info/dependency_links.txt +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool_sdk_cpp.egg-info/not-zip-safe +0 -0
- {wowool_sdk_cpp-3.6.3 → wowool_sdk_cpp-3.6.4}/wowool_sdk_cpp.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.3.1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.6.4
|
|
@@ -38,15 +38,13 @@ namespace py = pybind11;
|
|
|
38
38
|
std::mutex global_python_mutex;
|
|
39
39
|
#define PYTHON_LOCK std::lock_guard<std::mutex> guard(global_python_mutex);
|
|
40
40
|
|
|
41
|
-
bool get_environment_bool(std::string const &env_id, bool default_value)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
return default_value;
|
|
41
|
+
bool get_environment_bool(std::string const &env_id, bool default_value) {
|
|
42
|
+
char const *value_ptr = std::getenv(env_id.c_str());
|
|
43
|
+
if (value_ptr) {
|
|
44
|
+
std::string value(value_ptr);
|
|
45
|
+
return value == "true" || value == "True";
|
|
46
|
+
}
|
|
47
|
+
return default_value;
|
|
50
48
|
}
|
|
51
49
|
|
|
52
50
|
bool lock_gil = get_environment_bool("WOWOOL_LOCK_GIL", false);
|
|
@@ -119,6 +117,18 @@ wowool::common::Options convert_py_2_api_options(py::dict const &kwargs) {
|
|
|
119
117
|
return options;
|
|
120
118
|
}
|
|
121
119
|
|
|
120
|
+
py::object resolve_license_key_provider(py::dict &kwargs) {
|
|
121
|
+
py::object license_key = py::none();
|
|
122
|
+
if (kwargs.contains("license_key_provider")) {
|
|
123
|
+
py::module pysdk =
|
|
124
|
+
py::module::import("wowool.native.core.lic_key_provider");
|
|
125
|
+
auto decode_license_key_provider =
|
|
126
|
+
pysdk.attr("decode_license_key_provider");
|
|
127
|
+
license_key = decode_license_key_provider(kwargs["license_key_provider"]);
|
|
128
|
+
}
|
|
129
|
+
return license_key; // py::object
|
|
130
|
+
}
|
|
131
|
+
|
|
122
132
|
std::string convert_filterset(wowool::filter::Filter const &filterset) {
|
|
123
133
|
return filterset.info();
|
|
124
134
|
}
|
|
@@ -160,26 +170,10 @@ public:
|
|
|
160
170
|
|
|
161
171
|
typedef wowool::engine::Engine type;
|
|
162
172
|
|
|
163
|
-
// using wowool::engine::Engine::Engine;
|
|
164
|
-
|
|
165
|
-
// engine_t(wowool::engine::Engine const &&base)
|
|
166
|
-
// : wowool::engine::Engine(std::move(base))
|
|
167
|
-
// {
|
|
168
|
-
// std::cout << "PLUGIN wowool::engine::Engine(wowool::engine::Engine const
|
|
169
|
-
// &&base)" << this << std::endl;
|
|
170
|
-
// }
|
|
171
|
-
|
|
172
|
-
// engine_t(wowool::engine::Engine const &&base, py::dict const &kwarg)
|
|
173
|
-
// : wowool::engine::Engine(tir::pywowool::convert_py_2_api_options(kwarg))
|
|
174
|
-
// {
|
|
175
|
-
// std::cout << "PLUGIN wowool::engine::Engine(wowool::engine::Engine const
|
|
176
|
-
// &&base, py::dict const &kwarg)" << this << std::endl;
|
|
177
|
-
// }
|
|
178
|
-
|
|
179
173
|
// we need this one to be able to create multi_process objects.
|
|
180
|
-
engine_t(py::dict const &
|
|
181
|
-
: wowool::engine::Engine(
|
|
182
|
-
|
|
174
|
+
engine_t(py::dict const &kwargs)
|
|
175
|
+
: wowool::engine::Engine(
|
|
176
|
+
tir::pywowool::convert_py_2_api_options(kwargs)) {}
|
|
183
177
|
};
|
|
184
178
|
|
|
185
179
|
class lid_t : public wowool::language_identifier::LanguageIdentifier {
|
|
@@ -191,14 +185,14 @@ public:
|
|
|
191
185
|
lid_t(wowool::language_identifier::LanguageIdentifier const &&base)
|
|
192
186
|
: wowool::language_identifier::LanguageIdentifier(std::move(base)) {}
|
|
193
187
|
|
|
194
|
-
lid_t(wowool::analyzer::Engine const &engine, py::dict const &
|
|
188
|
+
lid_t(wowool::analyzer::Engine const &engine, py::dict const &kwargs)
|
|
195
189
|
: wowool::language_identifier::LanguageIdentifier(
|
|
196
|
-
engine, tir::pywowool::convert_py_2_api_options(
|
|
190
|
+
engine, tir::pywowool::convert_py_2_api_options(kwargs)) {}
|
|
197
191
|
|
|
198
|
-
lid_t(py::dict const &
|
|
192
|
+
lid_t(py::dict const &kwargs)
|
|
199
193
|
: wowool::language_identifier::LanguageIdentifier(
|
|
200
194
|
tir::pywowool::get_default_engine(global_shared_engine_options),
|
|
201
|
-
tir::pywowool::convert_py_2_api_options(
|
|
195
|
+
tir::pywowool::convert_py_2_api_options(kwargs)) {}
|
|
202
196
|
};
|
|
203
197
|
|
|
204
198
|
class domain_t : public wowool::domain::Domain {
|
|
@@ -211,17 +205,17 @@ public:
|
|
|
211
205
|
: wowool::domain::Domain(std::move(base)) {}
|
|
212
206
|
|
|
213
207
|
domain_t(wowool::analyzer::Engine const &engine,
|
|
214
|
-
std::string const domain_descriptor, py::dict const &
|
|
215
|
-
: wowool::domain::Domain(
|
|
216
|
-
|
|
217
|
-
|
|
208
|
+
std::string const domain_descriptor, py::dict const &kwargs)
|
|
209
|
+
: wowool::domain::Domain(
|
|
210
|
+
engine, domain_descriptor,
|
|
211
|
+
tir::pywowool::convert_py_2_api_options(kwargs)) {}
|
|
218
212
|
|
|
219
213
|
// we need this one to be able to create multi_process objects.
|
|
220
|
-
domain_t(py::dict const &
|
|
214
|
+
domain_t(py::dict const &kwargs)
|
|
221
215
|
: wowool::domain::Domain(
|
|
222
216
|
tir::pywowool::get_default_engine(global_shared_engine_options),
|
|
223
|
-
|
|
224
|
-
tir::pywowool::convert_py_2_api_options(
|
|
217
|
+
kwargs["name"].cast<std::string>(),
|
|
218
|
+
tir::pywowool::convert_py_2_api_options(kwargs)) {}
|
|
225
219
|
|
|
226
220
|
// wowool::analyzer::Results process(wowool::analyzer::Results const document)
|
|
227
221
|
// {
|
|
@@ -280,10 +274,10 @@ public:
|
|
|
280
274
|
analyzer_t(wowool::analyzer::Analyzer const &&base)
|
|
281
275
|
: wowool::analyzer::Analyzer(std::move(base)) {}
|
|
282
276
|
|
|
283
|
-
analyzer_t(wowool::analyzer::Engine const &engine, py::dict const &
|
|
277
|
+
analyzer_t(wowool::analyzer::Engine const &engine, py::dict const &kwargs)
|
|
284
278
|
: wowool::analyzer::Analyzer(
|
|
285
|
-
engine, tir::pywowool::convert_py_2_api_options(
|
|
286
|
-
_kwargs(
|
|
279
|
+
engine, tir::pywowool::convert_py_2_api_options(kwargs)),
|
|
280
|
+
_kwargs(kwargs) {}
|
|
287
281
|
|
|
288
282
|
std::string
|
|
289
283
|
process_return_string(std::string const &document,
|
|
@@ -460,10 +454,16 @@ PYBIND11_MODULE(_wowool_sdk, m)
|
|
|
460
454
|
})
|
|
461
455
|
.def("__getstate__", [](wowool::engine::Engine const& self) {
|
|
462
456
|
py::dict kwargs = tir::pywowool::convert_options_2_py(self.options);
|
|
457
|
+
kwargs.attr("pop")("license_key", py::none());
|
|
463
458
|
return kwargs;
|
|
464
459
|
})
|
|
465
460
|
.def("__setstate__", [](py::object self, py::dict kwargs) {
|
|
466
|
-
|
|
461
|
+
auto license_key = tir::pywowool::resolve_license_key_provider(kwargs);
|
|
462
|
+
if (!license_key.is_none()) {
|
|
463
|
+
std::string value = py::str(license_key);
|
|
464
|
+
if (value.length() > 0)
|
|
465
|
+
kwargs["license_key"] = license_key;
|
|
466
|
+
}
|
|
467
467
|
auto& p = self.cast<tir::pywowool::engine_t&>();
|
|
468
468
|
new (&p) tir::pywowool::engine_t(kwargs);
|
|
469
469
|
})
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.3.0
|
wowool_sdk_cpp-3.6.3/version.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.6.3
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|