def getAppAllowedTypes(self, app: Application): """Return the handled MIME types for one Application.""" if app.desktopid not in self.appMimeTypesCache: allowedTypes = app.getSetting('MimeType', type='string list') self.appMimeTypesCache[app.desktopid] = allowedTypes mimeCost = app.getSetting('MimeTypeCost', type='numeric') or 0 self.incrementScore('configCost', None, app, increment=mimeCost) return self.appMimeTypesCache[app.desktopid]
def getAppLibCaps(self, actor: Application): """Return the library capabilities policy for one Application.""" if actor not in self.appLibCapsCache: policies = actor.getSetting('LibraryCaps', type='string list') or [] self.appLibCapsCache[actor] = policies return self.appLibCapsCache[actor]
def getAppPolicy(self, actor: Application, libMod: int): """Return the library capabilities policy for one Application.""" if libMod == LibraryManager.Custom: if actor.desktopid not in self.appPolicyCacheCustom: policies = actor.getSetting('LibraryCapsCustom', type='string list') or \ self.getAppPolicy(actor, LibraryManager.Default) self.appPolicyCacheCustom[actor.desktopid] = policies return self.appPolicyCacheCustom[actor.desktopid] else: if actor.desktopid not in self.appPolicyCache: policies = actor.getSetting('LibraryCaps', type='string list') or [] self.appPolicyCache[actor.desktopid] = policies return self.appPolicyCache[actor.desktopid]