PK!])  dophon/__init__.py# coding: utf-8 from flask import Blueprint name = 'dophon' def blue_print(name, import_name, inject_config: dict = {}, static_folder=None, static_url_path=None, template_folder=None, url_prefix=None, subdomain=None, url_defaults=None, root_path=None): """ 获取Flask路由,同时实现自动注入(可细粒度管理) :param inject_config:注入配置,类型为dict :param name:同Blueprint.name :param import_name:同Blueprint.import_name :param static_folder:同Blueprint.static_floder :param static_url_path:同Blueprint.static_url_path :param template_folder:同Blueprint.template_folder :param url_prefix:同Blueprint.url_prefix :param subdomain:同Blueprint.subdomain :param url_defaults:同Blueprint.url_defaults :param root_path:同Blueprint.root_path :return: """ blue_print_obj = Blueprint(name=name, import_name=import_name, static_folder=static_folder, static_url_path=static_url_path, template_folder=template_folder, url_prefix=url_prefix, subdomain=subdomain, url_defaults=url_defaults, root_path=root_path) if inject_config: autowire = __import__('dophon.annotation.AutoWired', fromlist=True) outerwired = getattr(autowire, 'OuterWired') outerwired( obj_obj=inject_config['inj_obj_list'], g=inject_config['global_obj'] )(inject)() return blue_print_obj def inject(): """ 用于构造注入入口,无意义 :return: """ pass def dophon_boot(f): """ 装饰器形式启动 :return: """ def arg(*args, **kwargs): from gevent import monkey monkey.patch_all() boot = __import__('dophon.boot', fromlist=True) kwargs['boot'] = boot return f(*args, **kwargs) return arg __all__ = ['BluePrint', 'blue_print'] BluePrint = blue_print PK!WWdophon/annotation/__init__.py# coding: utf-8 from dophon.annotation import AutoWired from dophon.annotation import res, req from dophon.annotation.AutoWired import * """ 注解集合(部分) author:CallMeE date:2018-06-01 """ __all__ = [ 'ResponseBody', 'ResponseTemplate', 'AutoParam', 'FullParam', 'RequestMapping', 'AutoWired', 'AsResBody', 'AsResTemp', 'AsArgs', 'AsJson', 'AsFile', 'BeanConfig', 'bean', 'Bean' ] AutoWired = AutoWired ResponseBody = AsResBody = res.response_body ResponseTemplate = AsResTemp = res.response_template AutoParam = AsArgs = req.auto_param FullParam = AsJson = req.full_param FileParam = AsFile = req.file_param BeanConfig = AutoWired.BeanConfig bean = AutoWired.bean Bean = AutoWired.Bean # 路径绑定装饰器 # 默认服务器从boot获取 def RequestMapping(app, path, methods): def method(f): result = app.route(path, methods=methods)(f) def args(*args, **kwargs): return result(*args, **kwargs) return args return method PK!hς))dophon/annotation/AutoWired.py# coding: utf-8 # 自动注入修饰器 import re import inspect from dophon import logger """ 自动注入注解 ps:默认为单例模式,利用模块局内变量域管理实例,减少内存冗余 author:CallMeE date:2018-06-01 实现自动注入功能需在路由模块(也可以在其他位置)中定义方法(inject_obj)并添加下列两个注解之一 DEMO; # 注入对象 @AutoWired.InnerWired([ShopGoodsController.ShopGoodsController],a_w_list=['_SGCobj'],g=globals()) 或者 @AutoWired.OuterWired(obj_list,g=globals()) def inject_obj(): pass 调用inject_obj()即可实现自动注入 注意: 1.a_w_list中的元素为注入引用名,必须要与注入目标引用名一致,否则注入失效 2.注入位置必须显式定义一个值为None的引用,否则编译不通过 3.注入类型必须为可初始化类型(定义__new__ or __init__) """ logger.inject_logger(globals()) obj_manager = {} class UniqueError(Exception): """ 唯一错误,存在覆盖已存在的别名实例 """ # 显式参数注入 def InnerWired(clz, g, a_w_list=[]): # print(locals()) # 注入实例 def wn(f): def inner_function(*args, **dic_args): # 获取数组 if a_w_list and 0 < len(a_w_list): # 装饰器参数查找赋值 a_name = a_w_list else: if dic_args['a_w_list'] and 0 < dic_args['a_w_list']: # 被装饰函数关键字参数查找赋值 a_name = dic_args['a_w_list'] else: if not args: logger.error('动态形参为空') raise Exception('动态形参为空!!') # 被装饰函数位置参数查找赋值 a_name = args[0] for index in range(len(a_name)): logger.info(str(a_name[index]) + " 注入 " + str(clz[index])) obj_name = a_name[index] if obj_name in obj_manager: g[obj_name] = obj_manager[obj_name] else: instance = clz[index]() obj_manager[obj_name] = instance g[obj_name] = instance # return arg return f() return inner_function return wn # 自定义参数列表注入 def OuterWired(obj_obj, g): # 前期准备 clz = [] a_w_list = [] for key in obj_obj.keys(): a_w_list.append(key) clz.append(obj_obj[key]) # 注入实例 def wn(f): logger.info('开始注入实例') def inner_function(*args, **dic_args): # 获取数组 if a_w_list and 0 < len(a_w_list): # 装饰器参数查找赋值 a_name = a_w_list else: if dic_args['a_w_list']: # 被装饰函数关键字参数查找赋值 a_name = dic_args['a_w_list'] else: if not args: logger.error('动态形参为空!!') raise Exception('动态形参为空!!') # 被装饰函数位置参数查找赋值 a_name = args[0] for index in range(len(a_name)): logger.info(str(a_name[index]) + " 注入 " + str(clz[index])) try: obj_name = a_name[index] if obj_name in obj_manager: g[obj_name] = obj_manager[obj_name] else: instance = clz[index]() obj_manager[obj_name] = instance g[obj_name] = instance except Exception as e: logger.error('注入' + str(a_name[index]) + '失败,原因:' + str(e)) continue return f() return inner_function return wn """ 2018-07-22 参照spring实例管理实现实例管理 1.bean装饰器 参照spring中bean注解 需执行被装饰方法才能交由实例管理器管理 默认使用方法名作为实例管理名 可传入自定义别名替换别名 同名别名会抛出二义性错误 暂不支持lambda表达式(强制调用非装饰器装饰lambda表达式会产生注册实例无效) 2.BeanConfig实例管理器 定义管理器子类后定义bean装饰方法后实例化一次后全部交由全局实例管理管理实例 支持with语法 3.Bean实例获取类 实例获取需传入实例别名或实例类型 可直接赋值变量 """ def bean(name: str = None, value=None): """ 向实例管理器插入实例 :param by_name: 别名(不传值默认为类型) :return: """ def insert_method(f): def args(*args, **kwargs): result = f(*args, **kwargs) if result is None: raise TypeError('无法注册实例:' + str(result)) if name: if name in obj_manager: raise UniqueError('存在已注册的实例:' + name) obj_manager[name] = result else: alias_name = getattr(f, '__name__') if getattr(f, '__name__') else getattr(type(result), '__name__') if alias_name in obj_manager: raise UniqueError('存在已注册的实例') else: obj_manager[alias_name] = result return return args def insert_value(): if name: if name in obj_manager: raise UniqueError('存在已注册的实例:' + name) obj_manager[name] = value else: alias_name = name if alias_name in obj_manager: raise UniqueError('存在已注册的实例') else: obj_manager[alias_name] = value return insert_value if value else insert_method class BeanConfig: """ 实力配置类,类内自定义方法带上bean注解即可(参照springboot中been定义) """ def __call__(self, *args, **kwargs): for name in dir(self): if re.match('__.+__', name): continue attr = getattr(self, name) if callable(attr): fields = inspect.getfullargspec(attr).args staticmethod(attr(*fields)) def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): if exc_type and exc_val and exc_tb: logger.error('%s 实例不存在', str(exc_val)) pass def __init__(self, files: list = [], config_file: str = ''): if obj_manager: logger.warning('存在已初始化实例管理器,跳过初始化: %s' % (self,)) return logger.info('执行批量实例管理初始化') if files or config_file: self.file_init(files if files else [config_file]) else: # 无参构造,加载内部bean装饰方法,实例统一配置 self() def file_init(self, files: list = []): for config_file in files: if isinstance(config_file, str): logger.info('读取配置文件: %s ' % (config_file,)) # 字符串形式声明配置文件 # 有参构造,分布式实例配置 from dophon import properties import os file_path = properties.project_root + (config_file if config_file.startswith(os.sep) else ( os.sep + config_file)) # import filetype # 获取文件类型(暂时遗弃) # kind = filetype.guess(file_path) # if kind is None: # print('Cannot guess file type!') # return # # print('File extension: %s' % kind.extension) # print('File MIME type: %s' % kind.mime) if os.path.exists(file_path): try: bean_config = __import__(config_file.replace(os.sep, '.').rstrip('.py'), fromlist=True) self.sort_bean_config(bean_config) except Exception as e: logger.error('实例配置读取失败,信息: %s' % (e,)) else: logger.error('不存在实例配置文件') self() elif isinstance(config_file, object): try: logger.info('读取配置文件: %s ' % (config_file,)) self.sort_bean_config(config_file) except Exception as e: logger.error('实例配置读取失败,信息: %s' % (e,)) else: # 其他形式声明配置 logger.error('配置文件声明无效(%s)' % (config_file,)) continue def sort_bean_config(self, bean_config: object): for k in dir(bean_config): if not k.startswith('__') and not k.endswith('__'): # 获取自定义参数 # print(k, '---', getattr(bean_config, k)) bean(k, getattr(bean_config, k))() # print(obj_manager[k]) class Bean: def __new__(cls, *args, **kwargs): if args or len(args) > 1: bean_key = args[0] elif kwargs or len(kwargs) > 1: bean_key = kwargs.keys()[0] else: raise KeyError('不存在实例别名或实例类型') if isinstance(bean_key, str): if bean_key in obj_manager: return obj_manager[bean_key] raise KeyError('不存在该别名实例') elif isinstance(bean_key, type): type_list = [] for key in obj_manager.keys(): if re.match('__.+__', key): continue bean_obj = obj_manager[key] if isinstance(bean_obj, bean_key): if len(type_list) > 0: raise UniqueError('存在定义模糊的实例获取类型') type_list.append(bean_obj) if not type_list: raise KeyError('不存在该类型实例') return type_list[0] PK!b!dophon/annotation/req/__init__.py# coding: utf-8 import functools from flask import request, abort from dophon import logger ''' 参数体可以为多个,形参名称必须与请求参数名一一对应(只少不多) 装饰器中关键字参数列表可以指定参数名 ''' logger.inject_logger(globals()) # 处理请求参数装饰器(分离参数) def auto_param(kwarg_list=[]): def method(f): @functools.wraps(f) def args(*args, **kwargs): try: if 'GET' == str(request.method): return is_get(f, request, kwarg_list) elif 'POST' == str(request.method): return is_post(f, request, kwarg_list) else: logger.error('方法不支持!!') except TypeError as t_e: logger.error('参数不匹配!!,msg:' + repr(t_e)) raise t_e return abort(500) return args return method ''' 注意!!! 该注解只需方法体内存在一个形参!!! 同样,需要指定参数名的形式参数列表条目也只能存在一个,多个会默认取第一个 不匹配会打印异常 参数以json形式赋值 ''' # 处理请求参数装饰器(统一参数,参数体内参数指向json串) def full_param(kwarg_list=[]): def method(f): @functools.wraps(f) def args(*args, **kwargs): try: if 'POST' == str(request.method): r_arg = () r_kwarg = {} if not kwarg_list: r_arg = (request.json if request.is_json else request.form.to_dict(),) else: r_kwarg[kwarg_list[0]] = request.json if request.is_json else request.form.to_dict() return f(*r_arg, **r_kwarg) elif 'GET' == str(request.method): r_arg = () r_kwarg = {} if not kwarg_list: r_arg = (request.args.to_dict(),) else: r_kwarg[kwarg_list[0]] = request.args.to_dict() return f(*r_arg, **r_kwarg) else: logger.error('json统一参数不支持该请求方法!!') return abort(400) except TypeError as t_e: logger.error('参数不匹配!!,msg:' + repr(t_e)) return abort(500) return args return method def file_param(alias_name: str = 'files', extra_param: str = 'args'): """ 文件参数装在装饰器 ps 文件上传暂时只支持路由方法内单个参数接收(会有校验策略) 参数demo(小程序): ImmutableMultiDict([('img_upload_test', )]) :return: """ def method(f): @functools.wraps(f) def args(*args, **kwargs): # 检测参数 a_nums = len(args) + len(kwargs) if a_nums > 0: logger.error('路由绑定参数数量异常') raise Exception('路由绑定参数数量异常') try: extra_param_value=(request.form if request.form else request.json).to_dict() except: extra_param_value={} k_args = { alias_name: request.files.to_dict(), extra_param: extra_param_value } return f(**k_args) return args return method def is_get(f, r, kw_list): r_arg = () r_kwarg = {} if not kw_list: r_arg = r.args.to_dict().values() else: for index in range(len(kw_list)): r_kwarg[kw_list[index]] = r.args[kw_list[index]] return f(*r_arg, **r_kwarg) def is_post(f, r, kw_list): r_arg = () r_kwarg = {} if r.is_json: if not kw_list: r_arg = is_json(r.json) else: for index in range(len(kw_list)): r_kwarg[kw_list[index]] = r.json[kw_list[index]] else: if not kw_list: r_arg = is_form(r.form) else: for index in range(len(kw_list)): r_kwarg[kw_list[index]] = r.form[kw_list[index]] return f(*r_arg, **r_kwarg) def is_json(arg_list): return arg_list.values() def is_form(arg_list): return arg_list.to_dict().values() PK!{Xaa!dophon/annotation/res/__init__.py# 响应返回数据修饰器(跳过视图解析器) # 响应体形式返回 # (自带AutoParam) <------暂未完成 import functools from dophon import logger from flask import jsonify, render_template logger.inject_logger(globals()) def response_body(): def method(f): @functools.wraps(f) def arg(*args, **kwargs): result = jsonify(f(*args, **kwargs)) if result: return result else: return [] return arg return method # 返回web模板 def response_template(template: list): """ 返回模板页面 :param template: 模板页面路径 :return: """ def method(f): @functools.wraps(f) def args(*args, **kwargs): page_param = f(*args, **kwargs) if isinstance(page_param, type({})): return render_template(template, **page_param) else: logger.error('页面参数错误!') raise KeyError('页面参数错误!') return args return methodPK!E-E-dophon/boot.py# coding: utf-8 import traceback, functools import os,sys,re from threading import * import json """ 初始化协程模块(必须,不然导致系统死锁) """ from gevent import monkey monkey.patch_all() from dophon import pre_boot, logger logger.inject_logger(globals()) pre_boot.check_modules() from flask import Flask, request, abort from dophon import properties try: mysql = __import__('dophon.db.mysql') except: mysql = None def load_banner(): """ 加载header-banner文件 :return: """ file_root = properties.project_root file_path = file_root + os.path.sep + 'header.txt' if os.path.exists(file_path): with open(file_path, encoding='utf8') as banner: for line in banner.readlines(): sys.stdout.write(line) sys.stdout.flush() def load_footer(): """ 加载footer-banner文件 :return: """ file_root = properties.project_root file_path = file_root + os.path.sep + 'footer.txt' if os.path.exists(file_path): with open(file_path, encoding='utf8') as banner: for line in banner.readlines(): sys.stdout.write(line) sys.stdout.flush() def boot_init(): """ 初始化启动 :return: """ global app_name, app, ip_count, ipcount_lock, ip_refuse_list load_banner() app_name = properties.service_name if hasattr(properties, 'service_name') else __name__ # 定义WEB容器(同时防止json以ascii解码返回) app = Flask(app_name) app.config['JSON_AS_ASCII'] = False # ip计数缓存 ip_count = {} ipcount_lock = Lock() if os.path.exists(os.getcwd() + '/ip_count'): with open('ip_count', 'r') as ip_count_file: file_text = ip_count_file.read() if file_text: ip_count = eval(file_text) else: with open('ip_count', 'w') as ip_count_file: json.dump({}, ip_count_file) # IP黑名单 ip_refuse_list = {} boot_init() def before_request(): """ 定义拦截器 :return: """ if properties.ip_count: ipcount_lock.locked() ip = request.remote_addr now_timestemp = datetime.now().timestamp() # 检测是否为黑名单 if ip in ip_refuse_list: # 默认禁用一分钟 if (int(now_timestemp) - int(ip_refuse_list[ip])) > 60: # 可以清除白名单 ip_refuse_list.pop(ip) # 清除访问记录 ip_count[ip]['req_timestemp'] = [now_timestemp] else: # 未到解禁时间 return abort(400) if ip in ip_count: ip_item = ip_count[ip] ip_item['req_count'] += 1 req_timestemp = ip_item['req_timestemp'] """ 判断逻辑: 当前请求时间是最近的,连续的1秒内 """ if (int(now_timestemp) - int(req_timestemp[0])) > 1 \ and \ (int(now_timestemp) - int(req_timestemp[len(req_timestemp) - 1])) < 1: # 检测3秒内请求数 if len(req_timestemp) > 50: # 默认三秒内请求不超过300 # 超出策略则添加到黑名单 ip_refuse_list[ip] = now_timestemp else: # 不超出策略则清空请求时间戳缓存 ip_item['req_timestemp'] = [now_timestemp] else: ip_item['req_timestemp'].append(now_timestemp) else: ip_item = { 'req_count': 1, 'req_timestemp': [now_timestemp] } Thread(target=persist_ip_count).start() ip_count[ip] = ip_item def persist_ip_count(): """ 持久化ip统计到文件 :return: """ # 持久化ip统计 with open('ip_count', 'w') as ip_count_file: json.dump(ip_count, ip_count_file) if ipcount_lock.locked(): ipcount_lock.release() # 处理各模块中的自动注入以及组装各路由 # dir_path中为路由模块路径,例如需要引入的路由都在routes文件夹中,则传入参数'/routes' def map_apps(dir_path): path = os.getcwd() + dir_path if not os.path.exists(path): logger.error('路由文件夹不存在,创建路由文件夹') os.mkdir(path) f_list = os.listdir(path) logger.info('路由文件夹: %s', dir_path) while f_list: try: file = f_list.pop(0) if re.match('__.*__', file): continue i = os.path.join(path, file) if os.path.isdir(i): logger.info('加载路由模块: %s', file) continue f_model = __import__(re.sub('/', '', dir_path) + '.' + re.sub('\.py', '', file), fromlist=True) filter_method = f_model.app.before_request(before_request) if hasattr(properties, 'ip_count') and getattr(properties, 'ip_count'): setattr(f_model, 'before_request', filter_method) app.register_blueprint(f_model.app) except Exception as e: raise e pass logger.info('路由初始化') for path in properties.blueprint_path: map_apps(path) def get_app() -> Flask: return app def free_source(): def method(f): @functools.wraps(f) def args(*arg, **kwarg): logger.info('启动服务器') load_footer() f(*arg, **kwarg) """ 释放所有资源 :return: """ logger.info('服务器关闭') logger.info('释放资源') if mysql: mysql.free_pool() logger.info('释放连接池') logger.info('再次按下Ctrl+C退出') return args return method def fix_static( fix_target: Flask = app, static_floder: str = 'static' ): """ 修正静态文件路径 :return: """ if hasattr(fix_target, 'static_folder'): if hasattr(properties, 'project_root'): root_path = properties.project_root else: root_path = os.getcwd() fix_target.static_folder = root_path + '/' + static_floder else: raise Exception('错误的修复对象') def fix_template( fix_target: Flask = app, template_folder: str = 'templates' ): """ 修正页面模板文件路径 :return: """ if hasattr(fix_target, 'template_folder'): if hasattr(properties, 'project_root'): root_path = properties.project_root else: root_path = os.getcwd() fix_target.template_folder = root_path + '/' + template_folder else: raise Exception('错误的修复对象') @free_source() def run_app(host=properties.host, port=properties.port): logger.info('监听地址: %s : %s' % (host, port)) if properties.server_gevented: from gevent.pywsgi import WSGIServer WSGIServer((host, port), app).serve_forever() else: # 开启多线程处理 app.run(host=host, port=port, threaded=properties.server_threaded) @free_source() def run_app_ssl(host=properties.host, port=properties.port, ssl_context=properties.ssl_context): logger.info('监听地址: %s : %s' % (host, port)) if properties.server_gevented: from gevent.pywsgi import WSGIServer ssl_args = { 'certfile': ssl_context[0], 'keyfile': ssl_context[1], } WSGIServer((host, port), app, **ssl_args).serve_forever() else: # 开启多线程处理 app.run(host=host, port=port, ssl_context=ssl_context, threaded=properties.server_threaded) def bootstrap_app(): """ bootstrap样式页面初始化 :return: """ global app b = __import__('flask_bootstrap') b.Bootstrap(app) from dophon.annotation import * @RequestMapping(app, '/framework/ip/count', ['get', 'post']) @ResponseBody() def view_ip_count(): """ 此为公共请求,不计入ip统计 :return: """ return ip_count @RequestMapping(app, '/framework/ip/refuse', ['get', 'post']) @ResponseBody() def view_ip_refuse(): """ 此为公共请求,不计入ip统计 :return: """ return ip_refuse_list @app.errorhandler(500) def handle_500(e): """ 处理业务代码异常页面 :param e: :return: """ exc_type, exc_value, exc_tb = sys.exc_info() tc = traceback.format_tb(exc_tb) if properties.debug_trace: trace_detail = '

