mirror of
https://github.com/Lynnesbian/FediBooks/
synced 2024-11-25 08:38:59 +00:00
less log spam
This commit is contained in:
parent
6cfa9ef35f
commit
9830eeda6b
1 changed files with 9 additions and 8 deletions
|
@ -47,7 +47,7 @@ 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("""
|
||||
|
@ -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':
|
||||
|
@ -128,7 +128,7 @@ def make_post(args):
|
|||
# also format handles without instances, e.g. @user instead of @user@instan.ce
|
||||
post = re.sub(r"(?<!\S)@(\w+)", r"@{}\1".format(zws), post)
|
||||
|
||||
print(post)
|
||||
# print(post)
|
||||
visibility = bot['post_privacy'] if len(args) == 1 else args[2]
|
||||
visibilities = ['public', 'unlisted', 'private']
|
||||
if visibilities.index(visibility) < visibilities.index(bot['post_privacy']):
|
||||
|
@ -138,6 +138,7 @@ def make_post(args):
|
|||
post = "{} {}".format(acct, post)
|
||||
|
||||
# ensure post isn't longer than bot['length']
|
||||
# TODO: ehhhhhhhhh
|
||||
post = post[:bot['length']]
|
||||
# send toot!!
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue