Inkscape.org
Creating New Extensions Using DBus from inside an extension
  1. #1
    gropiuswasright gropiuswasright @gropiuswasright

    I am trying to use DBus commands from within an extension - the test extension is saved here.

    However Inkscape freezes and DBus times out.

    Is that due to how extensions work and therefore not fixable?

    Is there any other way to do this (right now I'm trying to copy-paste sizes, as scaling based on bounding boxes does not seem to take line thickness into account)?

  2. #2
    inklinea inklinea @inklinea⛰️

    https://gitlab.com/inklinea/ink_flatten

    A working example.

  3. #3
    inklinea inklinea @inklinea⛰️

    Also https://inkscape.org/~inklinea/★ink-dbus

    However I think I might have got a couple of entries mixed up on this one.

    Only application and document dbus actions work on windows, not the 'window' actions.

  4. #4
    gropiuswasright gropiuswasright @gropiuswasright
    *

    Hi! and thanks.

    I've almost figured out things except that something somewhere prints

    <frozen importlib._bootstrap>:671: ImportWarning: DynamicImporter.exec_module() not found; falling back to load_module()

    and it messes up things.

    I'm not sure at which point this happens - I'm currently trying to figure that out.

    Do you have any ideas on how to silence that?

  5. #5
    inklinea inklinea @inklinea⛰️

    You mean the error message window that pops up on return to the Inkscape GUI ? 

    It's quite difficult to get rid of that in =<1.3, however it should not affect the operation of the extension ( unless you are trying to preserve a selection done via dbus ).

    I think it is fixed in 1.4

    Prior to that I used a subprocess to silence it.

  6. #6
    gropiuswasright gropiuswasright @gropiuswasright

    Yes, that one.

    No, it's not fixed in 1.4 (that's what I'm using)

    I ended up redefining print 🐷 💩

    _oldprint = print

    def print(a): pass

    # do imports

    print = _oldprint

Inkscape Inkscape.org Inkscape Forum Creating New Extensions Using DBus from inside an extension