File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 44Main script for mitmproxy
55"""
66
7- import os
87import sys
9- import pkgutil
108import asyncio
11- import importlib
9+ from pathlib import Path
1210
1311from mitmproxy import ctx , contentviews
1412from reloader import watch_changes , reload_modules
1917from addons .no_cache import NoCache
2018from addons .debug import Debug
2119
22- # Redirect stdout
20+ # Redirect all stdout to stderr
2321sys .stdout = sys .stderr
2422
25- # Hot Reloading
23+ # HotReloading
2624for task in asyncio .all_tasks ():
2725 if task .get_name () == 'watch_changes' :
2826 ctx .log .info ("Canceling previous autoreload task" )
2927 task .cancel ()
30- asyncio .create_task (watch_changes (), name = "watch_changes" )
28+
29+ asyncio .create_task (
30+ watch_changes (trigger_file = Path (__file__ )),
31+ name = "watch_changes"
32+ )
3133
3234reload_modules ([
3335 "addons" ,
4749 ViewSekai (),
4850]
4951
52+ ####
5053# This code is required for adding/removing views
54+ ####
55+
5156def load (loader ):
5257 for view in views :
5358 contentviews .add (view )
You can’t perform that action at this time.
0 commit comments