TSVZ 3.26__tar.gz → 3.27__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.
- {tsvz-3.26 → tsvz-3.27}/PKG-INFO +1 -1
- {tsvz-3.26 → tsvz-3.27}/TSVZ.egg-info/PKG-INFO +1 -1
- {tsvz-3.26 → tsvz-3.27}/TSVZ.py +17 -15
- {tsvz-3.26 → tsvz-3.27}/README.md +0 -0
- {tsvz-3.26 → tsvz-3.27}/TSVZ.egg-info/SOURCES.txt +0 -0
- {tsvz-3.26 → tsvz-3.27}/TSVZ.egg-info/dependency_links.txt +0 -0
- {tsvz-3.26 → tsvz-3.27}/TSVZ.egg-info/entry_points.txt +0 -0
- {tsvz-3.26 → tsvz-3.27}/TSVZ.egg-info/top_level.txt +0 -0
- {tsvz-3.26 → tsvz-3.27}/setup.cfg +0 -0
- {tsvz-3.26 → tsvz-3.27}/setup.py +0 -0
{tsvz-3.26 → tsvz-3.27}/PKG-INFO
RENAMED
{tsvz-3.26 → tsvz-3.27}/TSVZ.py
RENAMED
|
@@ -22,10 +22,10 @@ if os.name == 'nt':
|
|
|
22
22
|
elif os.name == 'posix':
|
|
23
23
|
import fcntl
|
|
24
24
|
|
|
25
|
-
version = '3.
|
|
25
|
+
version = '3.27'
|
|
26
26
|
__version__ = version
|
|
27
27
|
author = 'pan@zopyr.us'
|
|
28
|
-
COMMIT_DATE = '2025-
|
|
28
|
+
COMMIT_DATE = '2025-06-25'
|
|
29
29
|
|
|
30
30
|
DEFAULT_DELIMITER = '\t'
|
|
31
31
|
DEFAULTS_INDICATOR_KEY = '#_defaults_#'
|
|
@@ -736,20 +736,22 @@ def appendLinesTabularFile(fileName,linesToAppend,teeLogger = None,header = '',c
|
|
|
736
736
|
if verbose:
|
|
737
737
|
__teePrintOrNot(f"No lines to append to {fileName}",teeLogger=teeLogger)
|
|
738
738
|
return
|
|
739
|
+
correctColumnNum = max([len(line) for line in formatedLines])
|
|
740
|
+
|
|
741
|
+
if header.rstrip() and verifyHeader:
|
|
742
|
+
with openFileAsCompressed(fileName, mode ='rb',encoding=encoding,teeLogger=teeLogger)as file:
|
|
743
|
+
line = file.readline().decode(encoding=encoding,errors='replace')
|
|
744
|
+
if _lineContainHeader(header,line,verbose = verbose,teeLogger = teeLogger,strict = strict):
|
|
745
|
+
correctColumnNum = len(header.split(delimiter))
|
|
746
|
+
if verbose:
|
|
747
|
+
__teePrintOrNot(f"correctColumnNum: {correctColumnNum}",teeLogger=teeLogger)
|
|
748
|
+
# truncate / fill the lines to the correct number of columns
|
|
749
|
+
for i in range(len(formatedLines)):
|
|
750
|
+
if len(formatedLines[i]) < correctColumnNum:
|
|
751
|
+
formatedLines[i] += ['']*(correctColumnNum-len(formatedLines[i]))
|
|
752
|
+
elif len(formatedLines[i]) > correctColumnNum:
|
|
753
|
+
formatedLines[i] = formatedLines[i][:correctColumnNum]
|
|
739
754
|
with openFileAsCompressed(fileName, mode ='ab',encoding=encoding,teeLogger=teeLogger)as file:
|
|
740
|
-
correctColumnNum = max([len(line) for line in formatedLines])
|
|
741
|
-
if header.rstrip() and verifyHeader:
|
|
742
|
-
line = file.readline().decode(encoding=encoding,errors='replace')
|
|
743
|
-
if _lineContainHeader(header,line,verbose = verbose,teeLogger = teeLogger,strict = strict):
|
|
744
|
-
correctColumnNum = len(header.split(delimiter))
|
|
745
|
-
if verbose:
|
|
746
|
-
__teePrintOrNot(f"correctColumnNum: {correctColumnNum}",teeLogger=teeLogger)
|
|
747
|
-
# truncate / fill the lines to the correct number of columns
|
|
748
|
-
for i in range(len(formatedLines)):
|
|
749
|
-
if len(formatedLines[i]) < correctColumnNum:
|
|
750
|
-
formatedLines[i] += ['']*(correctColumnNum-len(formatedLines[i]))
|
|
751
|
-
elif len(formatedLines[i]) > correctColumnNum:
|
|
752
|
-
formatedLines[i] = formatedLines[i][:correctColumnNum]
|
|
753
755
|
# check if the file ends in a newline
|
|
754
756
|
# file.seek(-1, os.SEEK_END)
|
|
755
757
|
# if file.read(1) != b'\n':
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tsvz-3.26 → tsvz-3.27}/setup.py
RENAMED
|
File without changes
|