From 9830eeda6bf9ec45f7a946dc98678f2deeeb0ba3 Mon Sep 17 00:00:00 2001 From: Lynne Date: Mon, 20 Jan 2020 12:18:17 +1000 Subject: [PATCH] less log spam --- app/functions.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/functions.py b/app/functions.py index 9f76cc5..ffe913a 100644 --- a/app/functions.py +++ b/app/functions.py @@ -47,11 +47,11 @@ def make_post(args): passwd=cfg['db_pass'], db=cfg['db_name'] ) - print("Generating post for {}".format(handle)) + # print("Generating post for {}".format(handle)) dc = db.cursor(MySQLdb.cursors.DictCursor) c = db.cursor() dc.execute(""" - SELECT + SELECT learn_from_cw, length, fake_mentions, @@ -64,7 +64,7 @@ def make_post(args): FROM bots, credentials WHERE - bots.handle = %s + bots.handle = %s AND bots.credentials_id = credentials.id """, (handle,)) @@ -92,7 +92,7 @@ def make_post(args): # 4. join the list into a string separated by newlines posts = "\n".join(list(sum(c.fetchall(), ()))) if len(posts) == 0: - print("No posts to learn from.") + print("{} - No posts to learn from.".format(handle)) return if bot['fake_mentions'] == 'never': @@ -124,11 +124,11 @@ def make_post(args): if bot['fake_mentions_full']: post = re.sub(r"@(\w+)@([\w.]+)", r"@{}\1@{}\2".format(zws, zws), post) else: - post = re.sub(r"@(\w+)@([\w.]+)", r"@{}\1".format(zws), post) + post = re.sub(r"@(\w+)@([\w.]+)", r"@{}\1".format(zws), post) # also format handles without instances, e.g. @user instead of @user@instan.ce post = re.sub(r"(?