Ejemplo n.º 1
0
 def __init__(self, parent, qname, prefix='', role=None):
     TreeNode.__init__(self, parent)
     self.qname = qname
     self.uri = kb.ns_xsd + qname.split(':')[1]
     self.vis_label = prefix + qname
     self.role = role
     self.Refresh()
Ejemplo n.º 2
0
 def __init__(self, parent, qname, prefix='', role = None):
     TreeNode.__init__(self, parent)
     self.qname = qname
     self.uri = kb.ns_xsd+qname.split(':')[1]
     self.vis_label = prefix+qname
     self.role = role
     self.Refresh()
Ejemplo n.º 3
0
 def __init__(self, parent):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.pattern = parent.pattern
     wizard.Subscribe(self.pattern, self)
     for role in self.pattern['signature'].iterkeys():
         PatternSignatureItem(self, role)
     self.Refresh()
Ejemplo n.º 4
0
 def __init__(self, parent):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.pattern = parent.pattern
     wizard.Subscribe(self.pattern, self)
     for role in self.pattern['signature'].iterkeys():
         PatternSignatureItem(self, role)
     self.Refresh()
Ejemplo n.º 5
0
 def __init__(self, parent, role):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.pattern = parent.pattern
     self.option = parent.option
     self.part = parent.part
     self.role = role
     self.editor_value = None
     self.Update()
Ejemplo n.º 6
0
 def __init__(self, parent, option, before = None, after = None):
     TreeNode.__init__(self, parent, before, after)
     self.doc = parent.doc
     self.pattern = parent.pattern
     self.option = option
     wizard.Subscribe(self.option, self)
     self.Update()
     for part in self.option['parts']:
         PatternOptionPartNode(self, part)
Ejemplo n.º 7
0
 def __init__(self, parent, option, before=None, after=None):
     TreeNode.__init__(self, parent, before, after)
     self.doc = parent.doc
     self.pattern = parent.pattern
     self.option = option
     wizard.Subscribe(self.option, self)
     self.Update()
     for part in self.option['parts']:
         PatternOptionPartNode(self, part)
Ejemplo n.º 8
0
 def __init__(self, parent, role):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.pattern = parent.pattern
     self.option = parent.option
     self.part = parent.part
     self.role = role
     self.editor_value = None
     self.Update()
Ejemplo n.º 9
0
 def __init__(self, parent, label = None, items = None, makefunc = None):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.label = label
     if self.label:
         self.vis_label = self.label
         wizard.Subscribe((self.doc, self.label), self)
     if makefunc:
         self.MakeItem = makefunc
     self.ResetFolder(items)
Ejemplo n.º 10
0
 def __init__(self, parent, qname, prefix='', role=None):
     TreeNode.__init__(self, parent)
     self.qname = qname
     self.entry = kb.part2_itself[qname]
     self.vis_label = prefix + self.entry['name']
     self.role = role
     if self.role:
         self.vis_icon = kb.icons_map.get(self.entry['icon'], 'iso_unknown')
     else:
         self.vis_icon = self.entry['icon']
     self.Refresh()
Ejemplo n.º 11
0
 def __init__(self, parent, part, before = None, after = None):
     TreeNode.__init__(self, parent, before, after)
     self.doc = parent.doc
     self.pattern = parent.pattern
     self.option = parent.option
     self.part = part
     wizard.Subscribe(self.part, self)
     self.Update()
     for role in self.part.iterkeys():
         if role != 'self':
             PatternRoleNode(self, role)
Ejemplo n.º 12
0
 def __init__(self, parent, part, before=None, after=None):
     TreeNode.__init__(self, parent, before, after)
     self.doc = parent.doc
     self.pattern = parent.pattern
     self.option = parent.option
     self.part = part
     wizard.Subscribe(self.part, self)
     self.Update()
     for role in self.part.iterkeys():
         if role != 'self':
             PatternRoleNode(self, role)
Ejemplo n.º 13
0
 def __init__(self, parent, qname, prefix='', role = None):
     TreeNode.__init__(self, parent)
     self.qname = qname
     self.entry = kb.part2_itself[qname]
     self.vis_label = prefix+self.entry['name']
     self.role = role
     if self.role:
         self.vis_icon = kb.icons_map.get(self.entry['icon'], 'iso_unknown')
     else:
         self.vis_icon = self.entry['icon']
     self.Refresh()
Ejemplo n.º 14
0
 def __init__(self, parent, name='', tag=None):
     for c in parent.children:
         if not isinstance(c, ProjectFolderNode):
             before = c
             break
     else:
         before = None
     TreeNode.__init__(self, parent, before=before)
     self.vis_label = name
     self.tag = tag
     appdata.project.UpdateProject()
     self.Refresh()
Ejemplo n.º 15
0
 def __init__(self, parent, name="", tag=None):
     for c in parent.children:
         if not isinstance(c, ProjectFolderNode):
             before = c
             break
     else:
         before = None
     TreeNode.__init__(self, parent, before=before)
     self.vis_label = name
     self.tag = tag
     appdata.project.UpdateProject()
     self.Refresh()
