add new method for Router

This commit is contained in:
sheldygg 2023-02-08 17:36:00 +02:00
parent e8d279c8f2
commit 2e13c28ddd

View file

@ -179,6 +179,12 @@ class Router:
self._parent_router = router
router.sub_routers.append(self)
def include_routers(self, *routers):
if not routers:
raise ValueError("You must provide routers")
for router in routers:
self.include_router(router)
def include_router(self, router: Router) -> Router:
"""
Attach another router.