Example #1
0
def run():
	parser = OptionParser(usage="usage: %prog [appname]", version="%prog 1.0")
	parser.add_option("-x", "--prefer-x11", dest="prefer_x11", action="store_true", help="Use X11 unless not compatible", default=False)
	(options, args) = parser.parse_args()

	device = None
	if len(args) > 0:
		appname = args[0]
		apps = system.get_apps()
		for app in apps:
			if app["name"] == appname:
				device = app["device"]
				break;
		if device == None:
			raise cli.Error("Application %s doesn't exist" % (appname))
	elif os.path.exists(system.runapp_link):
		mode = os.stat(system.runapp_link)[stat.ST_MODE]
		if not stat.S_ISBLK(mode):
			raise cli.Error("Symlink %s is not pointing a block device" % (system.runapp_link))
		device = os.path.realpath(system.runapp_link)
	
	if device == None:
		raise cli.Error("Appname must be specified unless %s symlink does exist." % (system.runapp_link))

	with system.Mount(device) as tmpdir:
		metadata = system.get_metadata_from_cache(device)
		if metadata == None: metadata = system.get_app_metadata(device, tmpdir)
		run_app(tmpdir, metadata, options.prefer_x11)
Example #2
0
def refresh():
    global apps

    # アプリを列挙
    apps = system.get_apps()
    window.clearItem()
    window.addItem(download)
    for app in apps:
    	window.addItem(gui.list.TextListItem(app["name"], gui.res.font_app_list, None, None, app))
Example #3
0
def run():
    parser = OptionParser(usage="usage: %prog [appname]", version="%prog 1.0")
    parser.add_option("-x",
                      "--prefer-x11",
                      dest="prefer_x11",
                      action="store_true",
                      help="Use X11 unless not compatible",
                      default=False)
    (options, args) = parser.parse_args()

    device = None
    if len(args) > 0:
        appname = args[0]
        apps = system.get_apps()
        for app in apps:
            if app["name"] == appname:
                device = app["device"]
                break
        if device == None:
            raise cli.Error("Application %s doesn't exist" % (appname))
    elif os.path.exists(system.runapp_link):
        mode = os.stat(system.runapp_link)[stat.ST_MODE]
        if not stat.S_ISBLK(mode):
            raise cli.Error("Symlink %s is not pointing a block device" %
                            (system.runapp_link))
        device = os.path.realpath(system.runapp_link)

    if device == None:
        raise cli.Error(
            "Appname must be specified unless %s symlink does exist." %
            (system.runapp_link))

    with system.Mount(device) as tmpdir:
        metadata = system.get_metadata_from_cache(device)
        if metadata == None: metadata = system.get_app_metadata(device, tmpdir)
        run_app(tmpdir, metadata, options.prefer_x11)