mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
9d2c831c15
commit
2da3b42314
|
@ -8,6 +8,7 @@ __status__ = "Production"
|
|||
__module_group__ = "Calendar"
|
||||
|
||||
import os
|
||||
from utils import acct_dir
|
||||
|
||||
|
||||
def _text_in_file2(text: str, filename: str,
|
||||
|
@ -32,7 +33,7 @@ def _text_in_file2(text: str, filename: str,
|
|||
def _dir_acct(base_dir: str, nickname: str, domain: str) -> str:
|
||||
"""Returns the directory of an account
|
||||
"""
|
||||
return base_dir + '/accounts/' + nickname + '@' + domain
|
||||
return acct_dir(base_dir, nickname, domain)
|
||||
|
||||
|
||||
def _port_domain_remove(domain: str) -> str:
|
||||
|
|
4
utils.py
4
utils.py
|
@ -3816,7 +3816,7 @@ def get_account_timezone(base_dir: str, nickname: str, domain: str) -> str:
|
|||
"""Returns the timezone for the given account
|
||||
"""
|
||||
tz_filename = \
|
||||
base_dir + '/accounts/' + nickname + '@' + domain + '/timezone.txt'
|
||||
acct_dir(base_dir, nickname, domain) + '/timezone.txt'
|
||||
if not os.path.isfile(tz_filename):
|
||||
return None
|
||||
timezone = None
|
||||
|
@ -3830,7 +3830,7 @@ def set_account_timezone(base_dir: str, nickname: str, domain: str,
|
|||
"""Sets the timezone for the given account
|
||||
"""
|
||||
tz_filename = \
|
||||
base_dir + '/accounts/' + nickname + '@' + domain + '/timezone.txt'
|
||||
acct_dir(base_dir, nickname, domain) + '/timezone.txt'
|
||||
timezone = timezone.strip()
|
||||
with open(tz_filename, 'w+', encoding='utf-8') as fp_timezone:
|
||||
fp_timezone.write(timezone)
|
||||
|
|
|
@ -2158,9 +2158,9 @@ def _html_edit_notifications(base_dir: str, nickname: str, domain: str,
|
|||
ntfy_topic = ''
|
||||
|
||||
ntfy_url_file = \
|
||||
base_dir + '/accounts/' + nickname + '@' + domain + '/.ntfy_url'
|
||||
acct_dir(base_dir, nickname, domain) + '/.ntfy_url'
|
||||
ntfy_topic_file = \
|
||||
base_dir + '/accounts/' + nickname + '@' + domain + '/.ntfy_topic'
|
||||
acct_dir(base_dir, nickname, domain) + '/.ntfy_topic'
|
||||
if os.path.isfile(ntfy_url_file):
|
||||
try:
|
||||
with open(ntfy_url_file, 'r', encoding='utf-8') as fp_ntfy:
|
||||
|
|
Loading…
Reference in New Issue