diff options
author | carp <25677564+carp@users.noreply.github.com> | 2020-07-13 13:29:50 -0400 |
---|---|---|
committer | carp <25677564+carp@users.noreply.github.com> | 2020-07-13 13:29:50 -0400 |
commit | 3e7c2e260384a3e381f01717fd71a694b71cae6e (patch) | |
tree | 2e6a14546026baea5ef1b6267a30a3a2acd3d1e2 /bot.py | |
parent | d843c598deb492a53303cb18a0746584b6723dbf (diff) | |
download | yaoi-communism-3e7c2e260384a3e381f01717fd71a694b71cae6e.tar.gz yaoi-communism-3e7c2e260384a3e381f01717fd71a694b71cae6e.zip |
code format
Diffstat (limited to 'bot.py')
-rw-r--r-- | bot.py | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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()
|