Ejemplo n.º 16
0
 def __init__(self, parent):
     TreeNode.__init__(self, parent)
     for role in self.parent.entry['roles'].itervalues():
         t = [role['name'], ' : ']
         if role.get('is_optional'):
             t.append('optional ')
         if role.get('is_list'):
             t.append('list of ')
         prefix = ''.join(t)
         type_uri = role['type_uri']
         if type_uri.startswith('xsd:'):
             XSDNode(self, type_uri, prefix, role = role)
         else:
             Part2Node(self, type_uri, prefix, role = role)
     self.Sort()
     self.Refresh()
Ejemplo n.º 17
0
 def __init__(self, parent):
     TreeNode.__init__(self, parent)
     for role in self.parent.entry['roles'].itervalues():
         t = [role['name'], ' : ']
         if role.get('is_optional'):
             t.append('optional ')
         if role.get('is_list'):
             t.append('list of ')
         prefix = ''.join(t)
         type_uri = role['type_uri']
         if type_uri.startswith('xsd:'):
             XSDNode(self, type_uri, prefix, role=role)
         else:
             Part2Node(self, type_uri, prefix, role=role)
     self.Sort()
     self.Refresh()
Ejemplo n.º 18
0
 def __init__(self, parent, value, prefix = '', reason_uris=set(), reason_pattern = None):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.value = value
     self.prefix = prefix
     self.reason_uris = reason_uris
     self.reason_pattern = reason_pattern
     self.vis_label = self.prefix + '"{0}"'.format(self.value)
     if self.reason_pattern or self.reason_uris:
         pattern_reason_node = PatternResultNode(self, tm.main.reason)
         for v in self.reason_pattern:
             if v[1]:
                 if getattr(v[1], 'has_literal', False):
                     PatternsLiteralNode(pattern_reason_node, v[1], prefix = '{0}: '.format(v[0]))
                 else:
                     EntityNode(pattern_reason_node, v[1], prefix = '{0}: '.format(v[0]))
         for v in self.reason_uris:
             EntityNode(pattern_reason_node, v)
     self.Refresh()
Ejemplo n.º 19
0
 def __init__(self, parent, uri, key=None, prefix='', reason_uris=set(), suffix='', is_prop = False, reason_pattern = None):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.uri = uri
     self.key = key
     self.prefix = prefix
     self.suffix = suffix
     self.is_property = is_prop
     self.reason_uris = reason_uris
     self.reason_pattern = reason_pattern
     self.names = set()
     self.properties = {}
     self.relationships = []
     self.propnode = None
     self.relnode = None
     self.patternsnode = None
     self.rolesnode = None
     self.supertemplatenode = None
     wizard.Subscribe((self.doc, self.uri), self)
     self.doc.grNeedProperties(self.uri)
     self.UpdateProperties()
     self.Refresh()
Ejemplo n.º 20
0
    def __init__(self, parent, viewtype):
        TreeNode.__init__(self, parent)
        self.view = None
        self.viewtype = type(viewtype.__name__, (viewtype,), dict(viewnode=self))
        self.doc = viewtype.document
        self.vis_icon = "blank_ico"

        if self.doc:
            self.vis_icon = self.doc.GetIcon()
            self.doc.AddClient(self)
            wizard.Subscribe(self.doc, self)
            if self.doc.doc_owner is None:
                self.doc.doc_owner = self
                wizard.Subscribe(self.doc, self)
        elif self.viewtype:
            if hasattr(self.viewtype, "vis_icon"):
                self.vis_icon = self.viewtype.vis_icon

        self.UpdateLabel()
        if self.parent is appdata.project.root:
            appdata.project.RefreshProps()
            appdata.project.UpdateProject()
Ejemplo n.º 21
0
    def __init__(self, parent, viewtype):
        TreeNode.__init__(self, parent)
        self.view = None
        self.viewtype = type(viewtype.__name__, (viewtype, ),
                             dict(viewnode=self))
        self.doc = viewtype.document
        self.vis_icon = 'blank_ico'

        if self.doc:
            self.vis_icon = self.doc.GetIcon()
            self.doc.AddClient(self)
            wizard.Subscribe(self.doc, self)
            if self.doc.doc_owner is None:
                self.doc.doc_owner = self
                wizard.Subscribe(self.doc, self)
        elif self.viewtype:
            if hasattr(self.viewtype, 'vis_icon'):
                self.vis_icon = self.viewtype.vis_icon

        self.UpdateLabel()
        if self.parent is appdata.project.root:
            appdata.project.RefreshProps()
            appdata.project.UpdateProject()
