Skip to content

Allow using dot parser in a server environment #108

Description

@flying-sheep

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

/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/site-packages/gvrender/matplotlib.py:21: in <module>
    from xdot.dot.parser import XDotParser
/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/site-packages/xdot/__init__.py:26: in <module>
    from . import ui
/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/site-packages/xdot/ui/__init__.py:3: in <module>
    from .window import DotWidget, DotWindow
/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/site-packages/xdot/ui/window.py:40: in <module>
    from . import actions
/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/site-packages/xdot/ui/actions.py:66: in <module>
    class NullAction(DragAction):
/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/site-packages/xdot/ui/actions.py:70: in NullAction
    _tooltip_window = Gtk.Window(Gtk.WindowType.POPUP)
/opt/hostedtoolcache/Python/3.8.14/x64/lib/python3.8/site-packages/gi/overrides/Gtk.py:519: in __init__
    raise RuntimeError(
E   RuntimeError: Gtk couldn't be initialized. Use Gtk.init_check() if you want to handle this case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions