parameters: (self, dom_iter, tree_father, discard_ids, node_sequence, next_id_box)
docstring: Given the dom_iter node, adds it to the tree
docstring_summary: Given the dom_iter node, adds it to the tree
docstring_tokens: Given the dom_iter node adds it to the tree
function: def append_tree_node(self, dom_iter, tree_father, discard_ids, node_sequence, next_id_box):
          """Given the dom_iter node, adds it to the tree"""
          if dom_iter.hasAttribute('unique_id'):
              original_id = long(dom_iter.attributes['unique_id'].value)
              if discard_ids is None:
                  unique_id = original_id
              else:
                  unique_id = self.dad.node_id_get(original_id, discard_ids)
          else:
              unique_id = next_id_box[0]
              next_id_box[0] = self.dad.node_id_get_simplified(next_id_box[0] + 1)
          node_tags = dom_iter.attributes['tags'].value if dom_iter.hasAttribute('tags') else ""
          if node_tags: self.dad.tags_add_from_node(node_tags)
          readonly = (dom_iter.attributes['readonly'].value == "True") if dom_iter.hasAttribute('readonly') else False
          custom_icon_id = int(dom_iter.attributes['custom_icon_id'].value) if dom_iter.hasAttribute('custom_icon_id') else 0
          is_bold = (dom_iter.attributes['is_bold'].value == "True") if dom_iter.hasAttribute('is_bold') else False
          foreground = dom_iter.attributes['foreground'].value if dom_iter.hasAttribute('foreground') else ""
          if not foreground: foreground = None
          syntax_highlighting = dom_iter.attributes['prog_lang'].value
          if syntax_highlighting not in [cons.RICH_TEXT_ID, cons.PLAIN_TEXT_ID]\
          and syntax_highlighting not in self.dad.available_languages:
              syntax_highlighting = syntax_highlighting.lower().replace("C++", "cpp")
              if syntax_highlighting not in self.dad.available_languages:
                  syntax_highlighting = cons.RICH_TEXT_ID
          node_depth = 0 if not tree_father else self.dad.treestore.iter_depth(tree_father)+1
          cherry = self.dad.get_node_icon(node_depth, syntax_highlighting, custom_icon_id)
          ts_creation = float(dom_iter.attributes['ts_creation'].value) if dom_iter.hasAttribute('ts_creation') else 0
          ts_lastsave = float(dom_iter.attributes['ts_lastsave'].value) if dom_iter.hasAttribute('ts_lastsave') else 0
          curr_buffer = self.dad.buffer_create(syntax_highlighting)
          if syntax_highlighting != cons.RICH_TEXT_ID: curr_buffer.begin_not_undoable_action()
          # loop into rich text, write into the buffer
          child_dom_iter = dom_iter.firstChild
          while child_dom_iter != None:
              if child_dom_iter.nodeName == "rich_text":
                  self.rich_text_deserialize(curr_buffer, child_dom_iter, discard_ids)
              elif child_dom_iter.nodeName == "encoded_png": self.image_deserialize(curr_buffer, child_dom_iter, 2)
              elif child_dom_iter.nodeName == "table": self.table_deserialize(curr_buffer, child_dom_iter)
              elif child_dom_iter.nodeName == "codebox": self.codebox_deserialize(curr_buffer, child_dom_iter)
              elif child_dom_iter.nodeName == "encoded_image": self.image_deserialize(curr_buffer, child_dom_iter, 1)
              elif child_dom_iter.nodeName == "node": break
              child_dom_iter = child_dom_iter.nextSibling
          if syntax_highlighting != cons.RICH_TEXT_ID: curr_buffer.end_not_undoable_action()
          curr_buffer.set_modified(False)
          #print unique_id
          # insert the node containing the buffer into the tree
          tree_iter = self.dad.treestore.append(tree_father, [cherry,
                                                              dom_iter.attributes['name'].value,
                                                              curr_buffer,
                                                              unique_id,
                                                              syntax_highlighting,
                                                              node_sequence,
                                                              node_tags,
                                                              readonly,
                                                              None,
                                                              custom_icon_id,
                                                              support.get_pango_weight(is_bold),
                                                              foreground,
                                                              ts_creation,
                                                              ts_lastsave])
          self.dad.update_node_aux_icon(tree_iter)
          self.dad.nodes_names_dict[unique_id] = self.dad.treestore[tree_iter][1]
          if discard_ids is not None:
              # we are importing nodes
              self.dad.ctdb_handler.pending_new_db_node(unique_id)
          # loop for child nodes
          child_sequence = 0
          while child_dom_iter!= None:
              if child_dom_iter.nodeName == "node":
                  child_sequence += 1
                  self.append_tree_node(child_dom_iter, tree_iter, discard_ids, child_sequence, next_id_box)
              elif child_dom_iter.nodeName == 'rich_text':
                  support.dialog_error("Rich text instead of child node??!!", self.dad.window)
                  break
              child_dom_iter = child_dom_iter.nextSibling
