File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 11
11
12
12
from logging .handlers import RotatingFileHandler
13
13
from pathlib import Path
14
- from typing import Union
15
14
16
- DIR = Path (__file__ ).resolve ().parent
17
- sys .path .append (str (DIR .parent ))
18
- from human_byte_size import sizeof_fmt
15
+ # pip install humanize
16
+ from humanize import naturalsize as sizeof_fmt
19
17
20
18
21
19
def get_logger (
22
20
name = __file__ ,
23
- file : Union [ str , Path ] = 'log.txt' ,
21
+ file : str | Path = 'log.txt' ,
24
22
formatter : str = '[%(asctime)s] %(filename)s:%(lineno)d %(levelname)-8s %(message)s' ,
25
23
encoding = 'utf-8' ,
26
24
log_stdout = True ,
@@ -44,16 +42,17 @@ def get_logger(
44
42
return log
45
43
46
44
45
+ DIR = Path (__file__ ).resolve ().parent
46
+ DIRS = [r'C:\DEV__TX' , r'C:\DEV__OPTT' , r'C:\DEV__RADIX' ]
47
+
48
+
47
49
log = get_logger (
48
50
file = DIR / 'deleted.txt' ,
49
51
formatter = '[%(asctime)s] %(message)s' ,
50
52
)
51
53
52
54
53
- DIRS = [r'C:\DEV__TX' , r'C:\DEV__OPTT' , r'C:\DEV__RADIX' ]
54
-
55
-
56
- def run (dirs : list [Union [str , Path ]]):
55
+ def run (dirs : list [str | Path ]):
57
56
print (f'\n { DT .datetime .today ()} ' )
58
57
59
58
for dir_path in dirs :
You can’t perform that action at this time.
0 commit comments