Ejemplo n.º 1
0
 def __init__(self, parent, node):
     TreeItem.__init__(self, parent, node)
     tagDict = self.document.XMLTag2ClassDict
     self.childs = [
         tagDict[childNode.tag](self, childNode) for childNode in node
     ]
     self.isExpanded = node.attrib.get("expanded") == "True"
Ejemplo n.º 2
0
    def __init__(self, parent, node):
        TreeItem.__init__(self, parent, node)
        text = node.text
        if not text:
            # this should never happen
            return
        text = text.strip()
        objStr, remainder = text.split('(', 1)
        objStr = PATCHES.get(objStr, objStr)
        argString, _ = remainder.rsplit(')', 1)
        pluginStr, actionStr = objStr.split(".", 1)
        plugin = getattr(eg.plugins, pluginStr).plugin
        try:
            action = plugin.info.actions[actionStr]
        except KeyError:
            eg.PrintError("Can't find action: " + text)
            action = None
        if action is None or not issubclass(action, eg.ActionBase):
            action = eg.plugins.EventGhost.plugin.info.actions["PythonCommand"]
            argString = repr(text)
        try:
            self.executable = action()
        except:
            eg.PrintTraceback(msg="Error in action: " + repr(text))
            self.executable = eg.plugins.EventGhost.PythonCommand
            argString = repr(text)

        self.icon = action.info.icon
        self.SetArgumentString(argString)
Ejemplo n.º 3
0
 def __init__(self, parent, node):
     TreeItem.__init__(self, parent, node)
     tagDict = self.document.XMLTag2ClassDict
     self.childs = [
         tagDict[childNode.tag.lower()](self, childNode)
         for childNode in node
     ]
     if node.attrib.get("expanded", "").lower() == "true":
         self.document.expandedNodes.add(self)
Ejemplo n.º 4
0
 def __init__(self, parent, node):
     TreeItem.__init__(self, parent, node)
     tagDict = self.document.XMLTag2ClassDict
     self.childs = [
         tagDict[childNode.tag.lower()](self, childNode)
         for childNode in node
     ]
     if node.attrib.get("expanded", "").lower() == "true":
         self.document.expandedNodes.add(self)
Ejemplo n.º 5
0
 def __init__(self, parent, node):
     TreeItem.__init__(self, parent, node)
     if node.text:
         try:
             args = pickle.loads(base64.b64decode(node.text))
         except:
             args = ()
     else:
         args = ()
     ident = node.attrib.get('identifier', None)
     pluginStr = node.attrib['file']
     self.pluginFile = pluginStr
     self.info = info = eg.PluginInfo.Open(pluginStr, ident, args, self)
     self.name = eg.text.General.pluginLabel % info.label
     if info.icon != self.icon:
         self.icon = eg.Icons.PluginSubIcon(info.icon)
     #self.icon = info.icon
     self.executable = info.instance
Ejemplo n.º 6
0
 def __init__(self, parent, node):
     TreeItem.__init__(self, parent, node)
     if node.text:
         try:
             args = pickle.loads(base64.b64decode(node.text))
         except:
             args = ()
     else:
         args = ()
     evalName = node.attrib.get('identifier', None)
     self.pluginName = node.attrib.get('file', None)
     guid = node.attrib.get('guid', self.pluginName)
     self.info = info = eg.pluginManager.OpenPlugin(
         guid,
         evalName,
         args,
         self,
     )
     self.name = eg.text.General.pluginLabel % info.label
     if info.icon != self.icon:
         self.icon = eg.Icons.PluginSubIcon(info.icon)
     #self.icon = info.icon
     self.executable = info.instance
Ejemplo n.º 7
0
 def __init__(self, parent, node):
     TreeItem.__init__(self, parent, node)
     if node.text:
         try:
             args = pickle.loads(base64.b64decode(node.text))
         except:
             args = ()
     else:
         args = ()
     evalName = node.attrib.get('identifier', None)
     self.pluginName = node.attrib.get('file', None)
     guid = node.attrib.get('guid', self.pluginName)
     self.info = info = eg.pluginManager.OpenPlugin(
         guid,
         evalName,
         args,
         self,
     )
     self.name = eg.text.General.pluginLabel % info.label
     if info.icon != self.icon:
         self.icon = eg.Icons.PluginSubIcon(info.icon)
     #self.icon = info.icon
     self.executable = info.instance
Ejemplo n.º 8
0
 def __init__(self, parent, node):
     TreeItem.__init__(self, parent, node)
     self.RegisterEvent(self.name)
Ejemplo n.º 9
0
 def __init__(self, parent, node):
     TreeItem.__init__(self, parent, node)
     self.RegisterEvent(self.name)