11#! /bin/env python
22"""
3- Complete x,y sACN trigger.
4- Callibration script.
3+ Complete x,y sACN trigger.
4+ Callibration script.
55"""
6+
67import pypsn
78
89X = 0
1213
1314def set_settings_from_file (old_settings ):
1415 """
15- Update global settings from file.
16+ Update global settings from file.
1617
1718 """
1819 try :
@@ -23,19 +24,13 @@ def set_settings_from_file(old_settings):
2324 if len (uni_line ) < 1 or uni_line [1 ] == "#" :
2425 continue
2526 if "universe" in uni_line :
26- new_settings ["universe" ] = int (
27- uni_line .split (":" )[1 ].strip ()
28- )
27+ new_settings ["universe" ] = int (uni_line .split (":" )[1 ].strip ())
2928 elif "ip_addr" in uni_line :
3029 new_settings ["ip_addr" ] = uni_line .split (":" )[1 ].strip ()
3130 elif "min_distance" in uni_line :
32- new_settings ["min_distance" ] = float (
33- uni_line .split (":" )[1 ].strip ()
34- )
31+ new_settings ["min_distance" ] = float (uni_line .split (":" )[1 ].strip ())
3532 elif "radius" in uni_line :
36- new_settings ["radius" ] = float (
37- uni_line .split (":" )[1 ].strip ()
38- )
33+ new_settings ["radius" ] = float (uni_line .split (":" )[1 ].strip ())
3934 print ("got these settings" , new_settings )
4035 return new_settings
4136 except Exception as e :
@@ -88,8 +83,7 @@ def set_zones_from_file(old_zones):
8883 return new_zones
8984 except Exception as e :
9085 print (
91- "Zones not imported from zones.txt, "
92- + "using default ones. Error was:" , e
86+ "Zones not imported from zones.txt, " + "using default ones. Error was:" , e
9387 )
9488 return old_zones
9589
@@ -123,9 +117,7 @@ def set_zones_to_file(zones):
123117 glob_receiver = start_psn (glob_settings .get ("ip_addr" ))
124118
125119 while True :
126- val = input (
127- "Press enter to store current position as a zone, press q to Quit"
128- )
120+ val = input ("Press enter to store current position as a zone, press q to Quit" )
129121 if val .lower () == "q" :
130122 glob_receiver .stop ()
131123 break
0 commit comments