diff options
Diffstat (limited to 'linhes/linhes-web/website/contents/count.py')
-rw-r--r-- | linhes/linhes-web/website/contents/count.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/linhes/linhes-web/website/contents/count.py b/linhes/linhes-web/website/contents/count.py index d5f3259..2aaa3e1 100644 --- a/linhes/linhes-web/website/contents/count.py +++ b/linhes/linhes-web/website/contents/count.py @@ -9,11 +9,8 @@ import socket def main(argv): #get LinHES version - verfile = open('/etc/os-release', 'r') - for line in verfile: - if line.startswith('PRETTY_NAME'): - verLHlist = line.split('"') - verLH = verLHlist[1] + verfile = open('/etc/LinHES-release', 'r') + verLH = verfile.read() verfile.close() grandtotal=0 @@ -34,8 +31,10 @@ def main(argv): grandtotal+=total hours = grandtotal / 60.0 days = hours / 24.0 - - cursor.execute("SELECT unix_timestamp(starttime),unix_timestamp(endtime),title FROM recorded where not (recgroup=(%s)) ORDER by starttime",("LiveTV")) + try: + cursor.execute("SELECT unix_timestamp(starttime),unix_timestamp(endtime),title FROM recorded where not (recgroup=(%s)) ORDER by starttime",("LiveTV")) + except: + pass result_current = cursor.fetchall() for row in result_current: start=row[0] |