indent with tabs, and prevent TB when ctypes modules is not found.
This commit is contained in:
parent
3567a8c20f
commit
0b035ee6cc
1 changed files with 29 additions and 28 deletions
|
@ -37,8 +37,7 @@ try:
|
|||
GetLastInputInfo = ctypes.windll.user32.GetLastInputInfo
|
||||
|
||||
class LASTINPUTINFO(ctypes.Structure):
|
||||
_fields_ = [('cbSize', ctypes.c_uint),
|
||||
('dwTime', ctypes.c_uint)]
|
||||
_fields_ = [('cbSize', ctypes.c_uint), ('dwTime', ctypes.c_uint)]
|
||||
|
||||
lastInputInfo = LASTINPUTINFO()
|
||||
lastInputInfo.cbSize = ctypes.sizeof(lastInputInfo)
|
||||
|
@ -62,6 +61,9 @@ class SleepyWindows:
|
|||
|
||||
def poll(self):
|
||||
'''checks to see if we should change state'''
|
||||
if not SUPPORTED:
|
||||
return False
|
||||
|
||||
idleTime = self.getIdleSec()
|
||||
|
||||
# xa is stronger than away so check for xa first
|
||||
|
@ -80,7 +82,6 @@ class SleepyWindows:
|
|||
self.state = val
|
||||
|
||||
class SleepyUnix:
|
||||
|
||||
def __init__(self, away_interval = 60, xa_interval = 120):
|
||||
self.away_interval = away_interval
|
||||
self.xa_interval = xa_interval
|
||||
|
|
Loading…
Add table
Reference in a new issue