Compare commits
6 Commits
ecbae3f79b
...
v2.0.15
Author | SHA1 | Date | |
---|---|---|---|
ed5b366341 | |||
9a520ddd9c | |||
2c43087d15 | |||
60ac1365a5 | |||
57027e234e | |||
887d5db635 |
10
.github/workflows/pypi-deploy.yml
vendored
10
.github/workflows/pypi-deploy.yml
vendored
@@ -40,16 +40,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: wheel-config
|
name: wheel-config
|
||||||
path: python/
|
path: python/
|
||||||
- name: Install iconv for Windows
|
|
||||||
if: matrix.os == 'windows-2019'
|
|
||||||
steps:
|
|
||||||
- name: Get vcpkg repo
|
|
||||||
run: git clone https://github.com/Microsoft/vcpkg.git
|
|
||||||
- name: Install vcpkg
|
|
||||||
run: .\vcpkg\bootstrap-vcpkg.bat
|
|
||||||
working-directory: vcpkg/
|
|
||||||
- name: Install required package libiconv
|
|
||||||
run: vcpkg install libiconv
|
|
||||||
- name: Build wheels
|
- name: Build wheels
|
||||||
run: python -m cibuildwheel --output-dir wheelhouse
|
run: python -m cibuildwheel --output-dir wheelhouse
|
||||||
working-directory: python/
|
working-directory: python/
|
||||||
|
@@ -233,3 +233,6 @@ can be found in the `python/examples` folder.
|
|||||||
- https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
- https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||||
- https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
|
- https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
|
||||||
- https://cibuildwheel.readthedocs.io/en/stable/deliver-to-pypi/
|
- https://cibuildwheel.readthedocs.io/en/stable/deliver-to-pypi/
|
||||||
|
- https://www.gnu.org/software/libiconv/
|
||||||
|
- https://vcpkg.io/en/packages.html
|
||||||
|
- https://vcpkg.io/en/getting-started
|
||||||
|
@@ -10,7 +10,9 @@
|
|||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#if defined(__linux__) || defined(__APPLE__)
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
//---------------------------------------------------------------------------//
|
//---------------------------------------------------------------------------//
|
||||||
|
|
||||||
@@ -144,6 +146,7 @@ namespace imc
|
|||||||
return sumstr;
|
return sumstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__linux__) || defined(__APPLE__)
|
||||||
// convert encoding of any descriptions, channel-names, units etc.
|
// convert encoding of any descriptions, channel-names, units etc.
|
||||||
class iconverter
|
class iconverter
|
||||||
{
|
{
|
||||||
@@ -215,6 +218,14 @@ namespace imc
|
|||||||
astring = outstring;
|
astring = outstring;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
#elif defined(__WIN32__) || defined(_WIN32)
|
||||||
|
class iconverter
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
iconverter(std::string in_enc, std::string out_enc, size_t out_buffer_size = 1024) {}
|
||||||
|
void convert(std::string &astring) {}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
// channel
|
// channel
|
||||||
struct channel
|
struct channel
|
||||||
|
@@ -5,6 +5,16 @@ from IMCtermite cimport cppimctermite
|
|||||||
|
|
||||||
import json as jn
|
import json as jn
|
||||||
import decimal
|
import decimal
|
||||||
|
import platform
|
||||||
|
|
||||||
|
# auxiliary function for codepage conversion
|
||||||
|
def get_codepage(chn) :
|
||||||
|
if platform == 'Windows' :
|
||||||
|
chndec = jn.loads(chn.decode(errors="ignore"))
|
||||||
|
chncdp = chndec["codepage"]
|
||||||
|
return 'utf-8' if chncdp is None else chncdp
|
||||||
|
else :
|
||||||
|
return 'utf-8'
|
||||||
|
|
||||||
cdef class imctermite:
|
cdef class imctermite:
|
||||||
|
|
||||||
@@ -22,7 +32,7 @@ cdef class imctermite:
|
|||||||
# get JSON list of channels
|
# get JSON list of channels
|
||||||
def get_channels(self, bool include_data):
|
def get_channels(self, bool include_data):
|
||||||
chnlst = self.cppimc.get_channels(True,include_data)
|
chnlst = self.cppimc.get_channels(True,include_data)
|
||||||
chnlstjn = [jn.loads(chn.decode(errors="ignore")) for chn in chnlst]
|
chnlstjn = [jn.loads(chn.decode(get_codepage(chn),errors="ignore")) for chn in chnlst]
|
||||||
return chnlstjn
|
return chnlstjn
|
||||||
|
|
||||||
# print single channel/all channels
|
# print single channel/all channels
|
||||||
|
@@ -1 +1 @@
|
|||||||
2.0.9
|
2.0.15
|
||||||
|
Reference in New Issue
Block a user