mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-02-17 13:58:11 +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'])
|
max_delta = timedelta(TOML['options']['log_days'])
|
||||||
|
|
||||||
# Open log file
|
# Open log file
|
||||||
log_file_name = TOML['config']['twitter_account'] + '.log'
|
log_file_name = TOML['config']['twitter_account'].lower() + '.log'
|
||||||
new_log_file_name = TOML['config']['twitter_account'] + '.log.new'
|
new_log_file_name = TOML['config']['twitter_account'].lower() + '.log.new'
|
||||||
try:
|
try:
|
||||||
log_file = open(log_file_name, 'r')
|
log_file = open(log_file_name, 'r')
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
@ -624,7 +624,7 @@ def main(argv):
|
||||||
|
|
||||||
# Setup logging to file
|
# Setup logging to file
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
filename=TOML['config']['twitter_account'] + '.log',
|
filename=TOML['config']['twitter_account'].lower() + '.log',
|
||||||
format='%(asctime)s %(levelname)-8s %(message)s',
|
format='%(asctime)s %(levelname)-8s %(message)s',
|
||||||
datefmt='%Y-%m-%d %H:%M:%S',
|
datefmt='%Y-%m-%d %H:%M:%S',
|
||||||
)
|
)
|
||||||
|
@ -734,7 +734,7 @@ def main(argv):
|
||||||
# Make soup
|
# Make soup
|
||||||
soup = BeautifulSoup(twit_account_page.text, 'html.parser')
|
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 = soup.find('meta', property='og:title').get('content')
|
||||||
ta_match = re.search(r'\(@(.+)\)', ta)
|
ta_match = re.search(r'\(@(.+)\)', ta)
|
||||||
if ta_match is not None:
|
if ta_match is not None:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user