Skip to content

Commit 658f644

Browse files
committed
feat: remove line_profiler dependency and profiling code
Remove line_profiler package from requirements.txt and eliminate related profiling functionality from main.py and utils.py. The profiling code was conditionally disabled and not being used, so removing it simplifies the codebase and reduces dependencies.
1 parent 12cbdc2 commit 658f644

3 files changed

Lines changed: 1 addition & 19 deletions

File tree

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ pyyaml
33
pytz
44
requests
55
colorlog
6-
line_profiler
76
indent-concluder>=1.1.3
87
fake-useragent
98
easywebhooker

src/main.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414

1515
try:
1616
entrance = {m.__name__: m for m in [run, test]}[mode]
17-
if var.verbose and False:
18-
run_with_LineProfiler(entrance)
19-
else:
20-
entrance()
17+
entrance()
2118

2219
logging.info(f"CLI ready to exit")
2320
except Exception as e:

src/utils.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
import pytz
2121
import requests
2222
import yaml
23-
from line_profiler import ( # do not remove this. It's needed by main.py, passing by import *
24-
LineProfiler,
25-
)
2623

2724
import var
2825

@@ -61,17 +58,6 @@ def mk_CLI_dir():
6158
var.maa_usrdir_path.mkdir(exist_ok=True)
6259

6360

64-
def run_with_LineProfiler(func, *args, **kwargs):
65-
profile = LineProfiler(func)
66-
result = profile.runcall(func, *args, **kwargs)
67-
68-
stream = StringIO()
69-
profile.print_stats(stream=stream)
70-
71-
logging.debug(stream.getvalue())
72-
return result
73-
74-
7561
def convert_str_to_legal_filename_windows(filename):
7662
end = ""
7763
for char in filename:

0 commit comments

Comments
 (0)