This commit is contained in:
Difrex 2015-07-28 10:07:28 +03:00
parent 4c89efd325
commit f77e27158e
2 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,8 @@
from Xlib import display
from time import sleep
from azot.logger import warning
# Get screen resolution
def get_geometry():
while 1:
@ -10,8 +12,7 @@ def get_geometry():
return {"x": width, "y": height}
except Exception, e:
print e
print "Spleep for 10 second"
warning(str(e) + '\n' + 'Spleep for 10 second')
sleep(10)
@ -23,6 +24,5 @@ def get_cursor_position():
return {'x': data['root_x'], 'y': data['root_y']}
except Exception, e:
print e
print "Spleep for 10 second"
warning(str(e) + '\n' + 'Spleep for 10 second')
sleep(10)

6
azot/logger.py Normal file
View File

@ -0,0 +1,6 @@
from __future__ import print_function
import sys
def warning(msg):
print("WARNING: ", msg, file=sys.stderr)