TSVZ 3.28__tar.gz → 3.29__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.28 → tsvz-3.29}/PKG-INFO +1 -1
- {tsvz-3.28 → tsvz-3.29}/README.md +0 -0
- {tsvz-3.28 → tsvz-3.29}/TSVZ.egg-info/PKG-INFO +1 -1
- {tsvz-3.28 → tsvz-3.29}/TSVZ.egg-info/SOURCES.txt +0 -0
- {tsvz-3.28 → tsvz-3.29}/TSVZ.egg-info/dependency_links.txt +0 -0
- {tsvz-3.28 → tsvz-3.29}/TSVZ.egg-info/entry_points.txt +0 -0
- {tsvz-3.28 → tsvz-3.29}/TSVZ.egg-info/top_level.txt +0 -0
- {tsvz-3.28 → tsvz-3.29}/TSVZ.py +28 -5
- {tsvz-3.28 → tsvz-3.29}/setup.py +0 -0
- {tsvz-3.28 → tsvz-3.29}/setup.cfg +0 -0
{tsvz-3.28 → tsvz-3.29}/PKG-INFO
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tsvz-3.28 → tsvz-3.29}/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.29'
|
|
26
26
|
__version__ = version
|
|
27
27
|
author = 'pan@zopyr.us'
|
|
28
|
-
COMMIT_DATE = '2025-
|
|
28
|
+
COMMIT_DATE = '2025-08-11'
|
|
29
29
|
|
|
30
30
|
DEFAULT_DELIMITER = '\t'
|
|
31
31
|
DEFAULTS_INDICATOR_KEY = '#_defaults_#'
|
|
@@ -885,6 +885,29 @@ def scrubTabularFile(fileName,teeLogger = None,header = '',createIfNotExist = Fa
|
|
|
885
885
|
appendLinesTabularFile(fileName,file,teeLogger = teeLogger,header = header,createIfNotExist = createIfNotExist,verifyHeader = verifyHeader,verbose = verbose,encoding = encoding,strict = strict,delimiter = delimiter)
|
|
886
886
|
return file
|
|
887
887
|
|
|
888
|
+
def getListView(tsvzDic,header = [],delimiter = DEFAULT_DELIMITER):
|
|
889
|
+
if header:
|
|
890
|
+
if isinstance(header,str):
|
|
891
|
+
header = header.split(delimiter)
|
|
892
|
+
elif not isinstance(header,list):
|
|
893
|
+
try:
|
|
894
|
+
header = list(header)
|
|
895
|
+
except:
|
|
896
|
+
header = []
|
|
897
|
+
if not tsvzDic:
|
|
898
|
+
if not header:
|
|
899
|
+
return []
|
|
900
|
+
else:
|
|
901
|
+
return [header]
|
|
902
|
+
if not header:
|
|
903
|
+
return list(tsvzDic.values())
|
|
904
|
+
else:
|
|
905
|
+
values = list(tsvzDic.values())
|
|
906
|
+
if values[0] and values[0] == header:
|
|
907
|
+
return values
|
|
908
|
+
else:
|
|
909
|
+
return [header] + values
|
|
910
|
+
|
|
888
911
|
# create a tsv class that functions like a ordered dictionary but will update the file when modified
|
|
889
912
|
class TSVZed(OrderedDict):
|
|
890
913
|
def __teePrintOrNot(self,message,level = 'info'):
|
|
@@ -1105,6 +1128,9 @@ class TSVZed(OrderedDict):
|
|
|
1105
1128
|
self.__teePrintOrNot(f"Appending {emptyLine} to the appendQueue")
|
|
1106
1129
|
self.appendQueue.append(emptyLine)
|
|
1107
1130
|
return self
|
|
1131
|
+
|
|
1132
|
+
def getListView(self):
|
|
1133
|
+
return getListView(self,header=self.header,delimiter=self.delimiter)
|
|
1108
1134
|
|
|
1109
1135
|
def clear(self):
|
|
1110
1136
|
# clear the dictionary and update the file
|
|
@@ -1539,6 +1565,3 @@ def __main__():
|
|
|
1539
1565
|
print("Invalid operation")
|
|
1540
1566
|
if __name__ == '__main__':
|
|
1541
1567
|
__main__()
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
{tsvz-3.28 → tsvz-3.29}/setup.py
RENAMED
|
File without changes
|
|
File without changes
|