def main(): today = None prayer_times = {} while True: if check_prayer_now(prayer_times): mute_unmute(300) if not check_date(today): today = datetime.datetime.now().date() request = send_request_console() prayer_times = get_prayer_times(request['data']['timings']) # Printing Date and Prayer times for the user print(''.join(['=' for i in range(20)])) print(f'Date: {today}') print(''.join(['-' for i in range(len(str(today)) + 6)])) print('Prayer Times: ') print(''.join(['-' for i in range(len('Prayer Times: '))])) for i, j in prayer_times.items(): print('{}: {}'.format(i, str(j))) sleep(15)
def test_check_date_fail(): assert not check.check_date("Feb 18-20, 2525")
def test_check_date(): assert check.check_date(date(2525, 2, 20))
# line 7 if len(author) != 0: aa = author.split(',') if len(aa) > 1: author = ','.join(aa[:-1]) elif len(aa) == 0: author = 'Noun Noun' else: author = 'Noun Noun' data_print[url]['author'] = fmt.formatted_author(author, ',') # line 8 data_print[url]['content'] = fmt.formatted_content(text) # line 9 #data_print[url[i]]['content2'] = fmt.formatted_content(text) print('■', end='', flush=True) print("\nThere are " + str(len(data_print) + previous_len) + " articles...") print("Updated " + str(len(data_print)) + " articles...") if __name__ == "__main__": data_base = {} data_print = {} check.load_previous(data_base) date = check.check_date(data_base, 'tax_reform') cbs(data_base, data_print, 'health%20reform', 0) import output_file output_file.output(data_base)