open-case 2.0.0__tar.gz → 2.0.1__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.
- {open_case-2.0.0 → open_case-2.0.1}/PKG-INFO +4 -6
- open_case-2.0.1/README.md +7 -0
- {open_case-2.0.0 → open_case-2.0.1}/pyproject.toml +2 -5
- {open_case-2.0.0 → open_case-2.0.1}/pyproject.toml.orig +3 -8
- {open_case-2.0.0 → open_case-2.0.1}/src/open_case/main.py +9 -1
- {open_case-2.0.0 → open_case-2.0.1}/src/open_case/utils.py +25 -0
- open_case-2.0.0/README.md +0 -8
- {open_case-2.0.0 → open_case-2.0.1}/src/open_case/__init__.py +0 -0
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: open-case
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.1
|
|
4
4
|
Summary: Add your description here
|
|
5
5
|
Author: 6vi7ms
|
|
6
6
|
Author-email: 6vi7ms <6vi7ms@gmail.com>
|
|
7
7
|
Requires-Dist: click>=8.5.1
|
|
8
|
-
Requires-Dist: pyyaml>=6.0.3
|
|
9
8
|
Requires-Python: >=3.13
|
|
10
9
|
Description-Content-Type: text/markdown
|
|
11
10
|
|
|
11
|
+
# open-case
|
|
12
|
+
ยกเลิกการใช้ config.yaml
|
|
13
|
+
|
|
12
14
|
```sh
|
|
13
15
|
open-case -y 2025 1
|
|
14
16
|
```
|
|
15
17
|
|
|
16
|
-
# ลบ Temp
|
|
17
|
-
```sh
|
|
18
|
-
Remove-Item "$env:APPDATA\opencase\opencase.yaml"
|
|
19
|
-
```
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "open-case"
|
|
3
|
-
version = "2.0.
|
|
3
|
+
version = "2.0.1"
|
|
4
4
|
description = "Add your description here"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.13"
|
|
7
|
-
dependencies = [
|
|
8
|
-
"click>=8.5.1",
|
|
9
|
-
"pyyaml>=6.0.3",
|
|
10
|
-
]
|
|
7
|
+
dependencies = ["click>=8.5.1"]
|
|
11
8
|
|
|
12
9
|
[[project.authors]]
|
|
13
10
|
name = "6vi7ms"
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "open-case"
|
|
3
|
-
version = "2.0.
|
|
3
|
+
version = "2.0.1"
|
|
4
4
|
description = "Add your description here"
|
|
5
5
|
readme = "README.md"
|
|
6
|
-
authors = [
|
|
7
|
-
{ name = "6vi7ms", email = "6vi7ms@gmail.com" }
|
|
8
|
-
]
|
|
6
|
+
authors = [{ name = "6vi7ms", email = "6vi7ms@gmail.com" }]
|
|
9
7
|
requires-python = ">=3.13"
|
|
10
|
-
dependencies = [
|
|
11
|
-
"click>=8.5.1",
|
|
12
|
-
"pyyaml>=6.0.3",
|
|
13
|
-
]
|
|
8
|
+
dependencies = ["click>=8.5.1"]
|
|
14
9
|
|
|
15
10
|
[project.scripts]
|
|
16
11
|
open-case = "open_case.main:main"
|
|
@@ -17,13 +17,21 @@ LOCATIONS = [
|
|
|
17
17
|
"paths": [r"\\192.168.9.10\Case {year}\{case_folder}"],
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
"name": "192.168.9.127",
|
|
20
|
+
"name": "192.168.9.127 (รับเข้า)",
|
|
21
21
|
"enabled": True,
|
|
22
22
|
"paths": [
|
|
23
23
|
r"\\192.168.9.127\dfu\System DFU Evidence\Case-{thai_year_short}\{case_folder}",
|
|
24
24
|
r"\\192.168.9.127\dfu\System DFU Evidence\Case-{thai_year_short}\{short_case}",
|
|
25
25
|
],
|
|
26
26
|
},
|
|
27
|
+
{
|
|
28
|
+
"name": "192.168.9.127 (ส่งคืน)",
|
|
29
|
+
"enabled": True,
|
|
30
|
+
"paths": [
|
|
31
|
+
r"\\192.168.9.127\dfu\System DFU Evidence\รูปส่งคืน {thai_year_short}\{case_folder}",
|
|
32
|
+
r"\\192.168.9.127\dfu\System DFU Evidence\รูปส่งคืน {thai_year_short}\{short_case}",
|
|
33
|
+
],
|
|
34
|
+
},
|
|
27
35
|
]
|
|
28
36
|
|
|
29
37
|
|
|
@@ -4,57 +4,82 @@ import subprocess
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def open_folder(path: str):
|
|
7
|
+
|
|
7
8
|
print(f"Opening: {path}")
|
|
9
|
+
|
|
8
10
|
try:
|
|
9
11
|
subprocess.run(["explorer", path])
|
|
12
|
+
|
|
10
13
|
except Exception as e:
|
|
11
14
|
print(f"Error opening folder: {e}")
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
def ensure_and_open(path: str):
|
|
18
|
+
|
|
15
19
|
if os.path.exists(path):
|
|
16
20
|
return open_folder(path)
|
|
21
|
+
|
|
17
22
|
print(f"Folder not found: {path}")
|
|
23
|
+
|
|
18
24
|
if input("Create it? (y/n): ").strip().lower() == "y":
|
|
19
25
|
try:
|
|
20
26
|
os.makedirs(path, exist_ok=True)
|
|
27
|
+
|
|
21
28
|
open_folder(path)
|
|
29
|
+
|
|
22
30
|
except Exception as e:
|
|
23
31
|
print(f"Error creating folder: {e}")
|
|
24
32
|
|
|
25
33
|
|
|
26
34
|
def try_open_paths(paths: list):
|
|
35
|
+
|
|
27
36
|
existing = [p for p in paths if os.path.exists(p)]
|
|
37
|
+
|
|
28
38
|
if len(existing) == 1:
|
|
29
39
|
open_folder(existing[0])
|
|
40
|
+
|
|
30
41
|
elif len(existing) > 1:
|
|
31
42
|
print("Multiple folders found:")
|
|
43
|
+
|
|
32
44
|
for i, p in enumerate(existing, start=1):
|
|
33
45
|
print(f"{i}. {p}")
|
|
46
|
+
|
|
34
47
|
try:
|
|
35
48
|
open_folder(existing[int(input("Select: ")) - 1])
|
|
49
|
+
|
|
36
50
|
except (ValueError, IndexError):
|
|
37
51
|
print("Invalid selection.")
|
|
52
|
+
|
|
38
53
|
elif paths:
|
|
39
54
|
ensure_and_open(paths[0])
|
|
40
55
|
|
|
41
56
|
|
|
42
57
|
def find_case_in_drives(target_name: str) -> list:
|
|
58
|
+
|
|
43
59
|
found = []
|
|
60
|
+
|
|
44
61
|
print(f"Searching for '{target_name}'...")
|
|
62
|
+
|
|
45
63
|
roots = [f"{d}:\\" for d in string.ascii_uppercase if d.upper() != "C" and os.path.exists(f"{d}:\\")]
|
|
64
|
+
|
|
46
65
|
for root in roots:
|
|
47
66
|
try:
|
|
48
67
|
for current, dirs, _ in os.walk(root):
|
|
49
68
|
if target_name in dirs:
|
|
50
69
|
found.append(os.path.join(current, target_name))
|
|
70
|
+
|
|
51
71
|
break
|
|
72
|
+
|
|
52
73
|
except (PermissionError, OSError):
|
|
53
74
|
pass
|
|
75
|
+
|
|
54
76
|
return found
|
|
55
77
|
|
|
56
78
|
|
|
57
79
|
def render_path(template: str, year: int, case_no: str, user: str, prefix: str) -> str:
|
|
80
|
+
|
|
58
81
|
thai_yr = str(year + 543)
|
|
82
|
+
|
|
59
83
|
folder = f"{prefix}-{year}-{case_no}"
|
|
84
|
+
|
|
60
85
|
return template.format(user=user, year=year, case=case_no, prefix=prefix, folder=folder, case_folder=folder, short_case=f"{prefix}{case_no}", thai_year=thai_yr, thai_year_short=thai_yr[2:])
|
open_case-2.0.0/README.md
DELETED
|
File without changes
|