Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
new_config = False
try:
config = ConfigObj(os.getenv('HOME') + '/.blueproximityrc',{'create_empty':False,'file_error':True,'configspec':conf_specs})
except:
new_config = True
if new_config:
config = ConfigObj(os.getenv('HOME') + '/.blueproximityrc',{'create_empty':True,'file_error':False,'configspec':conf_specs})
# next line fixes a problem with creating empty strings in default values for configobj
config['device_mac'] = ''
vdt = Validator()
config.validate(vdt, copy=True)
config.write()
p = Proximity(config)
p.start()
pGui = ProximityGUI(p,config,new_config)
# make GTK threadable
gtk.gdk.threads_init()
gtk.main()