cannect 1.0.3__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.
@@ -2,7 +2,7 @@ from cannect.config import env
2
2
  from cannect.utils import tools
3
3
  from pathlib import Path
4
4
  from datetime import datetime
5
- import os
5
+ import os, stat
6
6
 
7
7
 
8
8
  class Deliverables:
@@ -31,6 +31,7 @@ class Deliverables:
31
31
  root = self.Root
32
32
 
33
33
  os.makedirs(root, exist_ok=True)
34
+ os.chmod(root, stat.S_IWRITE)
34
35
  for n, path in enumerate(self.__slots__, start=0):
35
36
  if path == "Root":
36
37
  continue
@@ -43,16 +44,10 @@ class Deliverables:
43
44
  os.makedirs(os.path.join(full_path, f'Post'), exist_ok=True)
44
45
 
45
46
  if not any(file.endswith('.xlsm') for file in os.listdir(root)):
46
- try:
47
- tools.copy_to(env.SVN_IR / '0000_HNB_SW_IR_.xlsm', root)
48
- except PermissionError:
49
- pass
47
+ tools.copy_to(env.SVN_IR / '0000_HNB_SW_IR_.xlsm', root)
50
48
 
51
49
  if not any(file.endswith('.pptx') for file in os.listdir(root)):
52
- try:
53
- tools.copy_to(env.SVN_HISTORY / '0000_변경내역서 양식.pptx', root)
54
- except PermissionError:
55
- pass
50
+ tools.copy_to(env.SVN_HISTORY / '0000_변경내역서 양식.pptx', root)
56
51
  return
57
52
 
58
53
  def __getitem__(self, item):
cannect/core/ir/ir.py CHANGED
@@ -498,7 +498,7 @@ class IntegrationRequest:
498
498
  self.logger.log(f' -> v{status}')
499
499
  else:
500
500
  self.logger.log(f' -> v{sdd.version_doc}')
501
- tools.copy_to(file, path)
501
+ tools.copy_to(file, path / row['SDDName'].replace('.zip', ''))
502
502
  tools.clear(temp, leave_path=True)
503
503
  return
504
504
 
@@ -561,23 +561,3 @@ if __name__ == "__main__":
561
561
  ir.resolve_sdd_version()
562
562
  ir.compare_model(prev='', post='', exclude_imported=False)
563
563
 
564
- # 변경내역서 작성
565
- # ppt = ChangeHistoryManager(
566
- # path=ir.deliverables["0000_CNGPIO_통신_인터페이스_개발_CANFD"],
567
- # logger=ir.logger
568
- # )
569
- # ppt.title = "[CAN] 송출 신호 음수 범위 미표출 오류 개선"
570
- # ppt.developer = "이제혁"
571
- # ppt.function = ir.table["FunctionName"]
572
- # ppt.issue = "VCDM CR10787115"
573
- # ppt.lcr = "자체 개선"
574
- # ppt.problem = "CF_Ems_DecelReq_Can 신호 음수 범위 표출 불가"
575
- # ppt.prev_model_description = ir.p_table # .select_previous_svn_version() 후행
576
- # ppt.post_model_description = ir.table
577
- # ppt.set_model_slides(ir.table)
578
- # ppt.prev_model_details = ir.p_table # .select_previous_svn_version() 후행
579
- # ppt.post_model_details = ir.table
580
- # ppt.parameters = ir.parameters # .compare_model()의 후행
581
-
582
- print(ir)
583
- # ir.to_clipboard()
cannect/utils/tools.py CHANGED
@@ -3,7 +3,7 @@ from pathlib import Path
3
3
  from typing import Callable, Iterable, List, Union
4
4
  from xml.etree.ElementTree import Element, ElementTree
5
5
  from xml.dom import minidom
6
- import os, zipfile, shutil, io, re
6
+ import os, zipfile, shutil, io, re, stat
7
7
 
8
8
 
9
9
  def unzip(src: Union[str, Path], to: Union[str, Path] = "") -> bool:
@@ -39,7 +39,12 @@ def zip(path:Union[str, Path]):
39
39
  return
40
40
 
41
41
  def copy_to(file:Union[str, Path], dst:Union[str, Path]) -> str:
42
- shutil.copy(file, dst)
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)
43
48
  # if '.' in os.path.basename(file):
44
49
  # shutil.copy(file, dst)
45
50
  # else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cannect
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: HYUNDAI-KEFICO EMS/ASW CONVENIENCE TOOL
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -265,6 +265,10 @@ print(vc.name) # DB 파일 이름 (확장자 제외)
265
265
  print(vc.filename) # DB 파일 이름 (확장자 포함)
266
266
  print(vc.revision) # DB 파일 최신 SVN Revision
267
267
  print(vc.filepath) # DB 파일 경로 (전체 경로)
268
+
269
+ # 현재 SVN 최신 CAN Excel SPEC에 대한 json 파일이 없는 경우 .json 호출 시 오류 발생
270
+ # 오류 발생 시 .to_json() 메소드 실행 필요
271
+ # vc.to_json()
268
272
  print(vc.json) # .revision에 해당하는 json 파일(전체 경로)
269
273
  print(vc.history) # DB 파일 SVN 이력
