Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using custom canvas server #15

Open
ehne opened this issue Oct 25, 2021 · 0 comments
Open

Consider using custom canvas server #15

ehne opened this issue Oct 25, 2021 · 0 comments

Comments

@ehne
Copy link
Owner

ehne commented Oct 25, 2021

Currently PyNode Next uses the default canvas server, this has some issues in how it understands where files are and what to load. This results in the slightly odd looking code in core:

base_path = os.path.relpath(__file__)
self.custom_ui = f"{Path(base_path).parent}/ui.html"

This is due to how if you use a custom html file (like PyNode Next does) it switches to using a relative file handler, rather than an absolute one. Hence the relpath call.

This problem results in the unfortunate side effect that we cannot package PyNode Next for PyPi, as it is unable to find a suitable relative path to work with. Meaning that users have to download a new copy of PyNode Next for every project (or move the same copy between projects). This also means that when uploading work done with PyNode Next, it will also include the PyNode Next source files. (this is both good and bad. good because it means that whatever version of PyNode Next is used in a project will be the same with the same project on a different machine, but bad for the reasons outlined before).

If we were to use a custom implementation of AlgorithmX's CanvasServer class, we would have more control over what path could be loaded. In theory we should just be able to replace the init function of CanvasServer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant