Esempio n. 1
0
def createPlugin(context, pluginModule, pluginClassName, pluginName, author, date, info, release, group):
  plugin = eval(pluginModule + "." + pluginClassName + "(context)", globals(), locals())
  if hasattr(plugin, "run"):
    plugin.real_run = plugin.run
    plugin.run = lambda : runPlugin(plugin)
  elif hasattr(plugin, "importGraph"):
    plugin.real_importGraph = plugin.importGraph
    plugin.importGraph = lambda : importGraph(plugin)
  elif hasattr(plugin, "exportGraph"):
    plugin.real_exportGraph = plugin.exportGraph
    plugin.exportGraph = lambda os : exportGraph(plugin, os)
  plugin.name = lambda : pluginName
  plugin.group = lambda : group
  plugin.author = lambda : author
  plugin.date = lambda : date
  plugin.info = lambda : info
  plugin.release = lambda : release
  plugin.tulipRelease = lambda : tlp.getTulipRelease()
  plugin.programmingLanguage = lambda : "Python"
  return plugin
Esempio n. 2
0
def createPlugin(context, pluginModule, pluginClassName, pluginName, author,
                 date, info, release, group):
    plugin = eval(pluginModule + "." + pluginClassName + "(context)",
                  globals(), locals())
    if hasattr(plugin, "run"):
        plugin.real_run = plugin.run
        plugin.run = lambda: runPlugin(plugin)
    elif hasattr(plugin, "importGraph"):
        plugin.real_importGraph = plugin.importGraph
        plugin.importGraph = lambda: importGraph(plugin)
    elif hasattr(plugin, "exportGraph"):
        plugin.real_exportGraph = plugin.exportGraph
        plugin.exportGraph = lambda os: exportGraph(plugin, os)
    plugin.name = lambda: pluginName
    plugin.group = lambda: group
    plugin.author = lambda: author
    plugin.date = lambda: date
    plugin.info = lambda: info
    plugin.release = lambda: release
    plugin.tulipRelease = lambda: tlp.getTulipRelease()
    plugin.programmingLanguage = lambda: "Python"
    return plugin
Esempio n. 3
0

class tlpgui(_tulipgui.tlpgui):
    pass


def tulipguiExitFunc():
    import tulipgui
    tulipgui.tlpgui.runQtMainLoop()


tlp.loadTulipPluginsFromDir(_tulipGuiPluginsPath)

# Check if we are in script execution mode
# (sys.ps1 is not defined in that case)
# If so, register an exit callback that will run the Qt event loop
# if some widgets are still in a visible state
if not hasattr(sys, 'ps1') and not sys.flags.interactive:
    import atexit
    atexit.register(tulipguiExitFunc)

import signal  # noqa
signal.signal(signal.SIGINT, signal.SIG_DFL)

__all__ = ['tlpgui']
__author__ = 'David Auber, and the Tulip development Team'
__license__ = 'LGPLv3'
__version__ = tlp.getTulipRelease()
__email__ = '*****@*****.**'
__status__ = 'Production'
Esempio n. 4
0
  dlOpenFlagsBackup = sys.getdlopenflags()
  if sys.version_info < (3, 6):
    import DLFCN
    dlOpenFlags = DLFCN.RTLD_NOW | DLFCN.RTLD_GLOBAL
  else:
    dlOpenFlags = os.RTLD_NOW | os.RTLD_GLOBAL
  sys.setdlopenflags(dlOpenFlags)

tlp.loadTulipPluginsFromDir(_tulipGuiPluginsPath)

if platform.system() == 'Linux' and os.path.exists(_tulipGuiNativePluginsPath):
  sys.setdlopenflags(dlOpenFlagsBackup)

# Check if we are in script execution mode (sys.ps1 is not defined in that case)
# If so, register an exit callback that will run the Qt event loop if some widgets are
# still in a visible state
if not hasattr(sys, 'ps1') and not sys.flags.interactive:
  import atexit
  atexit.register(tulipguiExitFunc)

import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)

__all__ = ['tlpgui']
__author__ = "David Auber, and the Tulip development Team"
__copyright__ = "Copyright " + str(date.today().year) + ", LaBRI and University of Bordeaux"
__license__ = "LGPLv3"
__version__ = tlp.getTulipRelease()
__email__ = "*****@*****.**"
__status__ = "Production"