def _set_services_settings(self): from services import all_services for name in all_services.keys(): # For each supported service if name in self._settings.keys(): # If that service has been configure by this business setattr(self, name.upper(), self._settings[name])
def getUsage(self, width=None): t = usage.Options.getUsage(self, width) t += "\nUse 'flappserver add BASEDIR SERVICE-TYPE --help' for details." t += "\n\nSERVICE-TYPE can be one of the following:\n" from services import all_services for name in sorted(all_services.keys()): t += " %s\n" % name return t
async def get_all_sources(): from services import all_services settings = await get_settings() databases = [ [label, "database", db.scheme, {}] for (label, db) in [(label, urlparse(value["db_url"])) for label, value in settings.DATABASES.items()] ] + [["dwata_meta", "database", "sqlite", { "is_system_db": True }]] services = [] for sname in all_services.keys(): if hasattr(settings, sname.upper()): for label, value in getattr(settings, sname.upper()).items(): services.append([label, "service", sname]) return databases + services