summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/idle.py
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2014-08-17 23:06:37 (GMT)
committerJames Meyer <james.meyer@operamail.com>2014-08-17 23:06:37 (GMT)
commit9b93d67c55bb90ec0a1f4ea2b4a8cf04f7b1fb47 (patch)
tree325f9d77882b8848bfa2f1ebc21c407b9a68e73d /abs/core/LinHES-system/idle.py
parent03be181cda2353fc29541712759d8044e2743da5 (diff)
downloadlinhes_pkgbuild-9b93d67c55bb90ec0a1f4ea2b4a8cf04f7b1fb47.zip
linhes_pkgbuild-9b93d67c55bb90ec0a1f4ea2b4a8cf04f7b1fb47.tar.gz
linhes_pkgbuild-9b93d67c55bb90ec0a1f4ea2b4a8cf04f7b1fb47.tar.bz2
LinHES-system: add idle check for Standby mode in idle.py
If Standby mode is detected the it's assumed the FE is idle.
Diffstat (limited to 'abs/core/LinHES-system/idle.py')
-rwxr-xr-xabs/core/LinHES-system/idle.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/abs/core/LinHES-system/idle.py b/abs/core/LinHES-system/idle.py
index 6b813b4..4575e7d 100755
--- a/abs/core/LinHES-system/idle.py
+++ b/abs/core/LinHES-system/idle.py
@@ -48,7 +48,7 @@ def dailywake_check(cmdargs,cursor):
print "error"
return True
- # Check for time periods that cross midnight
+ # Check for time periods that cross midnight
if (p1End < p1Start):
if (now > p1End):
p1End = p1End + timedelta(days=1)
@@ -188,7 +188,7 @@ def userlogins_check(cmdargs):
msg(cmdargs," Checking for users logged in...")
users=subprocess.check_output("who")
names=([x.split() for x in users.splitlines()])
- for i in names:
+ for i in names:
if (i[0] == "mythtv" and i[4] == "(:0)"):
msg(cmdargs," Ignoring %s %s" %(i[0],i[4]))
else:
@@ -202,6 +202,9 @@ def userlogins_check(cmdargs):
return True
def mythfe_check(cmdargs,cursor,mythDB):
+ #checks to see if a frontend is considered idle
+ # True means FE is idle
+
if ( cmdargs.runningfe ):
msg(cmdargs," Checking for running and playing mythfrontends...")
else:
@@ -216,11 +219,16 @@ def mythfe_check(cmdargs,cursor,mythDB):
for i in frontends:
try:
msg(cmdargs," Checking %s's mythfrontend status..." %i)
- frontend = mythDB.getFrontend(''.join(i))
+ frontend = mythDB.getFrontend(''.join(i))
if ( cmdargs.runningfe ):
msg(cmdargs," %s's mythfrontend is RUNNING." %i)
return False
- location = frontend.sendQuery('Location')
+ location = frontend.sendQuery('Location')
+
+ if location == "standbymode":
+ msg(cmdargs," %s's mythfrontend is in StandbyMode." %i)
+ return True
+
if ( location.startswith('Playback ') ):
msg(cmdargs," %s's mythfrontend is PLAYING." %i)
return False
@@ -229,6 +237,7 @@ def mythfe_check(cmdargs,cursor,mythDB):
if '.xml' in location or 'mainmenu' in location:
msg(cmdargs," %s's mythfrontend is in MENUS." %i)
else:
+ #FE is not in menus, so it must be active in a plugin
msg(cmdargs," %s's mythfrontend is NOT in menus." %i)
return False
except: