aboutsummaryrefslogtreecommitdiffstats
path: root/bot.py
diff options
context:
space:
mode:
authorcarp <25677564+carp@users.noreply.github.com>2020-07-13 13:29:50 -0400
committercarp <25677564+carp@users.noreply.github.com>2020-07-13 13:29:50 -0400
commit3e7c2e260384a3e381f01717fd71a694b71cae6e (patch)
tree2e6a14546026baea5ef1b6267a30a3a2acd3d1e2 /bot.py
parentd843c598deb492a53303cb18a0746584b6723dbf (diff)
downloadyaoi-communism-3e7c2e260384a3e381f01717fd71a694b71cae6e.tar.gz
yaoi-communism-3e7c2e260384a3e381f01717fd71a694b71cae6e.zip
code format
Diffstat (limited to 'bot.py')
-rw-r--r--bot.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/bot.py b/bot.py
index 4f3eb63..ff27cda 100644
--- a/bot.py
+++ b/bot.py
@@ -13,6 +13,7 @@ import random
import os
from api import consumer_key, consumer_secret, access_token, access_token_secret
from datetime import datetime
+
twitter = Twython(consumer_key, consumer_secret, access_token, access_token_secret)
@@ -31,7 +32,9 @@ def post():
lines = messages_multiline(text, font, image) # split up lines for text wrapping
colors = get_colors(image.filename) # get colors
- (x, y,faces) = randomize_location(image, lines, font) # where to start drawing text
+ (x, y, faces) = randomize_location(
+ image, lines, font
+ ) # where to start drawing text
for line in lines:
height = font.getsize(line[1])[1]
@@ -46,7 +49,10 @@ def post():
twitter.update_status(status=message, media_ids=[response["media_id"]])
photo.close()
os.remove(photo.name)
- with open("log","a") as f:
- f.write(f"{datetime.now().strftime('%d-%m-%Y %H:%M:%S')}\t{filename}\t({image.size[0]} {image.size[1]})\t{font.size} ({max((font.size // 25), 2)})\t{text}\n")
+ with open("log", "a") as f:
+ f.write(
+ f"{datetime.now().strftime('%d-%m-%Y %H:%M:%S')}\t{filename}\t({image.size[0]} {image.size[1]})\t{font.size} ({max((font.size // 25), 2)})\t{text}\n"
+ )
+
post()