Esempio n. 1
0
class LocalClientTransportSchema(fields.Dictionary):
    contents = {
        # Server class can be an import path or a class object
        'server_class':
        fields.Any(
            fields.TypePath(
                description=
                'The importable Python path to the `Server`-extending class.',
                base_classes=Server,
            ),
            fields.TypeReference(
                description='A reference to the `Server`-extending class',
                base_classes=Server,
            ),
            description=
            'The path to the `Server` class to use locally (as a library), or a reference to the '
            '`Server`-extending class/type itself.',
        ),
        # No deeper validation than "schemaless dictionary" because the Server will perform its own validation
        'server_settings':
        fields.Any(
            fields.PythonPath(
                value_schema=_server_settings,
                description=
                'The importable Python path to the settings dict, in the format "module.name:VARIABLE".',
            ),
            _server_settings,
            description=
            'The settings to use when instantiating the `server_class`.',
        ),
    }

    description = 'The constructor kwargs for the local client transport.'
Esempio n. 2
0
          },
          optional_keys=('datefmt', ),
      ),
      description=
      'This defines a mapping of logging formatter names to formatter configurations. The `format` '
      'key specifies the log format and the `datefmt` key specifies the date format.',
  )),
 ('filters',
  fields.SchemalessDictionary(
      key_type=fields.UnicodeString(),
      value_type=fields.Dictionary(
          {
              '()':
              fields.TypePath(
                  base_classes=logging.Filter,
                  description=
                  'The optional, fully-qualified name of the class extending `logging.Filter`, used '
                  'to override the default class `logging.Filter`.',
              ),
              'name':
              fields.UnicodeString(
                  description=
                  'The optional filter name which will be passed to the `name` argument of the '
                  '`logging.Filter` class.', ),
          },
          optional_keys=('()', 'name'),
          allow_extra_keys=True,
      ),
      description=
      'This defines a mapping of logging filter names to filter configurations. If a config has '
      'only the `name` key, then `logging.Filter` will be instantiated with that argument. You can '
      'specify a `()` key (yes, really) to override the default `logging.Filter` class with a '