U Èo.a•ã@spdZddlZddlZddlZzddlmZWnddlmZYnXddlm Z dd„Z dd „Z d d d „Z dS) aM Tulip routine libraries, based on lambda's lamlib Author Twilight0 License summary below, for more details please read license.txt file This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . éN)Údbapi2é)ÚcontrolcOsúzJd}t|ƒ}t dd|¡}t ¡}|D]}| t|ƒ¡q(t| ¡ƒ}Wn YnXz |d}Wnd}YnXz’t  tj ¡t   tj ¡}| ¡} |  d|||f¡|  ¡} t| d d¡ƒ}t| dƒ} tt ¡ƒ} t| | ƒd t|ƒk} | d kr|WSWn YnXzJ||Ž}|dks4|gkrD|dksD|WS|dksX|gkr^|WSWnYdSXzZt|ƒ}tt ¡ƒ}|  d |¡|  d |||f¡|  d |||||f¡| ¡Wn YnXzt| d¡ƒWSYnXdS)Nú+.+\smethod\s|.+function\s|\sat\s.+|\sof\s.+ÚÚtableÚrel_listú2SELECT * FROM %s WHERE func = '%s' AND args = '%s'éúutf-8éiFzdCREATE TABLE IF NOT EXISTS %s (func TEXT, args TEXT, response TEXT, added TEXT, UNIQUE(func, args));z0DELETE FROM %s WHERE func = '%s' AND args = '%s'z"INSERT INTO %s Values (?, ?, ?, ?))ÚreprÚreÚsubÚhashlibÚmd5ÚupdateÚstrÚ hexdigestrÚmakeFileÚdataPathÚdatabaseÚconnectÚ cacheFileÚcursorÚexecuteÚfetchoneÚevalÚencodeÚintÚtimeÚabsÚcommit)ÚfunctionÚtimeoutÚargsrÚresponseÚfÚaÚiÚdbconÚdbcurÚmatchÚt1Út2rÚrÚt©r1ús/storage/emulated/0/Android/data/org.mmc.matrix/files/.kodi/addons/plugin.video.iptv.mmc/resources/modules/cache.pyÚget sb           r3c OsÔzJd}t|ƒ}t dd|¡}t ¡}|D]}| t|ƒ¡q(t| ¡ƒ}Wn YnXz |d}Wnd}YnXzJt  tj ¡t   tj ¡}| ¡}| d|||f¡| ¡} t| dƒWSYdSXdS)Nrrrrr r )r rrrrrrrrrrrrrrrrr) r#r%rr&r'r(r)r*r+r,r1r1r2r$\s.    r$cCsÌzºt ¡|dkrddg}nt|ƒtks.|g}t t d¡ d¡dd¡}|sRWdSt tj ¡}|  ¡}|D]6}z$|  d|¡|  d¡|  ¡WqjYqjXqjt  t d¡ d¡¡Wn YnXdS) NrZrel_libiÁvr rzDROP TABLE IF EXISTS %sÚVACUUMiÂv)rÚidleÚtypeÚlistZ yesnoDialogÚlangrrrrrrr"Ú infoDialog)rÚyesr*r+r0r1r1r2Úclearys*     r;)N) Ú__doc__rrr Úsqlite3rrZ pysqlite2rrr3r$r;r1r1r1r2Ús <