コード例 #1
0
def scan() :
	result = []
	msg("  legacy...", newline = False)
	for x in entries :
		try :
			result.append( x() )
		except Prophet.NotSet :
			pass
	msg(" %d apps found" % len(result))
	return result
コード例 #2
0
def scan():
    result = []
    msg("  legacy...", newline=False)
    for x in entries:
        try:
            result.append(x())
        except Prophet.NotSet:
            pass

    msg(" %d apps found" % len(result))
    return result
コード例 #3
0
def scan() :
	"""Scan through all containers and return a list of found valid entries"""
	global _kws
	result = []
	msg("  desktop...", newline = False)
	for c in dirs :
		for w in os.walk(c) :
			_kws = _dir2kws(w[0])
			if verbose > 1 : msg("\nentering " + w[0])
			for x in fnmatch.filter(w[2], "*.desktop") :
				if verbose > 1 : msg("parsing %s..." % x, newline = False)
				try :
					result.append(App(os.path.join(w[0], x)))
					if verbose > 1 : msg("ok")
				except (NotDesktop, Prophet.NotSet), e :
					if verbose > 1 : msg("REJECTED : " + str(e))
コード例 #4
0
ファイル: __init__.py プロジェクト: zen0bit/menumaker
def scan():
    """Scan through all containers and return a list of found valid entries"""
    result = []
    msg("  debian...", newline=False)
    for d in dirs:
        for f in glob.glob(os.path.join(d, "*")):
            if verbose > 1:
                msg("\nparsing " + f)
            try:
                entries = _parse(f)
            except NotSet as e:
                if verbose > 1:
                    msg("REJECTED : " + str(e))
            else:
                for e in entries:
                    try:
                        result.append(App(e))
                    except Prophet.NotSet as e:
                        if verbose > 1:
                            msg("REJECTED : " + str(e))

    msg(" %d apps found" % len(result))
    return result
コード例 #5
0
def scan() :
	"""Scan through all containers and return a list of found valid entries"""
	result = []
	msg("  debian...", newline = False)
	for d in dirs :
		for f in glob.glob(os.path.join(d, "*")) :
			if verbose > 1 : msg("\nparsing " + f)
			try :
				entries = _parse(f)
			except NotSet, e :
				if verbose > 1 : msg("REJECTED : " + str(e))
			else :
				for e in entries :
					try :
						result.append(App(e))
					except Prophet.NotSet, e :
						if verbose > 1 : msg("REJECTED : " + str(e))
コード例 #6
0
	result = []
	msg("  debian...", newline = False)
	for d in dirs :
		for f in glob.glob(os.path.join(d, "*")) :
			if verbose > 1 : msg("\nparsing " + f)
			try :
				entries = _parse(f)
			except NotSet, e :
				if verbose > 1 : msg("REJECTED : " + str(e))
			else :
				for e in entries :
					try :
						result.append(App(e))
					except Prophet.NotSet, e :
						if verbose > 1 : msg("REJECTED : " + str(e))
	msg(" %d apps found" % len(result))
	return result




def _parse(debmenu) :
	try :
		file = open(debmenu)
	except IOError :
		raise NotSet("couldn't read the file " + debmenu)
	entry = ""
	entries = []
	next = False
	try :
		for x in file :
コード例 #7
0
ファイル: __init__.py プロジェクト: zen0bit/menumaker
def scan():
    """Scan through all containers and return a list of found valid entries"""
    global _kws
    result = []
    msg("  desktop...", newline=False)
    for c in dirs:
        for w in os.walk(c):
            _kws = _dir2kws(w[0])
            if verbose > 1:
                msg("\nentering " + w[0])
            for x in fnmatch.filter(w[2], "*.desktop"):
                if verbose > 1:
                    msg("parsing %s..." % x, newline=False)
                try:
                    result.append(App(os.path.join(w[0], x)))
                    if verbose > 1:
                        msg("ok")
                except (NotDesktop, Prophet.NotSet) as e:
                    if verbose > 1:
                        msg("REJECTED : " + str(e))
                except UnicodeDecodeError:
                    if verbose > 1:
                        msg(".desktop UTF-8 decode issue in " + desktop)

    msg(" %d apps found" % len(result))
    return result