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:
parent
8e8162a76b
commit
ea81a9d141
|
@ -73,6 +73,10 @@ def is_in(pen):
|
|||
return (res and res.group(1).lower() == 'in')
|
||||
|
||||
|
||||
def manage_orientation_and_palm_rejection(options):
|
||||
current_orientation = ''
|
||||
currently_proximate = False
|
||||
|
||||
while True:
|
||||
int_displays = countdisplays()
|
||||
time.sleep(1.0/freq)
|
||||
|
@ -108,3 +112,6 @@ while True:
|
|||
print "%s palm rejection" % ("Activating" if pen_status else "Deactivating")
|
||||
currently_proximate = pen_status
|
||||
os.system("xinput %s '%s'" % (xinput_statemap[pen_status], devicename))
|
||||
|
||||
if __name__ == '__main__':
|
||||
manage_orientation_and_palm_rejection(sys.argv[1:])
|
||||
|
|
Loading…
Reference in New Issue