def __init__(self, config, debug): self.config = config self.debug = debug print "Initialising..." self.init_env() self.init_fs() user_exec = os.path.join( config.user_dir, "robot.py" ) if not os.path.exists( user_exec ): "No robot code around" raise Exception( "No robot code found." ) sricd.start( os.path.join( config.log_dir, "sricd.log" ) ) self.start_wm() self._test_sric() # The firmware updater requires input self.start_sr_input() self.firmware_update() self.user = usercode.UserCode( user_exec, config.log_dir, config.user_dir ) self.start_gui()
def __init__(self, config, debug): self.config = config self.debug = debug print "Initialising..." self.init_env() self.init_fs() user_exec = os.path.join(config.user_dir, "robot.py") if not os.path.exists(user_exec): "No robot code around" raise Exception("No robot code found.") sricd.start(os.path.join(config.log_dir, "sricd.log")) self.start_wm() self._test_sric() # The firmware updater requires input self.start_sr_input() self.firmware_update() self.user = usercode.UserCode(user_exec, config.log_dir, config.user_dir) self.start_gui()
"PATH"] = "/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin" # Extend PATH to include our bin directory os.environ["PATH"] += ":" + BIN_DIR # Hack around zip not supporting file permissions... if not os.access(os.path.join(BIN_DIR, "sricd"), os.X_OK): call( "find %s -type f | xargs chmod u+x" % os.path.dirname(__file__), shell=True) if not os.path.exists(USER_EXEC): "No robot code around" raise Exception("No robot code found.") sricd.start(os.path.join(args.log_dir, "sricd.log")) if os.path.exists(START_FIFO): os.unlink(START_FIFO) print "Running user code." robot = Popen([ "python", "-m", "sr.loggrok", USER_EXEC, "--usbkey", LOG_DIR, "--startfifo", START_FIFO ], cwd=USER_DIR, stdout=sys.stdout, stderr=sys.stderr) Popen("matchbox-window-manager -use_titlebar no -use_cursor no", shell=True)