From de575af543dfcd47844966a0868dde4cf3ac7d82 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 13 Jan 2022 00:18:50 +0800 Subject: [PATCH] bugfix --- ahserver/crudProcessor.py | 45 ----------------------------------- ahserver/processorResource.py | 1 - 2 files changed, 46 deletions(-) delete mode 100644 ahserver/crudProcessor.py diff --git a/ahserver/crudProcessor.py b/ahserver/crudProcessor.py deleted file mode 100644 index d487bd8..0000000 --- a/ahserver/crudProcessor.py +++ /dev/null @@ -1,45 +0,0 @@ - -import os -import codecs -from aiohttp.web_exceptions import ( -HTTPException -) -import ujson as json -from .baseProcessor import BaseProcessor -from crud_engine.crud_engine import CRUDEngine - -class CrudProcessor(BaseProcessor): - @classmethod - def isMe(self, name): - return name == 'crud' - - def get_default_filter_data(self): - subffix = '.filterdata' - user = self.run_evn.get('user') - if user: - subffix = f'{subffix}.{user}' - f = f'{self.real_path}{subffix}' - if os.path.exists(f): - with codecs.open(f, 'r', 'utf-8') as ff: - d = json.load(ff) - return d - return None - - async def path_call(self, request, params={}): - await self.set_run_env(request) - dic = {} - with codecs.open(self.real_path, 'r', 'utf-8') as f: - dic = json.load(f) - x = request.path.split('/') - if len(x) >= 2: - act = x[-2] - if not CRUDEngine.is_legal_cmd(act): - act = CRUDEngine.defaultcmd() - default_filter_data = self.get_default_filter_data() - ce = CRUDEngine(self.resource, dic, default_filter_data) - return await ce.dispatch(act) - raise HttpException(555) - - async def datahandle(self, request): - self.content = await self.path_call(request) - diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index 8d34301..ba67218 100644 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -33,7 +33,6 @@ from appPublic.timecost import TimeCost from appPublic.timeUtils import timestampstr from .baseProcessor import getProcessor -from .crudProcessor import CrudProcessor from .xlsxdsProcessor import XLSXDataSourceProcessor from .sqldsProcessor import SQLDataSourceProcessor from .functionProcessor import FunctionProcessor