cannect 1.0.2__py3-none-any.whl → 1.0.4__py3-none-any.whl
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.
- cannect/config.py +2 -3
- cannect/core/can/ascet/comdef.py +15 -15
- cannect/core/can/ascet/comrx.py +4 -4
- cannect/core/can/ascet/diag.py +26 -26
- cannect/core/can/db/_dbc.py +394 -0
- cannect/core/can/db/reader.py +56 -10
- cannect/core/can/db/specification/wrapper.py +37 -38
- cannect/core/can/db/vcs.py +10 -3
- cannect/core/ir/changehistory.py +118 -144
- cannect/core/ir/delivereables.py +4 -9
- cannect/core/ir/diff.py +6 -4
- cannect/core/ir/ir.py +41 -59
- cannect/core/subversion.py +25 -0
- cannect/core/testcase/unitcase.py +1 -1
- cannect/errors.py +6 -0
- cannect/utils/ppt.py +1 -4
- cannect/utils/tools.py +11 -3
- cannect-1.0.4.dist-info/METADATA +655 -0
- {cannect-1.0.2.dist-info → cannect-1.0.4.dist-info}/RECORD +22 -21
- cannect-1.0.2.dist-info/METADATA +0 -214
- {cannect-1.0.2.dist-info → cannect-1.0.4.dist-info}/WHEEL +0 -0
- {cannect-1.0.2.dist-info → cannect-1.0.4.dist-info}/licenses/LICENSE +0 -0
- {cannect-1.0.2.dist-info → cannect-1.0.4.dist-info}/top_level.txt +0 -0
cannect/utils/tools.py
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
from cannect.config import env
|
|
1
2
|
from pathlib import Path
|
|
2
|
-
from typing import
|
|
3
|
+
from typing import Callable, Iterable, List, Union
|
|
3
4
|
from xml.etree.ElementTree import Element, ElementTree
|
|
4
5
|
from xml.dom import minidom
|
|
5
|
-
import os, zipfile, shutil, io, re
|
|
6
|
+
import os, zipfile, shutil, io, re, stat
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
def unzip(src: Union[str, Path], to: Union[str, Path] = "") -> bool:
|
|
@@ -38,7 +39,12 @@ def zip(path:Union[str, Path]):
|
|
|
38
39
|
return
|
|
39
40
|
|
|
40
41
|
def copy_to(file:Union[str, Path], dst:Union[str, Path]) -> str:
|
|
41
|
-
|
|
42
|
+
if os.path.isfile(str(file)):
|
|
43
|
+
os.chmod(dst, stat.S_IWRITE)
|
|
44
|
+
os.chmod(file, stat.S_IWRITE)
|
|
45
|
+
shutil.copy(file, dst)
|
|
46
|
+
else:
|
|
47
|
+
shutil.copytree(file, dst, dirs_exist_ok=True)
|
|
42
48
|
# if '.' in os.path.basename(file):
|
|
43
49
|
# shutil.copy(file, dst)
|
|
44
50
|
# else:
|
|
@@ -85,6 +91,8 @@ def clear(path: str, leave_path: bool = True):
|
|
|
85
91
|
print(f"Error occurs while clearing directory: {e}")
|
|
86
92
|
|
|
87
93
|
def path_abbreviate(path: Union[str, Path]) -> str:
|
|
94
|
+
if str(path).startswith(str(env.DOWNLOADS)):
|
|
95
|
+
return path
|
|
88
96
|
sep = os.path.sep
|
|
89
97
|
split = str(path).split(sep)
|
|
90
98
|
return f"{sep.join(split[:2])}{sep} ... {sep}{sep.join(split[-3:])}"
|