This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydal import DAL | |
from voodoodal import DB, Table, Field, model | |
import aiosqlite | |
import asyncio | |
# async sqlexecuter | |
class SQLExecuter: | |
def __init__(self, pydal_adapter, adb_executer): | |
self.adb_executer = adb_executer | |
self.adapter = pydal_adapter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fake table in which result of recursive select will be temporary stored | |
# id-values will be inherited from parent_child table | |
db.define_table('entry_collector', | |
Field('child', 'integer'), | |
Field('xpath', 'json'), # array of ids, xpath[0] == root, xpath[-1] == child | |
Field('root', 'integer'), | |
Field('xdepth', 'integer'), | |
migrate_enabled = False, | |
fake_migrate = True | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def txt_split(s): | |
import re | |
indx_srch = '<[a-z0-9 ]+>' | |
txt_frags = re.split(indx_srch, s) | |
indx_lst = re.findall(indx_srch,s) | |
ret=[] | |
ret.extend(re.split(' +', txt_frags[0])) | |
for i,indx in enumerate( indx_lst): | |
if ret[-1]=='': |