Skip to content

Commit

Permalink
Merge pull request #12 from CaioMadeira/hotfix-3.2.1
Browse files Browse the repository at this point in the history
Hotfix - 3.2.1
  • Loading branch information
rodrigoTcarmo authored Jan 16, 2022
2 parents f48f088 + 33aa3cd commit 550cbf0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ posting_account = "Oficial"
#::::::::::::::::::::::::::::::

# IMPORTANTE! Caminho onde o programa vai ler e pegar o log mais recente
log_file_path = r"C:\Users\rodri\Documents\GitHub\The-Philosopher-BOT\Logs\Twitter\logs_hashtag\INFO"
log_file_path = r"C:\Users\PhilosopherBOT\Documents\The-Philosopher-BOT\Logs\Twitter\logs_hashtag\INFO"

# Caminho onde os logs desses proprio programa serão gravados
log_app_path = r"C:\Users\rodri\Documents\GitHub\The-Philosopher-BOT\PhiloWATCH\Logs_pw"
log_app_path = r"C:\Users\PhilosopherBOT\Documents\The-Philosopher-BOT\PhiloWATCH\Logs_pw"

# Localização do script que inicia o BOT efetivamente, para que o programa possa iniciar sozinho.
script_location = r"C:\Users\rodri\Documents\GitHub\The-Philosopher-BOT\init_twitter_hashtag_test.py"
script_location = r"C:\Users\PhilosopherBOT\Documents\The-Philosopher-BOT\init_twitter_hashtag.py"

# Localização do projeto principal
project_location = r"C:\Users\rodri\Documents\GitHub\The-Philosopher-BOT"
project_location = r"C:\Users\PhilosopherBOT\Documents\The-Philosopher-BOT"

# Tempo de tolerancia em minutos que o programa vai aceitar que o BOT fique sem escrever no log.
tolerance_time = 30
Expand Down
6 changes: 3 additions & 3 deletions Twitter/Hashtag/philobot_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from PIL import Image, ImageFont
from Twitter.Hashtag.functionalities import Functionalities
from Lists.img_list import PHILOSOPHERS_LIST
from Templates.New_Img_Manipulation.path_reference import TEMPLATES_PATH
from Templates.New_Img_Manipulation.path_reference import template_folder_reference
# from Logs.Twitter.log_engine import log_hashtag


Expand All @@ -23,7 +23,7 @@ def philobot_engine(self, get_hashtag_list, LOG):

last_id = self.q.pop(0)
self.log.info('ID Coletado: ' + last_id)
self.img = Image.open(f'{TEMPLATES_PATH}/layer_1.png')
self.img = Image.open(f'{template_folder_reference}/background_image.png')
txt = "Font/myriad.otf"
self.fontsize = 1
blank = Image.new('RGB', (269, 194))
Expand Down Expand Up @@ -145,6 +145,6 @@ def img_adjust(self):
philosopher_str_to_obj = Image.open(self.choice_philosopher)
self.img_2 = philosopher_str_to_obj.resize((449, 584))
self.img.paste(self.img_2, (629, 0))
smooth_template = Image.open(f'{TEMPLATES_PATH}/layer_3.png')
smooth_template = Image.open(f'{template_folder_reference}/smooth_background.png')
self.img.paste(smooth_template, (0, 0), smooth_template)

6 changes: 3 additions & 3 deletions Twitter/Hashtag/philomaker_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from urllib import request
from PIL import Image, ImageFont
from Lists.error_img_list import PHILOMAKER_ERROR_IMAGE_COLLECTION
from Templates.New_Img_Manipulation.path_reference import TEMPLATES_PATH
from Templates.New_Img_Manipulation.path_reference import template_folder_reference
from Logs.Twitter.logger_hashtag import log_hashtag
import os
from Twitter.Hashtag.functionalities import Functionalities
Expand All @@ -31,7 +31,7 @@ def philomaker_engine(self, get_hashtag_list):
blank = Image.new('RGB', (269, 194))
font = ImageFont.truetype("Font/myriad.otf", fontsize)
font2 = ImageFont.truetype("Font/times.ttf")
self.img = Image.open(f'{TEMPLATES_PATH}/layer_1.png')
self.img = Image.open(f'{template_folder_reference}/layer_1.png')

" GET TWEET TEXT ========================================================================= "
try:
Expand Down Expand Up @@ -102,7 +102,7 @@ def philomaker_engine(self, get_hashtag_list):
philosopher = Image.open('Hashtag/twitter_philo_img.png')
img_2 = philosopher.resize((449, 584))
self.img.paste(img_2, (629, 0))
smooth_template = Image.open(f'{TEMPLATES_PATH}/layer_3.png')
smooth_template = Image.open(f'{template_folder_reference}/layer_3.png')
self.img.paste(smooth_template, (0, 0), smooth_template)

" CHECK QUOTES ========================================================================= "
Expand Down
Binary file added init_philowatch.exe
Binary file not shown.
1 change: 0 additions & 1 deletion init_twitter_posting.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def check_last_post(self, api, account):
self.log.info(last_tweet)
self.log.info('[OK] - Success!\n')


self.log.info(f'[!] - Checking if the last post happened more than {self.POST_TIME} hours ago...')
the_moment = datetime.datetime.now()
tweet_time = last_tweet.created_at.replace(tzinfo=datetime.timezone.utc).astimezone(tz=None).replace(
Expand Down
1 change: 1 addition & 0 deletions run_posting.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C:\Users\PhilosopherBOT\AppData\Local\Programs\Python\Python39\python.exe init_twitter_posting.py

0 comments on commit 550cbf0

Please sign in to comment.