270
274
  ```
@@ -449,7 +453,7 @@ ir.deliverables = "사용자의 로컬 경로 지정"
449
453
  # - mode == "latest" : 대상 모델 Commit 미완료 상태, 최신 revision을 "변경 전" 모델로 간주 (기본 값)
450
454
  # - mode == "previous": 대상 모델 Commit 완료 상태, 직전 revision을 "변경 전" 모델로 간주
451
455
  # - mode == "select" : 대상 모델에 대한 revision을 사용자가 모두 선택(console)
452
- ir.select_previous_svn_version(mode="latest")
456
+ ir.select_previous_svn_version(mode="previous")
453
457
 
454
458
  # SDD 자동 업데이트 (잠재적 오류 내포)
455
459
  # 사용자는 개발 내용(이력)만 입력, 그 외 버전 관리는 자동 수행
@@ -492,11 +496,11 @@ from cannect import ChangeHistoryManager
492
496
 
493
497
  # ir 인스턴스가 존재한다고 가정
494
498
  # ∵ ir = IntegrationRequest(*modeuls)
495
- ppt = ChanHistoryManager(ir)
499
+ ppt = ChangeHistoryManager(ir)
496
500
 
497
501
  # 1페이지 작성
498
502
  ppt.title = "[CAN/공통] CAN BUS-OFF Recover Post Run 할당" # 제목
499
- ppt.developer = ir.User # 개발 담당
503
+ ppt.developer = "이*혁" # 개발 담당
500
504
  ppt.issue = "VCDM CR10786223" # Issue
501
505
  ppt.lcr = "자체 개선" # LCR
502
506
  ppt.problem = "OTA 업데이트 평가 중, ... 발생" # 문제 현상
@@ -35,9 +35,9 @@ cannect/core/can/testcase/unitcase/diagnosis.py,sha256=kmpdkb96A5KJU7O82vJm8CNc_
35
35
  cannect/core/can/testcase/unitcase/encode.py,sha256=hmTKqwF-v-kkW5lAcLosI6G0-QTUqEMtyPxOda3X6YU,2824
36
36
  cannect/core/ir/__init__.py,sha256=etkIUl0teb06nEB4a4YgbAmZnFaHBIR7VHDztyhccgs,149
37
37
  cannect/core/ir/changehistory.py,sha256=jnWSBlrhuSJdXDvRehj2gHNBaqgKW7xGWYHdYcwjPRY,11851
38
- cannect/core/ir/delivereables.py,sha256=1fEyCutNOoZNbFcKRQ3pZAPzR_Q4wSlC4Tp_5fCl9_g,2596
38
+ cannect/core/ir/delivereables.py,sha256=9TJ3KnKAnwnQOKByPqeypLKFpwjOwC0TPS_YYl3MIDU,2484
39
39
  cannect/core/ir/diff.py,sha256=gLs3kuhcBIFN2uo6W8UBDEK1qZIIbm0Nnxv4qmg3cgU,3674
40
- cannect/core/ir/ir.py,sha256=og990GVJBt_skjE_Uv7ZeHnrdPMWZlIfXcQZ6FgWWco,22387
40
+ cannect/core/ir/ir.py,sha256=5i7iAW0kHvEm2nCbGQPDVmSBYLKKccz3nhPTP89jZCA,21422
41
41
  cannect/core/ir/sdd.py,sha256=rDkjnV2EKx25yRrIH25FGv38kRAhm1o9xsDCTilmBJw,6041
42
42
  cannect/core/testcase/__init__.py,sha256=2dnD5l0kpPp7eIFdvkS3XvZ9MYbtDRzyg5BiWlm_28Y,192
43
43
  cannect/core/testcase/plotter.py,sha256=SNHmffhBqpySUPu_XDK-nvy_i0Rfo0MoHz_4DVOH-iU,8589
@@ -51,9 +51,9 @@ cannect/utils/__init__.py,sha256=vApTSz3uU9IsK8PGjw43VkTdfeBiYlXkgLzVehZciQ0,86
51
51
  cannect/utils/excel.py,sha256=sCWXZTqeiyPFNGVfnor9nmScfLl7_ERMiNEDrhURjU8,772
52
52
  cannect/utils/logger.py,sha256=QeYTFA6l2wFMdeqBYcwIEu3a_XUpEljvFmAIii9YSIc,2325
53
53
  cannect/utils/ppt.py,sha256=dEGTOrjT-8efVZd0NbOn-i3NVGedt5Qgm3DtDE4CJgs,6982
54
- cannect/utils/tools.py,sha256=-HIFl5qdROJFBnxU43tOI0tOUas9z2jthxSBpxlmzgA,7192
55
- cannect-1.0.3.dist-info/licenses/LICENSE,sha256=_UNFlbKK2ShYTDPH44e6OFWDtiLzYkDPnilDcrLaCG8,1064
56
- cannect-1.0.3.dist-info/METADATA,sha256=m381RlzvTcgDQrnfLlgnRBnOeV9dz59ytmuASrjlQMc,61545
57
- cannect-1.0.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
58
- cannect-1.0.3.dist-info/top_level.txt,sha256=QdGPQ02TsYi490A5C1BePgszlXQz7R9BijvgEP4-hQs,8
59
- cannect-1.0.3.dist-info/RECORD,,
54
+ cannect/utils/tools.py,sha256=kJKNUvlpvwaRJ_DoO24e_0NBGAJ_eKxk4fxg-nnvNZw,7376
55
+ cannect-1.0.4.dist-info/licenses/LICENSE,sha256=_UNFlbKK2ShYTDPH44e6OFWDtiLzYkDPnilDcrLaCG8,1064
56
+ cannect-1.0.4.dist-info/METADATA,sha256=XFFbaO6Wg1R3Q-Gz8rL6wcYHGkv3ctPIjDYHCxEqD6c,61727
57
+ cannect-1.0.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
58
+ cannect-1.0.4.dist-info/top_level.txt,sha256=QdGPQ02TsYi490A5C1BePgszlXQz7R9BijvgEP4-hQs,8
59
+ cannect-1.0.4.dist-info/RECORD,,