telegram/openmamba_bot.py: update repositories list

This commit is contained in:
Silvan Calarco 2022-10-08 13:01:52 +02:00
parent e4fcd8d6cf
commit d85e5aae68

View File

@ -25,6 +25,7 @@ logger = logging.getLogger(__name__)
timers = dict()
social_log_last_ids = dict()
reps = [ 'devel', 'devel-makedist', 'devel-autodist', 'devel-kernel', 'devel-misc' ]
def start(update: Update, context: CallbackContext):
@ -57,9 +58,10 @@ def query(update: Update, context: CallbackContext):
logger.info("Query of %s: %s" % (user.first_name, update.message.text))
response = ""
for rep in [ 'devel', 'devel-games', 'devel-makedist', 'devel-autodist', 'devel-kernel', 'devel-misc', 'devel-kde4' ]:
for rep in reps:
conn = sqlite3.connect('/var/webbuild/db/%s-sources.db' % rep, check_same_thread=False)
cursor = conn.cursor()
print(rep)
cursor.execute(
'SELECT id,name,version,release,summary,url FROM sources where name like "%%%s%%" or summary like "%%%s%%" '
'ORDER BY name="%s" DESC, name like "%s%%" DESC, name like "%%%s%%" DESC limit 10'
@ -79,7 +81,7 @@ def details(update: Update, context: CallbackContext):
logger.info("Details of %s: %s" % (user.first_name, update.message.text))
response = ""
for rep in [ 'devel', 'devel-games', 'devel-makedist', 'devel-autodist', 'devel-kernel', 'devel-misc', 'devel-kde4' ]:
for rep in reps:
conn = sqlite3.connect('/var/webbuild/db/%s-sources.db' % rep, check_same_thread=False)
cursor = conn.cursor()
cursor.execute(