telegram/openmamba_bot.py: update repositories list
This commit is contained in:
parent
e4fcd8d6cf
commit
d85e5aae68
@ -25,6 +25,7 @@ logger = logging.getLogger(__name__)
|
|||||||
timers = dict()
|
timers = dict()
|
||||||
social_log_last_ids = dict()
|
social_log_last_ids = dict()
|
||||||
|
|
||||||
|
reps = [ 'devel', 'devel-makedist', 'devel-autodist', 'devel-kernel', 'devel-misc' ]
|
||||||
|
|
||||||
def start(update: Update, context: CallbackContext):
|
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))
|
logger.info("Query of %s: %s" % (user.first_name, update.message.text))
|
||||||
|
|
||||||
response = ""
|
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)
|
conn = sqlite3.connect('/var/webbuild/db/%s-sources.db' % rep, check_same_thread=False)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
print(rep)
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
'SELECT id,name,version,release,summary,url FROM sources where name like "%%%s%%" or summary like "%%%s%%" '
|
'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'
|
'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))
|
logger.info("Details of %s: %s" % (user.first_name, update.message.text))
|
||||||
|
|
||||||
response = ""
|
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)
|
conn = sqlite3.connect('/var/webbuild/db/%s-sources.db' % rep, check_same_thread=False)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
|
Loading…
Reference in New Issue
Block a user