mirror of https://gitlab.com/bashrc2/epicyon
Not case sensitive
parent
863bf90e25
commit
f22647fa3a
|
@ -100,7 +100,7 @@ def _receive_calendar_events(base_dir: str, nickname: str, domain: str,
|
|||
handle = following_nickname + '@' + following_domain
|
||||
|
||||
# check that you are following this handle
|
||||
if not _text_in_file2(handle + '\n', following_filename):
|
||||
if not _text_in_file2(handle + '\n', following_filename, False):
|
||||
print('WARN: ' + handle + ' is not in ' + following_filename)
|
||||
return
|
||||
|
||||
|
@ -137,25 +137,14 @@ def _receive_calendar_events(base_dir: str, nickname: str, domain: str,
|
|||
print('EX: unable to write ' + calendar_filename)
|
||||
|
||||
# already in the calendar file?
|
||||
if handle + '\n' in following_handles:
|
||||
if handle + '\n' in following_handles or \
|
||||
handle + '\n' in following_handles.lower():
|
||||
print(handle + ' exists in followingCalendar.txt')
|
||||
if add:
|
||||
# already added
|
||||
return
|
||||
# remove from calendar file
|
||||
following_handles = following_handles.replace(handle + '\n', '')
|
||||
try:
|
||||
with open(calendar_filename, 'w+',
|
||||
encoding='utf-8') as fp_cal:
|
||||
fp_cal.write(following_handles)
|
||||
except OSError:
|
||||
print('EX: _receive_calendar_events 3 ' + calendar_filename)
|
||||
elif handle + '\n' in following_handles.lower():
|
||||
print(handle + ' exists in followingCalendar.txt')
|
||||
if add:
|
||||
# already added
|
||||
return
|
||||
# remove from calendar file
|
||||
following_handles = \
|
||||
following_handles.replace(handle.lower() + '\n', '')
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue