diff options
author | Britney Fransen <brfransen@gmail.com> | 2018-06-17 17:08:23 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2018-06-17 17:08:23 (GMT) |
commit | bef1f269596c44d6f7cdfbfc1bfa220061866a29 (patch) | |
tree | e8ab73c7ebd273b9d97a5d3eb1074c0d190b6658 /abs/core | |
parent | b36d08a3d75a3093bf2e174ad5ba49ab4cace160 (diff) | |
download | linhes_pkgbuild-bef1f269596c44d6f7cdfbfc1bfa220061866a29.zip linhes_pkgbuild-bef1f269596c44d6f7cdfbfc1bfa220061866a29.tar.gz linhes_pkgbuild-bef1f269596c44d6f7cdfbfc1bfa220061866a29.tar.bz2 |
LinHES-system: myth_status.py: adjust timezone for date math
Diffstat (limited to 'abs/core')
-rwxr-xr-x | abs/core/LinHES-system/PKGBUILD | 9 | ||||
-rw-r--r-- | abs/core/LinHES-system/myth_status.py | 19 |
2 files changed, 13 insertions, 15 deletions
diff --git a/abs/core/LinHES-system/PKGBUILD b/abs/core/LinHES-system/PKGBUILD index adfaef6..da24b73 100755 --- a/abs/core/LinHES-system/PKGBUILD +++ b/abs/core/LinHES-system/PKGBUILD @@ -1,13 +1,14 @@ pkgname=LinHES-system -pkgver=8.5.1 -pkgrel=3 +pkgver=8.5.2 +pkgrel=1 arch=('i686' 'x86_64') install=system.install pkgdesc="Everything that makes LinHES an automated system" license=('GPL2') depends=('linhes-sounds' 'xdotool' 'tilda' 'keylaunch' 'dvdbackup' 'python_aosd' 'udisks' 'LinHES-config>=2.3-59' 'sudo' - 'python2-dateutil' 'python2-dbus' 'unclutter' 'wmctrl' 'archlinux-xdg-menu' + 'python2-dateutil' 'python2-dbus' 'python2-tzlocal' 'unclutter' + 'wmctrl' 'archlinux-xdg-menu' 'ethtool' 'gnu-netcat' 'normalize' 'ttf-overlock' 'handbrake-cli' 'mkvtoolnix-cli' 'mplayer' 'runit-scripts>=8.1-12') backup=('etc/modprobe.d/alsa-base.conf' 'etc/X11/autostart/autostart.run') @@ -90,7 +91,7 @@ md5sums=('c6e6b83a1f4c35ef4501e277657ab2ac' '542e670e78d117657f93141e9689f54d' '8da6a7f1703a002f84e66629e847d8a6' 'bb72ab230c7a71706285bd0f31a4fb1f' - '7cc012ad0e71b40b4a376ab33a33c1cd' + '8e1404118dc7772fef9e3c7ca8811d03' '962a3e9eaba2d1466251b7ab0956705d' '1758aed160de64abfafb28a3a8f3390e' '33fbebbd546672cedd3c5e7350ab414e' diff --git a/abs/core/LinHES-system/myth_status.py b/abs/core/LinHES-system/myth_status.py index 0662f79..fbf8fdc 100644 --- a/abs/core/LinHES-system/myth_status.py +++ b/abs/core/LinHES-system/myth_status.py @@ -3,9 +3,10 @@ #Also will display alerts generated by xymon. If the location of xymon changes, this script needs to be updated. from MythTV import MythBE,MythDB,MythLog -import datetime,time,sys,subprocess,re +import datetime,pytz,re,subprocess,sys,time from dateutil.parser import parse -from dateutil import tz +from tzlocal import get_localzone + import os,glob from socket import gethostname; @@ -110,7 +111,8 @@ def print_alerts(): class tuner_recording_status: def __init__ (self,num_upcoming): - self.now = datetime.datetime.now() + self.now = datetime.datetime.now(pytz.utc) + self.currTZ = get_localzone() self.farout=99999999 self.next_start_diff=datetime.timedelta(self.farout) self.num_upcoming=num_upcoming @@ -176,7 +178,6 @@ class tuner_recording_status: a=self.be.getUpcomingRecordings() r=0 - currTZ = tz.tzlocal() for i in a: r += 1 if r > self.num_upcoming: @@ -184,14 +185,11 @@ class tuner_recording_status: title_chan="%s (%s)" %(i.title, i.channame) # convert timezone to local timezone start_time=parse(str(i.starttime)) - start_time=start_time.astimezone(currTZ) + start_time=start_time.astimezone(self.currTZ) start_time_out=start_time.strftime("%a %b %d %I:%M%p") self.upcoming_list.append([start_time_out,i.hostname, title_chan]) - #remove timezone - start_time=re.split("[-+]\d\d:\d\d",str(i.starttime))[0] - start_time_struct=datetime.datetime.strptime(start_time, "%Y-%m-%d %H:%M:%S") - diff = start_time_struct - self.now + diff = start_time - self.now if diff < self.next_start_diff : self.next_start_diff = diff @@ -230,13 +228,12 @@ class tuner_recording_status: def conflicts(self): a=self.be.getConflictedRecordings() - currTZ = tz.tzlocal() for i in a: out_line='' title_chan="%s (%s)" %(i.title, i.channame) # convert timezone to local timezone start_time=parse(str(i.starttime)) - start_time=start_time.astimezone(currTZ) + start_time=start_time.astimezone(self.currTZ) start_time_out=start_time.strftime("%a %b %d %I:%M%p") out_line=(start_time_out,i.hostname,title_chan) self.conflict_list.append(out_line) |