Removed the re.sub() statement and used lstrip() instead. This should be much lighter on resources and provide the same functionality.

This commit is contained in:
Storm Dragon 2021-06-12 16:16:17 -04:00
parent f7aca66aa4
commit e8f5b8b853

View File

@ -1,6 +1,5 @@
#!/bin/python #!/bin/python
import time import time
import re
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Fenrir TTY screen reader # Fenrir TTY screen reader
@ -64,7 +63,7 @@ class command():
if presentTime: if presentTime:
# present the time # present the time
self.env['runtime']['outputManager'].presentText(_("It's {0}").format(re.sub('^0', '', timeString).replace(':00', " O'clock ")), soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(_("It's {0}").format(timeString.replace(':00', " O'clock ").lstrip('0')), soundIcon='', interrupt=False)
# and date if changes # and date if changes
if presentDate: if presentDate:
self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=False) self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=False)