예제 #1
0
def delete_link(sender, link):
    """
    Deletes a link and removes the topics (in and out) it represents from the corresponding nodes
    :param sender: Not used
    :param link: The id of the link item
    :return: Nothing
    """
    global links_dict

    link_conf = dpg.get_item_configuration(link)
    output_node = link_conf['user_data']['node_id_out']
    input_node = link_conf['user_data']['node_id_in']
    topic_out = link_conf['user_data']['topic_out']
    topic_in = link_conf['user_data']['topic_in'].replace(' ', '_')

    del links_dict[topic_out.split('-')[0]]

    topic_out = topic_out.replace(' ', '_')

    for n in nodes_list:
        if output_node == n.id:
            n.remove_topic_out(topic_out)
            n.links_list.remove(link)
        if input_node == n.id:
            n.remove_topic_in(topic_in)
            n.links_list.remove(link)
    dpg.delete_item(link)
예제 #2
0
def ignore():

    file = dpg.get_value(files_id)
    if file is not None:
        items = dpg.get_item_configuration(files_id)["items"]
        ignore_files = dpg.get_item_configuration(ignore_id)["items"]
        ignore_files.append(file)
        dpg.configure_item(ignore_id, items=ignore_files)
        index = -1
        found_index = 0
        for item in items:
            index += 1
            if item == file:
                found_index = index
                break
        del items[found_index]
        dpg.configure_item(files_id, items=items)
    callback(None)
예제 #3
0
def add_file_if_new(file):

    items = dpg.get_item_configuration(files_id)["items"]
    new_items = [file]
    for item in items:

        if item != file:
            new_items.append(item)

    dpg.configure_item(files_id, items=new_items)
예제 #4
0
    def parse_node(self):

        lines = []
        with open(self.file_path, "r") as file:
            lines = file.readlines()

        for line in lines:
            if line.__contains__('#include "'):
                split_line = line.split('"')
                if split_line[1] not in dpg.get_item_configuration(ignore_id)["items"]:
                    add_file_if_new(split_line[1])
                    self.links.append(IncludeNode(split_line[1], self.level+1))
예제 #5
0
def cb_table_result_selected(row_tag):
    children = get_item_children(row_tag)
    child_value = get_item_configuration(children[1][0])['label']
    _load_record_from_id(_try_parse_int(child_value))
예제 #6
0
 def fvalue(self, instance: Widget) -> Any:
     return dpgcore.get_item_configuration(instance.id)[self.key]
예제 #7
0
 def get_config(self) -> ItemConfigData:
     return dpgcore.get_item_configuration(self.id)
예제 #8
0
 def display_raw_configuration(self) -> t.Dict:
     """
     Note that raw dpg_id is not treated
     """
     return dpg.get_item_configuration(item=self.dpg_id)