This commit is contained in:
yumoqing 2024-02-18 18:23:40 +08:00
parent 9cd3bfe539
commit 21143f0138
3 changed files with 6 additions and 6 deletions

View File

@ -136,7 +136,7 @@ class TemplateProcessor(BaseProcessor):
url = self.resource.entireUrl(request, path) url = self.resource.entireUrl(request, path)
ns = self.run_ns ns = self.run_ns
te = self.run_ns['tmpl_engine'] te = self.run_ns['tmpl_engine']
print(f'{url=}, {path=}') # print(f'{url=}, {path=}')
# return await te.render(url,**ns) # return await te.render(url,**ns)
return await te.render(path,**ns) return await te.render(path,**ns)
@ -155,7 +155,7 @@ class TemplateProcessor(BaseProcessor):
class BricksUIProcessor(TemplateProcessor): class BricksUIProcessor(TemplateProcessor):
@classmethod @classmethod
def isMe(self,name): def isMe(self,name):
print(f'{name=} is a bui') # print(f'{name=} is a bui')
return name=='bui' return name=='bui'
async def datahandle(self, request): async def datahandle(self, request):
@ -215,7 +215,7 @@ class MarkdownProcessor(BaseProcessor):
mdtxt) mdtxt)
def getProcessor(name): def getProcessor(name):
print(f'getProcessor({name})') # print(f'getProcessor({name})')
return _getProcessor(BaseProcessor, name) return _getProcessor(BaseProcessor, name)
def _getProcessor(kclass,name): def _getProcessor(kclass,name):

View File

@ -18,7 +18,7 @@ class TmplLoader(BaseLoader, TmplUrl2File):
coding = config.website.coding coding = config.website.coding
fp = self.url2file(template) fp = self.url2file(template)
print(f'{template=} can not transfer to filename') # print(f'{template=} can not transfer to filename')
if not os.path.isfile(fp): if not os.path.isfile(fp):
raise TemplateNotFound(template) raise TemplateNotFound(template)
mtime = os.path.getmtime(fp) mtime = os.path.getmtime(fp)

View File

@ -324,7 +324,7 @@ class ProcessorResource(AppLogger, StaticResource,Url2File):
if not config.website.allowListFolder: if not config.website.allowListFolder:
self.error('%s:not found' % str(request.url)) self.error('%s:not found' % str(request.url))
raise HTTPNotFound raise HTTPNotFound
print(f'{self.request_filename=}, {str(request.url)=} handle as a normal file') # print(f'{self.request_filename=}, {str(request.url)=} handle as a normal file')
return await super()._handle(request) return await super()._handle(request)
def gethost(self, request): def gethost(self, request):
@ -416,7 +416,7 @@ class ProcessorResource(AppLogger, StaticResource,Url2File):
async def path_call(self, request, path, params={}): async def path_call(self, request, path, params={}):
url = self.entireUrl(request, path) url = self.entireUrl(request, path)
print(f'{path=}, after entireUrl(), {url=}') # print(f'{path=}, after entireUrl(), {url=}')
fpath = self.url2file(url) fpath = self.url2file(url)
processor = self.url2processor(request, url, fpath) processor = self.url2processor(request, url, fpath)
new_request = request.clone(rel_url=url) new_request = request.clone(rel_url=url)