Details

' trace_detail += '' for tc_item in tc: if tc_item.find(os.getcwd()) < 0: continue trace_detail += '' tc_item_info_list = tc_item.split(',', 2) # for tc_item_info_list_item in tc_item_info_list: # trace_detail += '' trace_detail += '' trace_detail += '' trace_code_detail = re.sub('^\s+', '', tc_item_info_list[2]).split(' ', 1) trace_detail += '' trace_detail += '' trace_detail += '
' + tc_item_info_list_item + '' + re.sub('(^.+(\\\|/))|"', '', tc_item_info_list[0]) + '' + tc_item_info_list[1] + '' + ' => '.join([ trace_code_detail[0], re.sub('\s+', ' => ', trace_code_detail[1], 1), ]) + '
' else: trace_detail = '' return '

Wrong!!

' + \ '

error info:' + str(e) + '

' + \ '

please contact coder or direct to dophon and leave your question

' + \ trace_detail, 500 @app.errorhandler(404) def handle_404(e): """ 处理路径匹配异常 :return: """ return '

Wrong!!

' + \ '

error info:' + str(e) + '

' + \ '

please contact coder or direct to dophon and leave your question

' + \ 'request path:' + request.path, 404 @app.errorhandler(405) def handle_405(e): """ 处理请求方法异常 :return: """ return '

