Skip to content

Commit

Permalink
Add setupWebRoutes to project managet protocol, add dummy implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
justvanrossum committed Dec 12, 2023
1 parent b8f8457 commit a7ac4f1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/fontra/core/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,6 @@ async def projectPageHandler(
self, request: web.Request, filterContent: Callable | None = None
) -> web.Response:
...

def setupWebRoutes(self, server) -> None:
...
3 changes: 1 addition & 2 deletions src/fontra/core/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ def setup(self) -> None:
self.viewEntryPoints = {
ep.name: ep.value for ep in entry_points(group="fontra.views")
}
if hasattr(self.projectManager, "setupWebRoutes"):
self.projectManager.setupWebRoutes(self)
self.projectManager.setupWebRoutes(self)
routes = []
routes.append(web.get("/", self.rootDocumentHandler))
routes.append(web.get("/websocket/{path:.*}", self.websocketHandler))
Expand Down
3 changes: 3 additions & 0 deletions src/fontra/filesystem/projectmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ async def getProjectList(self, token: str) -> list[str]:
projectPaths.append("/".join(projectItems[len(rootItems) :]))
return projectPaths

def setupWebRoutes(self, server):
pass


def _iterFolder(folderPath, extensions, maxDepth=3):
if maxDepth is not None and maxDepth <= 0:
Expand Down

0 comments on commit a7ac4f1

Please sign in to comment.