From 1c2497c7d0a2d9d5f58ea1d872bde496f048ffd6 Mon Sep 17 00:00:00 2001 From: MichaƂ Klichowicz Date: Fri, 6 Oct 2023 02:54:56 +0200 Subject: Ability to force PBN encoding --- .version | 8 ++++---- README.md | 2 +- src/main.py | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.version b/.version index 54f6eb9..0a178b2 100644 --- a/.version +++ b/.version @@ -1,8 +1,8 @@ # UTF-8 VSVersionInfo( ffi=FixedFileInfo( - filevers=(0, 3, 0, 0), - prodvers=(0, 3, 0, 0), + filevers=(0, 3, 1, 0), + prodvers=(0, 3, 1, 0), # Contains a bitmask that specifies the valid bits 'flags' mask=0x3f, # Contains a bitmask that specifies the Boolean attributes of the file. @@ -26,10 +26,10 @@ VSVersionInfo( u'040904b0', # 0x0409(1033)= English, 0x04b0(1200)= UTF-8 [StringStruct(u'CompanyName', u'emkael.info'), StringStruct(u'ProductName', u'teamy_mojzesz'), - StringStruct(u'ProductVersion', u'0, 3, 0, 0'), + StringStruct(u'ProductVersion', u'0, 3, 1, 0'), StringStruct(u'InternalName', u'teamy_mojzesz'), StringStruct(u'OriginalFilename', u'mojzesz.exe'), - StringStruct(u'FileVersion', u'0, 3, 0, 0'), + StringStruct(u'FileVersion', u'0, 3, 1, 0'), StringStruct( u'FileDescription', u'LoveBridge tablet PBN import to JFR Teamy events'), diff --git a/README.md b/README.md index 1160e8b..7d6dd38 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Two main data sources are required to run the script: * a PBN file accessible via HTTP(S) * a `mojzesz.json` config file in the current (working) directory -Sample config file is provided in the repo. `mysql` and `source` sections should be self-explanatory (`auth` section is not required if PBN is not behind HTTP Auth, and `headers` section is just explicitly forwarded to the HTTP(S) request headers). +Sample config file is provided in the repo. `mysql` and `source` sections should be self-explanatory (`auth` section is not required if PBN is not behind HTTP Auth, and `headers` section is just explicitly forwarded to the HTTP(S) request headers, and `encoding` is optional, to force PBN encoding, defaulting to utf8). As for `settings` section: diff --git a/src/main.py b/src/main.py index 11ad472..8953571 100644 --- a/src/main.py +++ b/src/main.py @@ -39,6 +39,7 @@ def get_pbn_source(config): r = requests.get(config['url'], auth=request_auth, headers=request_headers) r.raise_for_status() + r.encoding = config.get('encoding', 'utf8') remote_content = r.text logging.info('Fetched %d bytes', len(remote_content)) -- cgit v1.2.3