kkpyutil 1.33.5__tar.gz → 1.34.0__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.
- {kkpyutil-1.33.5 → kkpyutil-1.34.0}/PKG-INFO +1 -1
- {kkpyutil-1.33.5 → kkpyutil-1.34.0}/kkpyutil.py +14 -1
- {kkpyutil-1.33.5 → kkpyutil-1.34.0}/pyproject.toml +1 -1
- {kkpyutil-1.33.5 → kkpyutil-1.34.0}/LICENSE +0 -0
- {kkpyutil-1.33.5 → kkpyutil-1.34.0}/README.md +0 -0
- {kkpyutil-1.33.5 → kkpyutil-1.34.0}/kkpyutil_helper/windows/kkttssave.ps1 +0 -0
- {kkpyutil-1.33.5 → kkpyutil-1.34.0}/kkpyutil_helper/windows/kkttsspeak.ps1 +0 -0
|
@@ -1671,7 +1671,8 @@ def is_number_text(text):
|
|
|
1671
1671
|
"""
|
|
1672
1672
|
# Remove leading/trailing whitespace
|
|
1673
1673
|
text = text.strip()
|
|
1674
|
-
|
|
1674
|
+
if not text:
|
|
1675
|
+
return False
|
|
1675
1676
|
# Check for negative numbers
|
|
1676
1677
|
if text.startswith('-'):
|
|
1677
1678
|
text = text[1:]
|
|
@@ -2711,6 +2712,18 @@ def http_post(url, data: dict, encoding=TXT_CODEC):
|
|
|
2711
2712
|
return resp
|
|
2712
2713
|
|
|
2713
2714
|
|
|
2715
|
+
def lazy_download(local_file, url, file_open_mode='wb', logger=None):
|
|
2716
|
+
if osp.isfile(local_file):
|
|
2717
|
+
return local_file
|
|
2718
|
+
os.makedirs(osp.dirname(local_file), exist_ok=True)
|
|
2719
|
+
logger = logger or glogger
|
|
2720
|
+
with open(local_file, file_open_mode) as fp:
|
|
2721
|
+
with urllib.request.urlopen(url) as response:
|
|
2722
|
+
logger.info(f'Downloading: {url} => {local_file}')
|
|
2723
|
+
fp.write(response.read())
|
|
2724
|
+
return local_file
|
|
2725
|
+
|
|
2726
|
+
|
|
2714
2727
|
def get_environment():
|
|
2715
2728
|
return {
|
|
2716
2729
|
'os': platform.platform(),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|