Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mpfmc.__path__[0], args.mcconfigfile))
machine_path = set_machine_path(machine_path,
mpf_config['mpf-mc']['paths'][
'machine_files'])
mpf_config = load_machine_config(args.configfile, machine_path,
mpf_config['mpf-mc']['paths'][
'config'], mpf_config)
self.preprocess_config(mpf_config)
try:
MpfMc(options=vars(args), config=mpf_config,
machine_path=machine_path).run()
Logger.info("MC run loop ended.")
except Exception as e:
# Todo need to change back to a normal exception
logging.exception(str(e))
if args.pause:
input('Press ENTER to close this window...')
sys.exit()
def _setup(self, *args):
Clock.unschedule(self._setup)
if not self.syncing and not \
(hasattr(self, 'helper') and self.helper.mSetupDone) and \
netcheck.connection_available():
self.syncing = True
Logger.info('Attempting startup')
k = self.app_public_key
c = cast('android.app.Activity', context)
self.helper = helper = IabHelper(c, k)
# prints a lot of useful messages that might
# not make it back to python space
helper.enableDebugLogging(DEBUG)
s = _OnIabSetupFinishedListener(self._setup_callback)
_protect_callback(s)
self.helper.startSetup(s)
def on_mplayer_play(self):
Logger.info('AppService: on_mplayer_play()')
self.send_msg('MediaPlayer: play()')
self.make_media_notification(True)
def _stop_tribler(self):
"""Stop downloading with tribler"""
assert self.tdef is not None and self.tdef.is_finalized()
assert globalvars.triblerfun
sess = globalvars.skelly.tw.get_session_mgr().get_session()
if sess.has_download(self.tdef.infohash):
sess.remove_download_by_id(self.tdef.infohash)
Logger.info("Download removed from Tribler: " + self.tdef.get_name())
def reactor_start(*args):
'''Start the twisted reactor main loop
'''
Logger.info("Support: Starting twisted reactor")
reactor.interleave(reactor_wake, **kwargs)
Clock.schedule_interval(reactor_work, 0)
def button_search(self, instance):
searchterm = instance.text
Logger.info("Button text: {}".format(searchterm))
front_screen = App.get_running_app().root.ids.sadpanda_screen_manager.get_screen("front_screen")
front_screen.do_search(searchterm)
self.dismiss()
def _init_camera(self, camera_id):
Logger.info('Init camera %d' % camera_id)
if self._camera and self.camera_id == camera_id:
return
self._release_camera()
if IsAndroid:
self._camera = Camera.open(camera_id)
parameters = self._camera.getParameters()
#print parameters.flatten()
if parameters is None:
Logger.warning('Can''t read parameters')
return
supportedSizes = parameters.getSupportedVideoSizes()
if supportedSizes is None:
supportedSizes = parameters.getSupportedPreviewSizes()