mirror of
https://gitlab.com/jeancf/twoot.git
synced 2024-11-27 14:01:13 +00:00
Normalised capitalisation of log file
This commit is contained in:
parent
920dcb4e6e
commit
6c11d39e6c
8
twoot.py
8
twoot.py
|
@ -553,8 +553,8 @@ def terminate(exit_code):
|
|||
max_delta = timedelta(TOML['options']['log_days'])
|
||||
|
||||
# Open log file
|
||||
log_file_name = TOML['config']['twitter_account'] + '.log'
|
||||
new_log_file_name = TOML['config']['twitter_account'] + '.log.new'
|
||||
log_file_name = TOML['config']['twitter_account'].lower() + '.log'
|
||||
new_log_file_name = TOML['config']['twitter_account'].lower() + '.log.new'
|
||||
try:
|
||||
log_file = open(log_file_name, 'r')
|
||||
except FileNotFoundError:
|
||||
|
@ -624,7 +624,7 @@ def main(argv):
|
|||
|
||||
# Setup logging to file
|
||||
logging.basicConfig(
|
||||
filename=TOML['config']['twitter_account'] + '.log',
|
||||
filename=TOML['config']['twitter_account'].lower() + '.log',
|
||||
format='%(asctime)s %(levelname)-8s %(message)s',
|
||||
datefmt='%Y-%m-%d %H:%M:%S',
|
||||
)
|
||||
|
@ -734,7 +734,7 @@ def main(argv):
|
|||
# Make soup
|
||||
soup = BeautifulSoup(twit_account_page.text, 'html.parser')
|
||||
|
||||
# Replace twit_account with version with correct capitalization
|
||||
# Replace twitter_account with version with correct capitalization
|
||||
ta = soup.find('meta', property='og:title').get('content')
|
||||
ta_match = re.search(r'\(@(.+)\)', ta)
|
||||
if ta_match is not None:
|
||||
|
|
Loading…
Reference in New Issue
Block a user