From e8f5b8b85373aff3d61cfd70c0b56067d0e4257c Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 12 Jun 2021 16:16:17 -0400 Subject: [PATCH] Removed the re.sub() statement and used lstrip() instead. This should be much lighter on resources and provide the same functionality. --- src/fenrirscreenreader/commands/onHeartBeat/76000-time.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/fenrirscreenreader/commands/onHeartBeat/76000-time.py b/src/fenrirscreenreader/commands/onHeartBeat/76000-time.py index 1ffcbaf8..e5237241 100755 --- a/src/fenrirscreenreader/commands/onHeartBeat/76000-time.py +++ b/src/fenrirscreenreader/commands/onHeartBeat/76000-time.py @@ -1,6 +1,5 @@ #!/bin/python import time -import re # -*- coding: utf-8 -*- # Fenrir TTY screen reader @@ -64,7 +63,7 @@ class command(): if presentTime: # 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 if presentDate: self.env['runtime']['outputManager'].presentText(dateString , soundIcon='', interrupt=False)