Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
400b6eaab9 | |||
6f4511e1c2 | |||
fe042b531f | |||
9d5f0cff01 | |||
720acd3b62 |
44
.github/workflows/pypi-deploy.yml
vendored
44
.github/workflows/pypi-deploy.yml
vendored
@@ -23,14 +23,13 @@ jobs:
|
||||
- name: Display files
|
||||
run: ls -lR
|
||||
|
||||
build_wheels:
|
||||
build_wheels_ubuntu:
|
||||
name: Build binary wheels on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: [build_setup]
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-24.04, windows-2022]
|
||||
arch: [auto32, auto64, aarch64]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -45,12 +44,37 @@ jobs:
|
||||
- name: Build wheels
|
||||
run: python -m cibuildwheel --output-dir wheelhouse
|
||||
working-directory: python/
|
||||
# env:
|
||||
# CIBW_BUILD: cp36-* cp37-* cp38-* cp39-* cp310-*
|
||||
- name: Store binary wheels
|
||||
uses: actions/upload-artifact@v4.6.0
|
||||
with:
|
||||
name: binary-wheels-${{matrix.os}}-${{matrix.arch}}
|
||||
name: binary-wheels-${{matrix.os}}-${{ strategy.job-index }}
|
||||
path: python/wheelhouse/*.whl
|
||||
|
||||
build_wheels_windows:
|
||||
name: Build binary wheels on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: [build_setup]
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
- name: Install cibuildwheel
|
||||
run: python -m pip install cibuildwheel==2.1.2
|
||||
- name: Get wheel configuration files
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
with:
|
||||
name: wheel-config
|
||||
path: python/
|
||||
- name: Build wheels
|
||||
run: python -m cibuildwheel --output-dir wheelhouse
|
||||
working-directory: python/
|
||||
- name: Store binary wheels
|
||||
uses: actions/upload-artifact@v4.6.0
|
||||
with:
|
||||
name: binary-wheels-${{matrix.os}}-${{ strategy.job-index }}
|
||||
path: python/wheelhouse/*.whl
|
||||
|
||||
build_sdist:
|
||||
@@ -79,20 +103,20 @@ jobs:
|
||||
|
||||
|
||||
upload_pypi:
|
||||
name: Upload binary wheels to PyPI
|
||||
name: Upload wheels to PyPI
|
||||
runs-on: ubuntu-24.04
|
||||
needs: [build_wheels, build_sdist]
|
||||
needs: [build_wheels_ubuntu, build_wheels_windows, build_sdist]
|
||||
|
||||
steps:
|
||||
- name: Get source wheels
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
with:
|
||||
name: source-wheels
|
||||
path: sdist/
|
||||
path: dist/
|
||||
- name: Get binary wheels
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
with:
|
||||
path: bdist/
|
||||
path: dist/
|
||||
pattern: binary-wheels-*
|
||||
merge-multiple: true
|
||||
- name: Display files
|
||||
|
@@ -314,10 +314,11 @@ namespace imc
|
||||
std::vector<unsigned char>* buffer_;
|
||||
|
||||
imc::origin_data NO_;
|
||||
|
||||
imc::language NL_;
|
||||
imc::text CT_;
|
||||
imc::groupobj CB_;
|
||||
imc::datafield CG_;
|
||||
imc::channelobj CN_;
|
||||
|
||||
// collect meta-data of channels according to env,
|
||||
// just everything valueable in here
|
||||
@@ -349,7 +350,7 @@ namespace imc
|
||||
double xoffset_, yoffset_;
|
||||
|
||||
// group reference the channel belongs to
|
||||
int group_index_;
|
||||
unsigned long int group_index_;
|
||||
std::string group_uuid_, group_name_, group_comment_;
|
||||
|
||||
// constructor takes channel's block environment
|
||||
@@ -362,6 +363,22 @@ namespace imc
|
||||
// use uuid from CN block
|
||||
uuid_ = chnenv_.CNuuid_;
|
||||
|
||||
// extract associated NO data
|
||||
if ( blocks_->count(chnenv_.NOuuid_) == 1 )
|
||||
{
|
||||
NO_.parse(buffer_, blocks_->at(chnenv_.NOuuid_).get_parameters());
|
||||
origin_ = NO_.generator_;
|
||||
comment_ = NO_.comment_;
|
||||
}
|
||||
|
||||
// extract associated NL data
|
||||
if ( blocks_->count(chnenv_.NLuuid_) == 1 )
|
||||
{
|
||||
NL_.parse(buffer_, blocks_->at(chnenv_.NLuuid_).get_parameters());
|
||||
codepage_ = NL_.codepage_;
|
||||
language_code_ = NL_.language_code_;
|
||||
}
|
||||
|
||||
// extract associated CB data
|
||||
if ( blocks_->count(chnenv_.CBuuid_) == 1 )
|
||||
{
|
||||
@@ -377,6 +394,15 @@ namespace imc
|
||||
+ CT_.comment_;
|
||||
}
|
||||
|
||||
// extract associated CN data
|
||||
if ( blocks_->count(chnenv_.CNuuid_) == 1 )
|
||||
{
|
||||
CN_.parse(buffer_, blocks_->at(chnenv_.CNuuid_).get_parameters());
|
||||
group_index_ = CN_.group_index_;
|
||||
group_name_ = CN_.name_;
|
||||
group_comment_ = CN_.comment_;
|
||||
}
|
||||
|
||||
if ( !chnenv_.compenv1_.uuid_.empty() && chnenv_.compenv2_.uuid_.empty() )
|
||||
{
|
||||
// normal dataset (single component)
|
||||
@@ -451,8 +477,9 @@ namespace imc
|
||||
// start converting binary buffer to imc::datatype
|
||||
if ( !chnenv_.CSuuid_.empty() ) convert_buffer();
|
||||
|
||||
// convert any non-UTF-8 codepage to UTF-8
|
||||
// convert any non-UTF-8 codepage to UTF-8 and cleanse any text
|
||||
convert_encoding();
|
||||
cleanse_text();
|
||||
}
|
||||
|
||||
// convert buffer to actual datatype
|
||||
@@ -602,6 +629,35 @@ namespace imc
|
||||
}
|
||||
}
|
||||
|
||||
void cleanse_text()
|
||||
{
|
||||
escape_backslash(name_);
|
||||
escape_backslash(comment_);
|
||||
escape_backslash(origin_);
|
||||
escape_backslash(origin_comment_);
|
||||
escape_backslash(text_);
|
||||
escape_backslash(language_code_);
|
||||
escape_backslash(yname_);
|
||||
escape_backslash(yunit_);
|
||||
escape_backslash(xname_);
|
||||
escape_backslash(xunit_);
|
||||
escape_backslash(group_name_);
|
||||
escape_backslash(group_comment_);
|
||||
}
|
||||
|
||||
void escape_backslash(std::string &text)
|
||||
{
|
||||
char backslash = 0x5c;
|
||||
std::string doublebackslash("\\\\");
|
||||
for ( std::string::iterator it = text.begin(); it != text.end(); ++it )
|
||||
{
|
||||
if ( int(*it) == backslash ) {
|
||||
text.replace(it,it+1,doublebackslash);
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get info string
|
||||
std::string get_info(int width = 20)
|
||||
{
|
||||
|
@@ -1 +1 @@
|
||||
2.1.11
|
||||
2.1.16
|
||||
|
Reference in New Issue
Block a user