ParUtils 1.2.0__py3-none-any.whl → 1.2.1__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- {ParUtils-1.2.0.dist-info → ParUtils-1.2.1.dist-info}/METADATA +2 -2
- {ParUtils-1.2.0.dist-info → ParUtils-1.2.1.dist-info}/RECORD +9 -9
- {ParUtils-1.2.0.dist-info → ParUtils-1.2.1.dist-info}/WHEEL +1 -1
- parutils/changelog.py +6 -2
- parutils/logging/cl.py +2 -2
- parutils/logging/logger.py +4 -2
- parutils/logging/main.py +12 -6
- {ParUtils-1.2.0.dist-info → ParUtils-1.2.1.dist-info}/LICENSE +0 -0
- {ParUtils-1.2.0.dist-info → ParUtils-1.2.1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.2
|
2
2
|
Name: ParUtils
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.1
|
4
4
|
Summary: This package contains a bunch of Python utils developed for Support, Test and Automation IT Engineers
|
5
5
|
Home-page: https://github.com/paularnaud2/ParUtils
|
6
6
|
Author: Paul ARNAUD
|
@@ -1,5 +1,5 @@
|
|
1
1
|
parutils/__init__.py,sha256=EaFtUmU0kYgnjvAFwPmoKt7I5zn9bxY02R7TUtcE6M4,1434
|
2
|
-
parutils/changelog.py,sha256=
|
2
|
+
parutils/changelog.py,sha256=3uz3n01a5Vt_JhNq6OfcTKPICGesQBhPcUaD5FeWSLk,1547
|
3
3
|
parutils/csvl.py,sha256=UBqw0lyhTNqFLSNIE-JM7TAQYCRgHftYQmHi21ru8-A,2874
|
4
4
|
parutils/dq.py,sha256=kdvzOo5FLCumXagY05kGSseYlbR-zvjjmsMtGVliVc8,2302
|
5
5
|
parutils/file.py,sha256=-OPfMhTjHDqubZLWJquY-FOv3W_k9GWoMq_rNgtdU9Y,2881
|
@@ -9,15 +9,15 @@ parutils/strg.py,sha256=_8NQJ1iY58Z_xACTDVcyonvRHDRuy9Ai3Kv3CvVXRh4,5563
|
|
9
9
|
parutils/testing.py,sha256=kXrMz8Kze4mZejaePmV_OIca4iuNcG_dhGVHCgVuF-k,610
|
10
10
|
parutils/wrap.py,sha256=PqMyKodgEjWDXoIVZZXRaBSdkGFL5OWmVJttl2Crrg8,421
|
11
11
|
parutils/logging/__init__.py,sha256=rSNpgjuYer-Hhn6zKzKwKSn_KfcajEXlk6cJnPC9eJU,461
|
12
|
-
parutils/logging/cl.py,sha256=
|
12
|
+
parutils/logging/cl.py,sha256=NCLuxLHvqRTypZlAgwnegkByLTnTirKntnwguJHBelA,2086
|
13
13
|
parutils/logging/const.py,sha256=L2OppBDAZYKUTIjsLPt6hTUh8UWH_1mX9YaGWlwzpj4,135
|
14
14
|
parutils/logging/core.py,sha256=vBwZnpM2GRNSSABPdzEM9SRpqr_YNqdPlG3T3lNPSiY,843
|
15
15
|
parutils/logging/g.py,sha256=ZSrgZw63kwxIW66A7-9_iYeDt4AstNZ_XXQgK8MglyQ,47
|
16
|
-
parutils/logging/logger.py,sha256=
|
17
|
-
parutils/logging/main.py,sha256=
|
16
|
+
parutils/logging/logger.py,sha256=XELvfvK4fB8DtbRnvlkHUnKgFnobAKGNnnkDwvUA9SM,3828
|
17
|
+
parutils/logging/main.py,sha256=arUvgB0YTZpidt4wl2GZsR4bRUj_rrSYMrTnCMKt4gA,2127
|
18
18
|
parutils/logging/sl.py,sha256=3-sj_o33cZmOqeFxlTl5HyHOvSAhn9glYcc-BmTUpZc,1164
|
19
|
-
ParUtils-1.2.
|
20
|
-
ParUtils-1.2.
|
21
|
-
ParUtils-1.2.
|
22
|
-
ParUtils-1.2.
|
23
|
-
ParUtils-1.2.
|
19
|
+
ParUtils-1.2.1.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
20
|
+
ParUtils-1.2.1.dist-info/METADATA,sha256=wwlE_iL727342kRMkKB6dzuLDlqN0rLoyWIROkrqc7U,5285
|
21
|
+
ParUtils-1.2.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
22
|
+
ParUtils-1.2.1.dist-info/top_level.txt,sha256=1MDobUcroeYEvdupZCAFvA5hJjm7LSDUV5A4jHySNis,9
|
23
|
+
ParUtils-1.2.1.dist-info/RECORD,,
|
parutils/changelog.py
CHANGED
@@ -1,5 +1,9 @@
|
|
1
|
-
__VERSION__ = '1.2.
|
2
|
-
#
|
1
|
+
__VERSION__ = '1.2.1'
|
2
|
+
# log_dict + log_array - only one log_print -> better perfs
|
3
|
+
# Improved check_log logs - name appears when nok
|
4
|
+
|
5
|
+
# __VERSION__ = '1.2.0'
|
6
|
+
# # logging - error handling
|
3
7
|
|
4
8
|
# __VERSION__ = '1.1.9'
|
5
9
|
# # check_log - name appears when check_log ok
|
parutils/logging/cl.py
CHANGED
@@ -65,8 +65,8 @@ def check_warn(n_w, max_warn, name):
|
|
65
65
|
if n_w == 0:
|
66
66
|
log(f'check_log{s} ok')
|
67
67
|
elif n_w <= max_warn:
|
68
|
-
log(f'check_log ended with {n_w} warnings')
|
68
|
+
log(f'check_log{s} ended with {n_w} warnings')
|
69
69
|
else:
|
70
|
-
s = f'check_log
|
70
|
+
s = f'check_log{s} nok, too many warnings ({n_w} warnings)'
|
71
71
|
log(s)
|
72
72
|
raise Exception(s)
|
parutils/logging/logger.py
CHANGED
@@ -52,7 +52,7 @@ class Logger:
|
|
52
52
|
s = (f"Log file initialised ({self.log_path})\n"
|
53
53
|
f"CWD: {os.getcwd()}\n"
|
54
54
|
f"Python interpreter path: {sys.executable}\n"
|
55
|
-
f"Python version: {sys.version
|
55
|
+
f"Python version: {sys.version}\n"
|
56
56
|
f"ParUtils version: {u.__VERSION__}\n")
|
57
57
|
self.log_print(s)
|
58
58
|
g.logger = self
|
@@ -72,7 +72,7 @@ class Logger:
|
|
72
72
|
s = f"{fdate}{msg}"
|
73
73
|
self.log_print(s, c_out=c_out)
|
74
74
|
|
75
|
-
def log_print(self, *args, level=0, c_out=True, nb_tab=0, dashes=0, tab_char=' '):
|
75
|
+
def log_print(self, *args, level=0, c_out=True, nb_tab=0, dashes=0, tab_char=' ', str_out=False):
|
76
76
|
if self.level < level:
|
77
77
|
return
|
78
78
|
|
@@ -85,6 +85,8 @@ class Logger:
|
|
85
85
|
if dashes > 0:
|
86
86
|
s = u.extend_str(s, '-', dashes)
|
87
87
|
|
88
|
+
if str_out:
|
89
|
+
return s + '\n'
|
88
90
|
with lock:
|
89
91
|
self._write_log(s, c_out)
|
90
92
|
|
parutils/logging/main.py
CHANGED
@@ -12,7 +12,7 @@ def log(*args, level=0, c_out=True):
|
|
12
12
|
|
13
13
|
|
14
14
|
@logger_methode
|
15
|
-
def log_print(*args, level=0, c_out=True, nb_tab=0, dashes=0, tab_char=' '):
|
15
|
+
def log_print(*args, level=0, c_out=True, nb_tab=0, dashes=0, tab_char=' ', str_out=False):
|
16
16
|
"""Prints something in the current log file (log_path)
|
17
17
|
|
18
18
|
- level: log level. Current log level is the attribute level of the current logger.
|
@@ -33,17 +33,23 @@ def log_input(str_in):
|
|
33
33
|
|
34
34
|
|
35
35
|
def log_array(array, nb_tab=0, tab_char=' '):
|
36
|
+
out = ''
|
36
37
|
for elt in array:
|
37
|
-
log_print(elt, nb_tab=nb_tab, tab_char=tab_char)
|
38
|
+
out += log_print(elt, nb_tab=nb_tab, tab_char=tab_char, str_out=True)
|
39
|
+
log_print(out)
|
38
40
|
|
39
41
|
|
40
|
-
def log_dict(d, nb_tab=0, depth=0, tab_char=' '):
|
42
|
+
def log_dict(d, nb_tab=0, depth=0, tab_char=' ', str_out=False):
|
43
|
+
out = ''
|
41
44
|
for key in d:
|
42
45
|
if isinstance(d[key], dict) and depth > 0:
|
43
|
-
log_print(f'{key}:', nb_tab=nb_tab, tab_char=tab_char)
|
44
|
-
log_dict(d[key], nb_tab + 1, depth - 1, tab_char=tab_char)
|
46
|
+
out += log_print(f'{key}:', nb_tab=nb_tab, tab_char=tab_char, str_out=True)
|
47
|
+
out += log_dict(d[key], nb_tab + 1, depth - 1, tab_char=tab_char, str_out=True)
|
45
48
|
else:
|
46
|
-
log_print(f'{key}: {d[key]}', nb_tab=nb_tab, tab_char=tab_char)
|
49
|
+
out += log_print(f'{key}: {d[key]}', nb_tab=nb_tab, tab_char=tab_char, str_out=True)
|
50
|
+
if str_out:
|
51
|
+
return out
|
52
|
+
log_print(out)
|
47
53
|
|
48
54
|
|
49
55
|
def log_example(list_in, what="duplicates", n_print=5):
|
File without changes
|
File without changes
|