function_tokens: def append_tree_node ( self , dom_iter , tree_father , discard_ids , node_sequence , next_id_box ) : if dom_iter . hasAttribute ( 'unique_id' ) : original_id = long ( dom_iter . attributes [ 'unique_id' ] . value ) if discard_ids is None : unique_id = original_id else : unique_id = self . dad . node_id_get ( original_id , discard_ids ) else : unique_id = next_id_box [ 0 ] next_id_box [ 0 ] = self . dad . node_id_get_simplified ( next_id_box [ 0 ] + 1 ) node_tags = dom_iter . attributes [ 'tags' ] . value if dom_iter . hasAttribute ( 'tags' ) else "" if node_tags : self . dad . tags_add_from_node ( node_tags ) readonly = ( dom_iter . attributes [ 'readonly' ] . value == "True" ) if dom_iter . hasAttribute ( 'readonly' ) else False custom_icon_id = int ( dom_iter . attributes [ 'custom_icon_id' ] . value ) if dom_iter . hasAttribute ( 'custom_icon_id' ) else 0 is_bold = ( dom_iter . attributes [ 'is_bold' ] . value == "True" ) if dom_iter . hasAttribute ( 'is_bold' ) else False foreground = dom_iter . attributes [ 'foreground' ] . value if dom_iter . hasAttribute ( 'foreground' ) else "" if not foreground : foreground = None syntax_highlighting = dom_iter . attributes [ 'prog_lang' ] . value if syntax_highlighting not in [ cons . RICH_TEXT_ID , cons . PLAIN_TEXT_ID ] and syntax_highlighting not in self . dad . available_languages : syntax_highlighting = syntax_highlighting . lower ( ) . replace ( "C++" , "cpp" ) if syntax_highlighting not in self . dad . available_languages : syntax_highlighting = cons . RICH_TEXT_ID node_depth = 0 if not tree_father else self . dad . treestore . iter_depth ( tree_father ) + 1 cherry = self . dad . get_node_icon ( node_depth , syntax_highlighting , custom_icon_id ) ts_creation = float ( dom_iter . attributes [ 'ts_creation' ] . value ) if dom_iter . hasAttribute ( 'ts_creation' ) else 0 ts_lastsave = float ( dom_iter . attributes [ 'ts_lastsave' ] . value ) if dom_iter . hasAttribute ( 'ts_lastsave' ) else 0 curr_buffer = self . dad . buffer_create ( syntax_highlighting ) if syntax_highlighting != cons . RICH_TEXT_ID : curr_buffer . begin_not_undoable_action ( ) # loop into rich text, write into the buffer child_dom_iter = dom_iter . firstChild while child_dom_iter != None : if child_dom_iter . nodeName == "rich_text" : self . rich_text_deserialize ( curr_buffer , child_dom_iter , discard_ids ) elif child_dom_iter . nodeName == "encoded_png" : self . image_deserialize ( curr_buffer , child_dom_iter , 2 ) elif child_dom_iter . nodeName == "table" : self . table_deserialize ( curr_buffer , child_dom_iter ) elif child_dom_iter . nodeName == "codebox" : self . codebox_deserialize ( curr_buffer , child_dom_iter ) elif child_dom_iter . nodeName == "encoded_image" : self . image_deserialize ( curr_buffer , child_dom_iter , 1 ) elif child_dom_iter . nodeName == "node" : break child_dom_iter = child_dom_iter . nextSibling if syntax_highlighting != cons . RICH_TEXT_ID : curr_buffer . end_not_undoable_action ( ) curr_buffer . set_modified ( False ) #print unique_id # insert the node containing the buffer into the tree tree_iter = self . dad . treestore . append ( tree_father , [ cherry , dom_iter . attributes [ 'name' ] . value , curr_buffer , unique_id , syntax_highlighting , node_sequence , node_tags , readonly , None , custom_icon_id , support . get_pango_weight ( is_bold ) , foreground , ts_creation , ts_lastsave ] ) self . dad . update_node_aux_icon ( tree_iter ) self . dad . nodes_names_dict [ unique_id ] = self . dad . treestore [ tree_iter ] [ 1 ] if discard_ids is not None : # we are importing nodes self . dad . ctdb_handler . pending_new_db_node ( unique_id ) # loop for child nodes child_sequence = 0 while child_dom_iter != None : if child_dom_iter . nodeName == "node" : child_sequence += 1 self . append_tree_node ( child_dom_iter , tree_iter , discard_ids , child_sequence , next_id_box ) elif child_dom_iter . nodeName == 'rich_text' : support . dialog_error ( "Rich text instead of child node??!!" , self . dad . window ) break child_dom_iter = child_dom_iter . nextSibling