-
Notifications
You must be signed in to change notification settings - Fork 148
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
Allow using dot parser in a server environment #108
Comments
Commit c4fad2f would fix this. However I'm concerned about all the projects which rely upon |
I'm wrong. There are still dot -> ui dependencies..
For this to work, we'd need to yank out the XdotParser out of xdot/dot. Do you want to parse xdot annotations too, or just plain dot? BTW, separate package is not something I'm keen on, as another package would increase the maintenance burden, and I don't have enough time for all my open-source projects already. |
well, those can maybe be moved and then re-exported from their old location:
There’s options:
|
Thanks. PEP 562 is a great suggestion. I followed it while still keeping backwards compatibility for older Python. I moved XDotParser into ui and therefore removing all ui dependencies from xdot.dot. Does this meet your needs? |
You might have read my comment above before I edited it. There’s still dependencies from Using PEP 562 in |
Are you sure? I removed them all now, in branch
Are you sure you're testing the tip of branch |
Aaah, I see the misconception. I just said “the dot parser” instead of specifying that I’m talking about the I want to use that one specifically because it extracts information about shapes and the pen. My idea was to divorce those abstract drawing-related pieces of information from xdot.py’s concrete GTK drawing implementation. That way, one can use it to draw to a different kind of canvas. |
I see.. Yes, that definetly requires more work. One solution is to encapsulate all ui dependencies into a Factory, whose methods would then create the necessary objects from ui (e.g, createNode, createEdge, createFoo. This would open up the possibility for your code to provide its own objects. Another simpler solution is to split out XDotParser' Both stratergies can be combined. It depends how much you really want to share. The latter seems simpler and more practicle. That said, I don't have the time to disentangle XDotParser from ui, but I'd accept a PR. In the mean while I can merge the |
That sounds good! Is there other packages that import |
I hadn't thought about that. Per this GitHub code search, there are a few attempts but they are all very hackish, as XDotParser was never designed to be reused outside |
I would like to use the dot parser in a server environment, but just importing it results in initializing a GTK window.
It would be great to at least initialize that lazily or even better: Splitting the parser off into another package that can be imported without any GTK/GI dependencies
The text was updated successfully, but these errors were encountered: