Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for read_text (0.07 sec)

  1. docs_src/generate_clients/tutorial004_py39.py

    import json
    from pathlib import Path
    
    file_path = Path("./openapi.json")
    openapi_content = json.loads(file_path.read_text())
    
    for path_data in openapi_content["paths"].values():
        for operation in path_data.values():
            tag = operation["tags"][0]
            operation_id = operation["operationId"]
            to_remove = f"{tag}-"
            new_operation_id = operation_id[len(to_remove) :]
            operation["operationId"] = new_operation_id
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 493 bytes
    - Viewed (0)
  2. scripts/topic_repos.py

        # Local development
        # repos_path = Path("../docs/en/data/topic_repos.yml")
        repos_path = Path("./docs/en/data/topic_repos.yml")
        repos_old_content = repos_path.read_text(encoding="utf-8")
        new_repos_content = yaml.dump(data, sort_keys=False, width=200, allow_unicode=True)
        if repos_old_content == new_repos_content:
            logging.info("The data hasn't changed. Finishing.")
            return
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 12:34:01 UTC 2025
    - 2.7K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_generate_clients/test_tutorial004.py

        with patch("pathlib.Path", return_value=tmp_file):
            importlib.import_module("docs_src.generate_clients.tutorial004_py39")
    
        modified_openapi = json.loads(tmp_file.read_text())
        assert modified_openapi == {
            "components": {
                "schemas": {
                    "HTTPValidationError": {
                        "properties": {
                            "detail": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 8.3K bytes
    - Viewed (0)
  4. scripts/mkdocs_hooks.py

    @lru_cache
    def get_missing_translation_content(docs_dir: str) -> str:
        docs_dir_path = Path(docs_dir)
        missing_translation_path = docs_dir_path.parent.parent / "missing-translation.md"
        return missing_translation_path.read_text(encoding="utf-8")
    
    
    @lru_cache
    def get_mkdocs_material_langs() -> list[str]:
        material_path = Path(material.__file__).parent
        material_langs_path = material_path / "templates" / "partials" / "languages"
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 5.6K bytes
    - Viewed (0)
  5. scripts/sponsors.py

                node.sponsorEntity
            )
        return tiers
    
    
    def update_content(*, content_path: Path, new_content: Any) -> bool:
        old_content = content_path.read_text(encoding="utf-8")
    
        new_content = yaml.dump(new_content, sort_keys=False, width=200, allow_unicode=True)
        if old_content == new_content:
            logging.info(f"The content hasn't changed for {content_path}")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 12:34:01 UTC 2025
    - 6.1K bytes
    - Viewed (0)
  6. scripts/contributors.py

                    "url": author.url,
                }
        return users
    
    
    def update_content(*, content_path: Path, new_content: Any) -> bool:
        old_content = content_path.read_text(encoding="utf-8")
    
        new_content = yaml.dump(new_content, sort_keys=False, width=200, allow_unicode=True)
        if old_content == new_content:
            logging.info(f"The content hasn't changed for {content_path}")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Dec 16 12:34:01 UTC 2025
    - 8.6K bytes
    - Viewed (0)
  7. tests/test_ws_router.py

        await websocket.send_text(pathparam)
        await websocket.send_text(queryparam)
        await websocket.close()
    
    
    async def ws_dependency():
        return "Socket Dependency"
    
    
    @router.websocket("/router-ws-depends/")
    async def router_ws_decorator_depends(
        websocket: WebSocket, data=Depends(ws_dependency)
    ):
        await websocket.accept()
        await websocket.send_text(data)
        await websocket.close()
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sun Jun 11 19:08:14 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_websockets/test_tutorial002.py

                message = "Message one"
                websocket.send_text(message)
                data = websocket.receive_text()
                assert data == "Session cookie or query token value is: fakesession"
                data = websocket.receive_text()
                assert data == f"Message text was: {message}, for item ID: foo"
                message = "Message two"
                websocket.send_text(message)
                data = websocket.receive_text()
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 4.1K bytes
    - Viewed (0)
  9. docs_src/websockets/tutorial002_an_py310.py

        await websocket.accept()
        while True:
            data = await websocket.receive_text()
            await websocket.send_text(
                f"Session cookie or query token value is: {cookie_or_token}"
            )
            if q is not None:
                await websocket.send_text(f"Query parameter q is: {q}")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  10. docs_src/websockets/tutorial002_py310.py

        await websocket.accept()
        while True:
            data = await websocket.receive_text()
            await websocket.send_text(
                f"Session cookie or query token value is: {cookie_or_token}"
            )
            if q is not None:
                await websocket.send_text(f"Query parameter q is: {q}")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 2.7K bytes
    - Viewed (0)
Back to top