def setKeywords(self): try: cats = self.desktop["Categories"] if type(cats) == tuple: self.keywords = KwS(*cats) else: self.keywords = KwS(cats) except KeyError: if _kws: self.keywords = _kws else: raise Prophet.NotSet("Categories not found") if fnmatch.fnmatch(self.exename, "*kcmshell"): self.keywords |= KwS(KDE, Kw("X-KDE-settings"))
class SystemApps(Menu): name = "System" keywords = KwS(System, Filesystem, Monitor, Security, PackageManager) def __init__(self, subs): subs = [_menu("Information", KwS("X-KDE-information")), SystemSettings] super(SystemApps, self).__init__([x([]) for x in subs])
class SystemSettings(Menu): name = "Settings" keywords = KwS(Settings, DesktopSettings, HardwareSettings, Screensaver) def __init__(self, subs): subs = [GNOMESettings, KDESettings, XfceSettings] super(SystemSettings, self).__init__([x([]) for x in subs])
class DevApps(Menu): name = "Development" keywords = KwS(Development, Building, Debugger, IDE, GUIDesigner, Profiling, RevisionControl, Translation, WebDevelopment) def __init__(self, subs): subs = [KDevelop] super(DevApps, self).__init__([x([]) for x in subs])
class netbeans(_DropIn, _X11App): name = "NetBeans" comment = "NetBeans Java IDE" keywords = KwS(Development, Debugger, Java, GTK) def relevant(self, path): if Prophet.isExe(os.path.join(path, "bin/netbeans")): raise netbeans.StopDescention(path)
class lazarus(_DropIn, _X11App): name = "Lazarus" comment = "Delphi-like FreePascal IDE" keywords = KwS(Development, Debugger, GUIDesigner, GTK) def relevant(self, path): if Prophet.isExe(os.path.join(path, "lazarus")): raise lazarus.StopDescention(path)
class eclipse(_DropIn, _X11App): name = "Eclipse" comment = "Eclipse Java IDE" keywords = KwS(Development, Debugger, Java, GTK) def relevant(self, path): if Prophet.isExe(os.path.join(path, "eclipse")): raise eclipse.StopDescention(path)
class opera(_DropIn, _X11App): name = "Opera" comment = "Opera browser" keywords = KwS(WebBrowser, Email) def relevant(self, path): if Prophet.isExe(os.path.join(path, "opera")): raise opera.StopDescention(path)
class estudio(_App, _X11App): name = "EiffelStudio" comment = "EiffelStudio IDE" keywords = KwS(Development, IDE, Debugger) def getPrefixes(self): return super( estudio, self).getPrefixes() + "$ISE_EIFFEL/studio/spec/$ISE_PLATFORM"
class _HelixReal(_App, _X11App): comment = "Media player" keywords = KwS(AudioVideo, Audio, Video, TV, Tuner, Player, GTK) def __init__(self): try: super(_HelixReal, self).__init__() except Prophet.NotFound: raise
class ee(_App, _ConsoleApp): name = "Easy Editor" comment = "Standard FreeBSD text editor" keywords = KwS(TextEditor, Core) def valid(self, pfx, exe): import os.path if os.path.isfile(os.path.join(pfx, "share/misc/init.ee")): return super(ee, self).valid(pfx, exe) else: return False
class Games(Menu): name = "Games" keywords = KwS(Amusement, Game, ActionGame, AdventureGame, ArcadeGame, BoardGame, BlocksGame, CardGame, KidsGame, LogicGame, RolePlaying, Simulation, SportsGame, StrategyGame) def __init__(self, subs): subs = [ AdventureGames, ArcadeGames, BoardGames, CardGames, PuzzleGames, SimGames, SportsGames, StrategyGames, ToyGames ] super(Games, self).__init__([x([]) for x in subs])
def _dir2kws(dir): """Convert the directory name to the corresponding keyword set, if possible""" parts = [x.strip().lower() for x in dir.split("/")] if len(fnmatch.filter(parts, "kde")) and len( fnmatch.filter(parts, "*config*") + fnmatch.filter(parts, "*sett*")): # Catching KDE/Configuration or KDE/Settings kws = [KDE, Kw("X-KDE-settings")] kws += [ k for m, k in _kdeCfgMap for x in parts if fnmatch.fnmatch(x, m) ] else: kws = [k for m, k in _genMap for x in parts if fnmatch.fnmatch(x, m)] if len(kws): return KwS(*kws) else: return None
def _deb2kws(sec, hint): """Convert Debian style section/hints entries to an equivalent keyword set""" kws = [] for x in sec.split("/"): x = Kw(x) if x in _rejs: raise Prophet.NotSet("section %s rejected" % x) try: kws += _secs[x] except KeyError: pass for x in hint.split(","): x = Kw(x) try: kws += _hints[x] except KeyError: pass return KwS(*kws)
class jed(_App, _ConsoleApp): name = "Jed" comment = "Simple text editor" keywords = KwS(TextEditor)
class emacs(_App, _ConsoleApp): # FIXME : make this versioned name = "Emacs" comment = "A powerful text editing environment" keywords = KwS(TextEditor)
class elvis(_App, _ConsoleApp): name = "Elvis" comment = "Vi compatible editor" keywords = KwS(TextEditor)
class cute(_App, _X11App): name = "Cute" comment = "User-friendly editor with syntax hilighting" keywords = KwS(TextEditor, Qt)
class cooledit(_App, _X11App): name = "CoolEdit" comment = "X11 text editor" keywords = KwS(TextEditor)
class bluefish(_App, _X11App): name = "BlueFish" comment = "Advanced HTML editor and web publishing application" keywords = KwS(TextEditor, Development, GNOME, X_HTML)
class yudit(_App, _X11App): name = "Yudit" comment = "X11 unicode text editor" keywords = KwS(TextEditor)
class gxedit(_App, _X11App): name = "GXedit" comment = "Simple X11 text editor" keywords = KwS(TextEditor, GTK)
class jove(_App, _ConsoleApp): name = "Jove" comment = "Emacs-like text editor" keywords = KwS(TextEditor)
class asWedit(_App, _X11App): name = "asWedit" comment = "Advanced HTML editor" keywords = KwS(TextEditor, X_HTML)
class joe(_App, _ConsoleApp): name = "Joe" comment = "Joe's own editor" keywords = KwS(TextEditor)
class xemacs(_App, _X11App): # FIXME : make this versioned name = "Xemacs" comment = "X11 version of Emacs" keywords = KwS(TextEditor)
class gvim(_App, _X11App): name = "GVim" comment = "X11 version of Vim, a Vi clone" keywords = KwS(TextEditor)
class xjed(_App, _X11App): name = "Xjed" comment = "X11 version of Jed" keywords = KwS(TextEditor)
class nano(_App, _ConsoleApp): name = "Nano" comment = "Simple text editor" keywords = KwS(TextEditor)
class xwe(_App, _X11App): name = "Xwe" comment = "X11 version of Xwpe text editor" keywords = KwS(TextEditor, Development)