Fix the style to be more compliant with Python 2.7's general style for executables.

This also enables the user to import autorotate.py as a library, although why
anyone would want to do that is beyond me.
This commit is contained in:
Elf M. Sternberg 2017-11-16 13:38:01 -08:00
parent 8e8162a76b
commit ea81a9d141
1 changed files with 40 additions and 33 deletions

View File

@ -73,6 +73,10 @@ def is_in(pen):
return (res and res.group(1).lower() == 'in') return (res and res.group(1).lower() == 'in')
def manage_orientation_and_palm_rejection(options):
current_orientation = ''
currently_proximate = False
while True: while True:
int_displays = countdisplays() int_displays = countdisplays()
time.sleep(1.0/freq) time.sleep(1.0/freq)
@ -108,3 +112,6 @@ while True:
print "%s palm rejection" % ("Activating" if pen_status else "Deactivating") print "%s palm rejection" % ("Activating" if pen_status else "Deactivating")
currently_proximate = pen_status currently_proximate = pen_status
os.system("xinput %s '%s'" % (xinput_statemap[pen_status], devicename)) os.system("xinput %s '%s'" % (xinput_statemap[pen_status], devicename))
if __name__ == '__main__':
manage_orientation_and_palm_rejection(sys.argv[1:])