-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
42 lines (35 loc) · 837 Bytes
/
Copy pathmodels.py
File metadata and controls
42 lines (35 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from dataclasses import dataclass, field
from typing import Optional
@dataclass
class AppItem:
name: str
path: str
size_gb: float
type: str # 'AppData', 'Program Files', 'User', etc.
source: str = 'registry' # 'registry' or 'scan'
@property
def key(self):
return f"{self.path}"
@dataclass
class ClassifiedItem:
item: AppItem
category: str # "SAFE", "REINSTALL", "FORBIDDEN"
reason: str
@dataclass
class MovePlan:
item: AppItem
source_path: str
target_path: str
status: str = "PENDING" # PENDING, DONE, FAILED, SKIPPED
@dataclass
class FolderItem:
path: str
size_gb: float
source: str = 'scan'
@property
def name(self):
import os
return os.path.basename(self.path)
@property
def type(self):
return "Folder"