Esempio n. 1
0
    def file_witness_list(self):
        wtn = self.witness_name
        if len(wtn) < 1:
            mbox.showinfo("", "Select WItness")
            return
        path_s = self.tprmap.prj_dir
        path_p = ptu.str2path(path_s)
        path_wtn = ptu.join(path_s, wtn)
        path_p_lst = []
        name_s_lst = []
        rlst = ptu.rlist_path(path_wtn, "*.*")
        for x in rlst:
            path_file = pth.Path(x).relative_to(path_p)
            path_p_lst.append(path_file)
            s = ptu.path2str(path_file)
            name_s_lst.append(s)

        def load_file(n):
            if n < 0:
                return
            path = path_p_lst[n]
            try:
                with path.open('r', encoding='utf-8') as f:
                    text = f.read()
            except Exception as e:
                msg = f'load_file() {path} Not Found'
                tfhlogerr.log(msg)
                return
            self.txt_root.delete("1.0", tk.END)
            self.txt_root.insert("1.0", text)

        open_listbox(name_s_lst, load_file)
Esempio n. 2
0
    def __init__(self, prj_name=None):
        # atexit.register(self.all_done)
        self.prj_name = prj_name
        #######################
        # si posiziona nella di prj_dir
        self.tprmap = TeimPrjMap()
        run_pos = self.tprmap.check_prj_dir(prj_name)
        if run_pos == 0:
            print(f"Project {self.prj_name} Not Found.")
            sys.exit(0)
            return
        prj_dir = self.tprmap.prj_dir
        if run_pos == 2:
            os.chdir(prj_dir)
        print(self.tprmap.prj_dir)
        #######################
        self.tprmap.main(prj_name)
        #######################
        path_err = pth.Path().joinpath(prj_dir, TEIMFH_LOG_ERR)
        tfhlogerr.open(ptu.path2str(path_err), 1)
        self.pwd = ptu.cwd()
        ##################
        self.root = None
        self.txt_root = None
        self.wlog = None
        self.txt_log = None
        ###################
        # menu dinamici
        self.mv_witness = {}
        self.mv_text = None
        self.mv_prj_text = None
        self.mv_prj_witness = None
        #################
        self.witness_name = ""
        self.text_name = ""
        self.witness_cmds = []
        self.text_cmds = []

        self.lbl_prj_var = {}
        self.lbl_witness_var = {}
        self.lbl_text_var = None
Esempio n. 3
0
 def prj_dir(self):
     s = ptu.path2str(self._prj_dir_p)
     return s
Esempio n. 4
0
 def run_dir(self):
     s = ptu.path2str(self._run_dir_p)
     return s