Wrong!!

' + \ '

error info:' + str(e) + '

' + \ '

please contact coder or direct to dophon and leave your question

' + \ 'request method:' + request.method, 405 @app.errorhandler(400) def handle_400(e): """ 处理异常请求 :return: """ return ('

Wrong!!

' + \ '

error info:' + str(e) + '

' + \ '

please contact coder or direct to dophon and leave your question

' + \ 'request form:' + request.form + \ 'request body:' + request.json if request.is_json else ''), 400 PK!jNtdophon/cluster_boot.py# coding: utf-8 from gevent import monkey monkey.patch_all() from multiprocessing import Process, freeze_support import time, socket, random from flask import request, make_response from urllib3 import PoolManager from dophon import logger from dophon import properties logger.inject_logger(globals()) ports = [] # 记录监听端口 proxy_clusters = {} pool = PoolManager() def main_freeze(): freeze_support() def redirect_request(): logger.info('touch path: %s [success]' % (request.path)) res = pool.request(request.method, '127.0.0.1:' + str(random.choice(ports)) + request.path, fields=request.json if request.is_json else request.form) return make_response(res.data) def outer_entity(boot): # 重写路由信息(修改为重定向路径) boot.get_app().before_request(redirect_request) boot.run_app() def run_clusters(clusters: int, outer_port: bool = False, start_port: int = 8800): """ 运行集群式服务器 :param clusters: 集群个数 :param outer_port: 是否开启外部端口映射(映射端口为用户配置文件中配置的端口) :param start_port: 集群起始监听端口 :return: """ from dophon import boot for i in range(clusters): current_port = start_port + i create_cluster_cell(boot=boot, port=current_port) ports.append(current_port) while len(ports) != clusters: time.sleep(5) logger.info('启动检测端口监听') for port in ports: if check_socket(int(port)): continue logger.info('集群端口: %s ' % ports) if outer_port: logger.info('启动外部端口监听[%s]' % (properties.port)) outer_entity(boot) def create_cluster_cell(boot, port): # http协议 proc = Process(target=boot.run_app, kwargs={ 'host': '127.0.0.1', 'port': port }) proc.start() def check_socket(port: int): s = socket.socket() flag = True while flag: try: ex_code = s.connect_ex(('127.0.0.1', port)) flag = False return int(ex_code) == 0 except Exception as e: time.sleep(3) continue PK!wSBBdophon/def_prop/__init__.py# coding: utf-8 # coding: utf-8 import os """ 配置集合 author:CallMeE date:2018-06-01 """ project_root = os.getcwd() # 服务器相关配置 server_threaded = False # 服务器多线程开关 server_gevented = False # 服务器gevent协程处理(会覆盖多线程开关) debug_trace = False # 调试跟踪记录 # 此为开启ip防火墙模式(1秒不超过50次请求,60秒解冻) ip_count = False # 此处为服务器配置 host = '127.0.0.1' port = 443 ssl_context = 'adhoc' # 此处为路由文件夹配置 blueprint_path = ['/routes'] # route model dir path # 此处为数据库配置 pool_conn_num = 5 # size of db connect pool pydc_host = 'localhost' pydc_port = 3306 pydc_user = 'root' pydc_password = 'root' pydc_database = 'db' pydc_xmlupdate_sech = False db_pool_exe_time = False # 消息队列线程池工人数 msg_queue_max_num = 30 # 消息队列调试标识 msg_queue_debug = False # 此处为消息队列配置 mq = { 'remote_center': False } # 此处为日志配置 if debug_trace: logger_config = { # 'filename': 'app.log', # 'level': 'logging.DEBUG', 'format': '%(levelname)s : <%(module)s> (%(asctime)s) ==> %(filename)s {%(funcName)s} [line:%(lineno)d] ::: %(message)s', 'datefmt': '%Y-%m-%d %H:%M:%S' } PK!w11%dophon/def_prop/default_properties.py# coding: utf-8 import os """ 配置集合 author:CallMeE date:2018-06-01 """ project_root = os.getcwd() # 服务器相关配置 server_threaded = False # 服务器多线程开关 server_gevented = False # 服务器gevent协程处理(会覆盖多线程开关) debug_trace = False # 调试跟踪记录 # 此为开启ip防火墙模式(1秒不超过50次请求,60秒解冻) ip_count = False # 此处为服务器配置 host = '127.0.0.1' port = 443 ssl_context = 'adhoc' # 此处为路由文件夹配置 blueprint_path = ['/routes'] # route model dir path # 此处为数据库配置 pool_conn_num = 5 # size of db connect pool pydc_host = 'localhost' pydc_port = 3306 pydc_user = 'root' pydc_password = 'root' pydc_database = 'db' pydc_xmlupdate_sech = False db_pool_exe_time = False # 消息队列线程池工人数 msg_queue_max_num = 30 # 消息队列调试标识 msg_queue_debug = False # 此处为消息队列配置 mq = { 'remote_center': False } # 此处为日志配置 if debug_trace: logger_config = { # 'filename': 'app.log', # 'level': 'logging.DEBUG', 'format': '%(levelname)s : <%(module)s> (%(asctime)s) ==> %(filename)s {%(funcName)s} [line:%(lineno)d] ::: %(message)s', 'datefmt': '%Y-%m-%d %H:%M:%S' } PK!빕ldophon/docker_boot.py# encoding: utf-8 import logging import re import os import socket import sys import threading import time from urllib import request def read_self_prop(): try: def_prop = __import__('dophon.def_prop.default_properties', fromlist=True) u_prop = __import__('application', fromlist=True) # 对比配置文件 for name in dir(def_prop): if re.match('__.*__', name): continue if name in dir(u_prop): continue setattr(u_prop, name, getattr(def_prop, name)) sys.modules['properties'] = u_prop sys.modules['dophon.properties'] = u_prop except Exception as e: logging.error(e) sys.modules['properties'] = def_prop sys.modules['dophon.properties'] = def_prop try: read_self_prop() except Exception as e: logging.error('没有找到自定义配置:(application.py)') logging.error('引用默认配置') from dophon import properties from dophon import logger logger.inject_logger(globals()) def IsOpen(ip, port): """ 检查端口是否被占用 :param ip: :param port: :return: """ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.connect((ip, int(port))) logger.error('端口被占用:' + port) s.close() return True except: return False def listen(code): """ 监听命令状态码 :param code: os.system()命令返回码 :return: 当不正常执行会抛出错误,谨慎使用!!! """ if code >> 8 is 0: pass else: raise Exception('命令执行错误!') def listen_container_status(container_port, loop_count: int = 3, wait_sec: int = 10): """ 检测容器端口存活 :return: """ # 一分钟后检测 time.sleep(60) # 默认检测三次 curr_count = 1 while int(curr_count) <= int(loop_count): # 默认间隔10秒 time.sleep(wait_sec) if IsOpen(get_docker_address(), int(container_port)): raise Exception('端口映射异常') else: # 报错证明端口正常占用 # 发起请求 url='http://' + get_docker_address() + ':' + container_port logger.info('容器存活性检查:' + url) res = request.urlopen(url) if not res.read(): raise Exception('服务启动异常') curr_count += 1 logger.info('容器启动成功,请在命令行输入docker ps查看') def get_docker_address(): """ 获取容器载体ip :return: """ result = os.popen('ipconfig').readlines() result_lines = [] r_l_copy = [] while result: line = result[0] if re.search('^.*(d|D)(o|O)(c|C)(k|K)(e|E)(r|R).*$', line): result_lines = result.copy() break else: result.pop(0) for line in result_lines: line = re.sub('\s*', '', line) if line and re.search('([0-9]+\.)+[0-9]+$', line) and re.search('(i|I)(p|P)', line): r_l_copy.append( re.search('([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)', line).group(0) ) return r_l_copy.pop(0) def attach_container(base_name: str): """ 进入容器 :return: """ os.system('docker attach ' + base_name) def run_as_docker( entity_file_name: str = None, container_port: str = str(properties.port), docker_port: str = str(properties.port), attach_cmd: bool = False ): """ 利用docker启动项目 :param entity_file_name: 入口文件名(包括后缀) :param container_port: 容器暴露端口 :param docker_port: 容器内部端口 -> 集群模式下的暴露端口,一般为配置文件定义的端口 :param attach_cmd: 是否进入容器内部sh :return: """ try: logger.info('容器前期准备') root = re.sub('\\\\', '/', properties.project_root) base_name = os.path.basename(root) import platform p_version = platform.python_version() work_dir = './' + base_name # 生成依赖文件 logger.info('生成依赖文件') os.system('pip freeze >pre_requirements.txt') with open('./pre_requirements.txt', 'r') as file: with open('./requirements.txt', 'w') as final_file: for line in file.readlines(): for key in sys.modules.keys(): if re.search('(_|__|\\.).+$', key): continue module_path = re.sub('(>=|==|=>|<=|=<|<|>|=).*\s+', '', line.lower()) if re.search(module_path, key.lower()): final_file.write(line) continue # 生成Dockerfile logger.info('生成Dockerfile') with open('./Dockerfile', 'w') as file: file.write('FROM python:' + p_version + '\n') file.write('ADD . ' + work_dir + '\n') file.write('ADD . ' + work_dir + '/' + base_name + '\n') file.write('WORKDIR ' + work_dir + '\n') file.write('RUN pip install -r requirements.txt' + '\n') file.write('CMD ["python","./' + (entity_file_name if entity_file_name else 'Bootstrap.py') + '"]' + '\n') # file.write('CMD ["/bin/bash"]' + '\n') os.system('cd ' + root) logger.info('暂停已运行的实例') os.system('docker stop ' + base_name) logger.info('移除已运行的实例') os.system('docker rm ' + base_name) logger.info('移除旧镜像') os.system('docker rmi ' + base_name) logger.info('检测配置合法性') if IsOpen('127.0.0.1', int(docker_port)): # 端口被占用 logger.warn('映射端口被占用!!') logger.info('建立镜像') listen(os.system('docker build -t ' + base_name + ' .')) logger.info('运行镜像') os.system( 'docker run -p ' + container_port + ':' + docker_port + ' -d --name ' + base_name + ' ' + os.path.basename( root)) logger.info('打印容器内部地址(空地址代表启动失败)') os.system('docker inspect --format=\'{{.NetworkSettings.IPAddress}}\' ' + base_name) logger.info('打印容器载体地址') print(get_docker_address()) logger.info('启动检测容器端口') threading.Thread(target=listen_container_status, args=(container_port,)).start() if attach_cmd: logger.info('进入镜像') # threading.Thread(target=attach_container,args=(base_name,)).start() attach_container(base_name) logger.info('容器启动完毕') except Exception as e: logger.error(e) PK!ĻCSSdophon/logger/__init__.py# coding: utf-8 import ctypes import logging import os import re import sys import platform from dophon import properties p_sys_type = platform.system() logging_config = \ properties.logger_config \ if hasattr(properties,'logger_config') and properties.logger_config \ else \ { # 'filename': 'app.log', # 'level': 'logging.DEBUG', 'format': '%(levelname)s : (%(asctime)s) ==> ::: %(message)s', # 'format': '%(levelname)s %(name)s: <%(module)s> (%(asctime)s) ==> %(filename)s {%(funcName)s} [line:%(lineno)d] ::: %(message)s', 'datefmt': '%Y-%m-%d %H:%M:%S' } if 'level' in logging_config: logging_config['level'] = eval(logging_config['level']) else: logging_config['level'] = logging.INFO # 日志过滤非框架打印 class DefFilter(logging.Filter): def filter(self, record): return record.name.startswith('dophon') # 禁用调度的日志显示 logging.getLogger('schedule').addFilter(DefFilter()) CRITICAL = 50 FATAL = CRITICAL ERROR = 40 WARNING = 30 WARN = WARNING INFO = 20 DEBUG = 10 NOTSET = 0 formatter=logging.Formatter(fmt=logging_config['format'], datefmt=logging_config['datefmt']) stdOutHandle=None if str(p_sys_type).upper() == 'WINDOWS': logging.basicConfig(**logging_config) __foreGroundBLUE = 0x09 __foreGroundGREEN = 0x0a __foreGroundRED = 0x0c __foreGroundYELLOW = 0x0e __stdInputHandle = -10 __stdOutputHandle = -11 __stdErrorHandle = -12 stdOutHandle = ctypes.windll.kernel32.GetStdHandle(__stdOutputHandle) else: logging._levelToName = { CRITICAL: '\033[7;35;40mCRITICAL', ERROR: '\033[7;31;40mERROR', WARNING: '\033[7;33;40mWARNING', INFO: '\033[7;32;40mINFO', DEBUG: '\033[7;34;40mDEBUG', NOTSET: '\033[7;35;40mNOTSET', } sh = logging.StreamHandler(stream=sys.stdout) sh.setFormatter(formatter) def setCmdColor(color, handle=stdOutHandle): return ctypes.windll.kernel32.SetConsoleTextAttribute(handle, color) # 此处为日志配置 def resetCmdColor(): setCmdColor(__foreGroundRED | __foreGroundGREEN | __foreGroundBLUE) class DophonLogger: __foreGroundBLUE = 0x09 __foreGroundGREEN = 0x0a __foreGroundRED = 0x0c __foreGroundYELLOW = 0x0e def __init__(self, *args, **kwargs): self.logger = logging.getLogger(*args, **kwargs) if str(p_sys_type).upper() == 'WINDOWS': pass else: self.logger.addHandler(sh) self.logger.setLevel(logging.DEBUG) def info_str(self, message): result_str = message + '\033[0m' return result_str def warning_str(self, message): result_str = message + '\033[0m' return result_str def error_str(self, message): result_str = message + '\033[0m' return result_str def critical_str(self, message): result_str = message + '\033[0m' return result_str def debug_str(self, message): result_str = message + '\033[0m' return result_str def debug(self, *args): n_args = [] for arg in args: n_args.append(arg) msg = n_args.pop(0) message = msg % tuple(n_args) if str(p_sys_type).upper() == 'WINDOWS': setCmdColor(self.__foreGroundBLUE) self.logger.debug(msg=formatter.format(logging.LogRecord(msg=message))) resetCmdColor() else: self.logger.debug(msg=self.debug_str(message)) def info(self, *args): n_args = [] for arg in args: n_args.append(arg) msg = n_args.pop(0) message = msg % tuple(n_args) if str(p_sys_type).upper() == 'WINDOWS': self.__foreGroundGREEN self.logger.info(msg=message) resetCmdColor() else: self.logger.info(msg=self.info_str(message)) def warning(self, *args): n_args = [] for arg in args: n_args.append(arg) msg = n_args.pop(0) message = msg % tuple(n_args) if str(p_sys_type).upper() == 'WINDOWS': setCmdColor(self.__foreGroundYELLOW) self.logger.warning(msg=message) resetCmdColor() else: self.logger.warning(msg=self.warning_str(message)) def error(self, *args): n_args = [] for arg in args: n_args.append(arg) msg = n_args.pop(0) message = msg % tuple(n_args) if str(p_sys_type).upper() == 'WINDOWS': setCmdColor(self.__foreGroundRED) self.logger.error(msg=message) resetCmdColor() else: self.logger.error(msg=self.error_str(message)) def critical(self, *args): n_args = [] for arg in args: n_args.append(arg) msg = n_args.pop(0) message = msg % tuple(n_args) if str(p_sys_type).upper() == 'WINDOWS': setCmdColor(self.__foreGroundRED) self.logger.critical(msg=message) resetCmdColor() else: self.logger.critical(msg=self.critical_str(message)) def addFilter(self, *args, **kwargs): self.logger.addFilter(*args, **kwargs) def inject_logger(g: dict): # logger = logging.getLogger('dophon.' + re.sub('\..*', '', g['__file__'].split(os.path.sep)[-1])) logger = DophonLogger('dophon.' + re.sub('\..*', '', g['__file__'].split(os.path.sep)[-1])) logger.addFilter(DefFilter()) g['logger'] = logger PK!n dophon/pre_boot.py# coding: utf-8 from dophon import logger from dophon import properties import os, sys import xml.dom.minidom as dom logger.inject_logger(globals()) name_sep = '_' modules_list = [] def check_modules(): """ 加载框架配置模块 :return: """ logger.info('校验模块') modules_path = properties.project_root + '/module.xml' if os.path.exists(modules_path): with open(modules_path) as modules_file: modules_tree = dom.parse(modules_file) # print(modules_tree) modules_info = modules_tree.getElementsByTagName('module') # print(modules_info) for module_info in modules_info: pre_name = module_info.getElementsByTagName('pre-name') pre_name = pre_name[0].childNodes[0].data if pre_name and pre_name[0].childNodes else None name = module_info.getElementsByTagName('name') name = name[0].childNodes[0].data if name and name[0].childNodes else None version = module_info.getElementsByTagName('version') version = version[0].childNodes[0].data if version and version[0].childNodes else None module_name = ((pre_name + name_sep) if pre_name else '') + name module_code_str = ((pre_name + '.') if pre_name else '') + name # 添加模块到模块列表 modules_list.append(module_code_str) while True: try: # 校验模块安装 module = __import__(module_name) # 等待模块安装完成 sys.modules[module_code_str] = module break except Exception as e: # print(e) logger.info('install %s >=%s' % (module_name, version if version else 'release',)) # 利用pip模块安装所需模块 pip_arg_list = ['pip', 'install', module_name + (('>=' + version) if version else ''), '--user'] if not version: pip_arg_list.append('-U') raise ModuleNotFoundError( 'please use \"%s\" to install module %s ' % (' '.join(pip_arg_list), module_name)) PK!?U3 3 dophon/properties/__init__.py# coding: utf-8 """ 配置管理 启动前尝试获得自定义配置(application.py) 无法获取则使用默认配置 """ import sys import logging import re import os re_import_prop_flag = False def read_self_prop(): global re_import_prop_flag try: def_prop = __import__('dophon.def_prop.__init__', fromlist=True) u_prop = __import__('application', fromlist=True) # 对比配置文件 for name in dir(def_prop): if re.match('__.*__', name): continue if name in dir(u_prop): continue setattr(u_prop, name, getattr(def_prop, name)) sys.modules['properties'] = u_prop sys.modules['dophon.properties'] = u_prop except Exception as e: # 添加项目路径到环境变量 logging.info('添加项目路径到环境变量: %s' % (os.getcwd(),)) for (root, dirs, files) in os.walk(os.getcwd(), topdown=True): if 'application.py' in files: sys.path.append(root) break if not re_import_prop_flag: logging.info('重新引入配置') re_import_prop_flag = True read_self_prop() else: logging.warning('重新引入配置失败') sys.modules['properties'] = def_prop sys.modules['dophon.properties'] = def_prop raise e try: read_self_prop() except Exception as e: logging.error('没有找到自定义配置:(application.py)') logging.error('引用默认配置') logging.info('创建配置文件: application.py') def_prop = __import__('dophon.def_prop.default_properties', fromlist=True) with open(os.getcwd() + os.sep + 'application.py', 'wb') as app_prop: for name in dir(def_prop): if re.match('__.*__', name): continue else: value = getattr(def_prop, name) if type(value) is type(os): continue app_prop.write( bytes(name + '=' + re.sub('\\\\', '/', str(('\'' + value + '\'') if isinstance(value, str) else value)) + '\n', encoding='utf-8')) read_self_prop() PK!:U&-&-%dophon-1.2.11.post1.dist-info/LICENSE Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. PK!H9VWX#dophon-1.2.11.post1.dist-info/WHEEL A н#f."jm)!fb҅~ܴA,mTD}E n0H饹*|D[¬c i=0(q3PK!H4,&dophon-1.2.11.post1.dist-info/METADATAN0~ ?@) O@!5 8MM'*oV 喛=H[b$輴Fy 4 ؾ],%/K{CƶQkp?bu4mmm`OVcCKoպzX!wh?a%kvqCg+Pć?A R loEf+˽D6ζ /jpAN5:.'j2q=XL&t{pۛ/X=i7v̱70V&*)%PK!H;C#u$dophon-1.2.11.post1.dist-info/RECORDɲH}= ܂d^ ʆd!Q|Bʈ 6_?ĨQ= ]>`c9wM"e[tԻekeU*jb`o/*j4DC^Gt?Y^OmL+ҥFsLܬ #U]^َ$G8zHv1d$Xyv]K ,ifi;n \Nj8F3{'ʊTr{1vK;?sGЇUN~{^TWҪCݦsEH`^x:!?͉O: ̇ A\Y dNp}^bԓ4l;Ծc.I-I{&,{H=8lRz쇢ٿK4VϏPTx}uŪ.I.M^ى_lv,1gR[ս*HYm3FHxjʲ{7}>SWl0Nq n"bTVz[3p]g8 if~U2b:lX2єʔ@| H󼜛^XލT#x,WԘ9.йF0@1π8>HE@~E?E禮{驫].GO`Pd$ˌ5rfoURkwb= 㮝dvohɮz yYkg_\Z%[+nDW|O'ՆdP#Li"1Oimn0?PK!])  dophon/__init__.pyPK!WW=dophon/annotation/__init__.pyPK!hς)) dophon/annotation/AutoWired.pyPK!b!6dophon/annotation/req/__init__.pyPK!{Xaa!Hdophon/annotation/res/__init__.pyPK!E-E-^Mdophon/boot.pyPK!jNtzdophon/cluster_boot.pyPK!wSBBdophon/def_prop/__init__.pyPK!w11%sdophon/def_prop/default_properties.pyPK!빕ldophon/docker_boot.pyPK!ĻCSSdophon/logger/__init__.pyPK!n dophon/pre_boot.pyPK!?U3 3 |dophon/properties/__init__.pyPK!:U&-&-%dophon-1.2.11.post1.dist-info/LICENSEPK!H9VWX#Sdophon-1.2.11.post1.dist-info/WHEELPK!H4,&dophon-1.2.11.post1.dist-info/METADATAPK!H;C#u$Fdophon-1.2.11.post1.dist-info/RECORDPK