You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
446 B
Python

import os
import sys
import importlib
handlers = []
# handlers_v2 = []
page_handlers = []
handlers_path = os.path.join(os.getcwd(), "handlers")
sys.path.append(handlers_path)
handlers_dir = os.listdir(handlers_path)
for item in handlers_dir:
if os.path.isdir(os.path.join(handlers_path, item)):
hu = importlib.import_module("{}.url".format(item))
handlers.extend(hu.handlers)
page_handlers.extend(hu.page_handlers)