GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — openapi-python-client/openapi_python_client/config.py at main · mtovt/openapi-python-client Expand file tree/ Copy pathconfig.pyMore file actions 48 lines (38 loc) · 1.48 KB / Copy pathconfig.pyFile metadata and controls48 lines (38 loc) · 1.48 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 import json import mimetypes from pathlib import Path from typing import Dict, List, Optional import yaml from pydantic import BaseModel class ClassOverride(BaseModel): """An override of a single generated class. See https://github.com/openapi-generators/openapi-python-client#class_overrides """ class_name: Optional[str] = None module_name: Optional[str] = None class Config(BaseModel): """Contains any configurable values passed by the user. See https://github.com/openapi-generators/openapi-python-client#configuration """ class_overrides: Dict[str, ClassOverride] = {} project_name_override: Optional[str] package_name_override: Optional[str] package_version_override: Optional[str] use_path_prefixes_for_title_model_names: bool = True post_hooks: List[str] = [ "autoflake -i -r --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports .", "isort .", "black .", ] field_prefix: str = "field_" http_timeout: int = 5 @staticmethod def load_from_path(path: Path) -> "Config": """Creates a Config from provided JSON or YAML file and sets a bunch of globals from it""" mime = mimetypes.guess_type(path.absolute().as_uri(), strict=True)[0] if mime == "application/json": config_data = json.loads(path.read_text()) else: config_data = yaml.safe_load(path.read_text()) config = Config(**config_data) return config |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |