HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/share/inkscape/extensions/inkscape_follow_link.py
#!/usr/bin/env python

import threading
import webbrowser

import inkex

class VisitWebSiteWithoutLockingInkscape(threading.Thread):
    def __init__(self, url):
        threading.Thread.__init__ (self)
        self.url = url

    def run(self):
        webbrowser.open(self.url)

class FollowLink(inkex.Effect):
    def __init__(self):
        inkex.Effect.__init__(self)

    def effect(self):
        if (self.options.ids):
            for id, node in self.selected.iteritems():
                if node.tag == inkex.addNS('a','svg'):
                    self.url = node.get(inkex.addNS('href','xlink'))
                    vwswli = VisitWebSiteWithoutLockingInkscape(self.url)
                    vwswli.start()
                    #inkex.errormsg("Link: %s" % self.url)
                    break


if __name__ == '__main__':
    e = FollowLink()
    e.affect(output=False)

# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99