Ejemplo n.º 22
0
    def OnDestroy(self):
        if self.doc:
            wizard.Unsubscribe(self.doc, self)
            self.doc.RemoveClient(self)
            self.doc.ClearProps()
            if self.doc.doc_owner is self:
                self.doc.doc_owner = None
                for v in self.doc.doc_clients.copy():
                    if type(v) == ProjectNode and v in self.doc.doc_clients:
                        v.Destroy()

        if self.view:
            self.view.OnDestroy()
            self.view.close()
            self.view.deleteLater()
            self.view = None

        if isinstance(self.parent, ProjectFolderNode):
            appdata.project.UpdateProject()
        TreeNode.OnDestroy(self)
Ejemplo n.º 23
0
 def __init__(self, parent, label):
     TreeNode.__init__(self, parent)
     self.vis_label = label
     self.doc = parent.doc
     self.Refresh()
Ejemplo n.º 24
0
 def __init__(self, parent):
     TreeNode.__init__(self, parent)
     self.Refresh()
Ejemplo n.º 25
0
 def __init__(self, parent):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.uri = parent.uri
     self.Update()
Ejemplo n.º 26
0
 def __init__(self, parent, doc, suffix = ''):
     TreeNode.__init__(self, parent)
     self.doc = doc
     self.suffix = suffix
     wizard.Subscribe(self.doc, self)
     self.UpdateLabel()
Ejemplo n.º 27
0
 def OnSelect(self, select):
     for o in self.pattern['options']:
         wizard.W_HighlightPatternRole(o, self.role, select)
     TreeNode.OnSelect(self, select)
Ejemplo n.º 28
0
 def __init__(self, parent, role):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.pattern = parent.pattern
     self.role = role
     self.Update()
Ejemplo n.º 29
0
 def __init__(self, parent, doc):
     TreeNode.__init__(self, parent)
     self.doc = doc
     wizard.Subscribe(self.doc, self)
     self.Update()
Ejemplo n.º 30
0
 def OnDestroy(self):
     wizard.Unsubscribe(self.option, self)
     TreeNode.OnDestroy(self)
Ejemplo n.º 31
0
 def OnDestroy(self):
     appdata.project.UpdateProject()
     TreeNode.OnDestroy(self)
Ejemplo n.º 32
0
 def __init__(self, parent, role):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.uri = parent.uri
     self.restriction_node = None
     self.Update(role)
Ejemplo n.º 33
0
 def __init__(self, parent, doc):
     TreeNode.__init__(self, parent)
     self.doc = doc
     wizard.Subscribe(self.doc, self)
     self.Update()
Ejemplo n.º 34
0
 def OnSelect(self, select):
     TreeNode.OnSelect(self, select)
     if 'self' in self.part:
         wizard.W_HighlightPatternRole(self.option, self.part['self'],
                                       select)
Ejemplo n.º 35
0
 def Edit(self, value=None):
     self.editor_value = value
     TreeNode.Edit(self)
Ejemplo n.º 36
0
 def __init__(self, parent, key):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.SetPropertyKey(key)
Ejemplo n.º 37
0
 def OnSelect(self, select):
     TreeNode.OnSelect(self, select)
     if not select or self.role not in ('type', 'uri'):
         wizard.W_HighlightPatternRole(self.option, self.role, select)
Ejemplo n.º 38
0
 def OnDestroy(self):
     wizard.UnsubscribeAll(self)
     TreeNode.OnDestroy(self)
Ejemplo n.º 39
0
 def __init__(self, parent, pattern):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.pattern = pattern
     wizard.Subscribe(self.pattern, self)
     self.Update()
Ejemplo n.º 40
0
 def __init__(self, parent, group):
     TreeNode.__init__(self, parent)
     for i in group:
         Part2Node(self, i)
     self.Sort()
     self.Refresh()
Ejemplo n.º 41
0
 def __init__(self, parent, role):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.pattern = parent.pattern
     self.role = role
     self.Update()
Ejemplo n.º 42
0
 def __init__(self, parent, items):
     TreeNode.__init__(self, parent)
     for owner, rname in items:
         Part2Node(self, owner, self.pre%rname)
     self.Sort()
     self.Refresh()
Ejemplo n.º 43
0
 def __init__(self, parent, pattern):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.pattern = pattern
     wizard.Subscribe(self.pattern, self)
     self.Update()
Ejemplo n.º 44
0
 def __init__(self, parent, callback):
     TreeNode.__init__(self, parent)
     self.callback = callback
     self.Refresh()
Ejemplo n.º 45
0
 def OnDestroy(self):
     wizard.Unsubscribe((self.doc, self.uri), self)
     TreeNode.OnDestroy(self)
Ejemplo n.º 46
0
 def __init__(self, parent, name):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc
     self.vis_label = name
Ejemplo n.º 47
0
 def OnDestroy(self):
     wizard.Unsubscribe(self.part, self)
     TreeNode.OnDestroy(self)
Ejemplo n.º 48
0
 def __init__(self, parent):
     TreeNode.__init__(self, parent)
     self.doc = parent.doc