Пример #1
0
 def app_kwds(self):
     kwds = get_app_kwds(self.app_name, app_name=self.app_name)
     if 'config_file' not in kwds:
         kwds['config_file'] = self.config_file
     if 'config_section' not in kwds:
         kwds['config_section'] = self.config_section
     return kwds
Пример #2
0
 def __init__(self, props: WebappSetupProps) -> None:
     self.props = props
     self.app_kwds = get_app_kwds(props.default_section_name, props.app_name)
     self.config_file = self._resolve_config_file_path()
     self.is_ini_file = config_is_ini(self.config_file)
     self.config_section = self._resolve_section_name()
     self._update_kwds()
Пример #3
0
def build_native_uwsgi_app(paste_factory, config_section):
    """uwsgi can load paste factories with --ini-paste, but this builds non-paste uwsgi apps.

    In particular these are useful with --yaml or --json for config."""
    # TODO: just move this to a classmethod on stack?
    app_kwds = get_app_kwds(config_section)
    uwsgi_app = paste_factory({}, load_app_kwds=app_kwds)
    return uwsgi_app