Example #1
0
 def __init__(self,tb_name,style='sys') :
     Nt2_base_infos.__init__(self)
     Nt2_tb_struct.__init__(self)
     self.tb_name = tb_name
     self.style = style
     self.primary_abs_tb_path = os.path.join(self.get_toolboxes_path(),tb_name)
     self.secundary_abs_tb_path = os.path.join(self.primary_abs_tb_path,'include','nt2','toolbox',tb_name)
     self.part = ""
Example #2
0
 def __init__(self, tb_name, style='sys'):
     Nt2_base_infos.__init__(self)
     Nt2_tb_struct.__init__(self)
     self.tb_name = tb_name
     self.style = style
     self.primary_abs_tb_path = os.path.join(self.get_toolboxes_path(),
                                             tb_name)
     self.secundary_abs_tb_path = os.path.join(self.primary_abs_tb_path,
                                               'include', 'nt2', 'toolbox',
                                               tb_name)
     self.part = ""
Example #3
0
 def __init__(self, path, name,
              ext = '.hpp',
              inner = None,
              banner = None,
              guard_begin = None,
              guard_end = None,
              year = None,
              comment ='//',
              fill = None
              ) :
     Nt2_base_infos.__init__(self)
     Banner.__init__(self, year, banner,comment=comment)
     Guard.__init__(self,path,name,ext=ext,
                    guard_begin=guard_begin,
                    guard_end=guard_end)
     self.__inner = Headers.inner_text if (inner is None) else inner
     self.__comment = comment
     self.__fill = comment[0] if fill == None else fill
Example #4
0
 def __init__(self, path, name,
              ext = '.hpp',
              inner = None,
              banner = None,
              guard_begin = None,
              guard_end = None,
              year = None,
              comment ='//',
              fill = None
              ) :
     Nt2_base_infos.__init__(self)
     Banner.__init__(self, year, banner,comment=comment)
     Guard.__init__(self,path,name,ext=ext,
                    guard_begin=guard_begin,
                    guard_end=guard_end)
     self.__inner = Headers.inner_text if (inner is None) else inner
     self.__comment = comment
     self.__fill = comment[0] if fill == None else fill
Example #5
0
def construct_new_dict_0_1(od):
    nl = []
    if type(od) is dict:
        od = [od]
    author = Nt2_base_infos.get_author()
    date = datetime.datetime.now().strftime("%d/%m/%Y")
    for d in od:
        n = {}
        nf = {}
        nf["arity"] = str(d.get("arity", 1))
        nf["ret_arity"] = "2" if "random_tuple" in d else "0"
        nf["types"] = d.get("types", [])
        nf["rturn"] = d.get("rturn", {"default": "T"})
        nf["call_types"] = d.get("buftp", [])
        nf["type_defs"] = d.get("tpdef", [])

        n["functor"] = nf
        nu = {}
        nug = {}
        nug["first_stamp"] = d.get("stamp", "created  by " + author + " the " + date)
        nug["stamp"] = "modified by " + author + " the " + date
        nug["included"] = d.get("incld", [])
        nug["notes"] = d.get("notes", [])
        nu["global_header"] = nug

        nu["specific_values"] = d.get("specv", {})
        nu["ranges"] = d.get("rnges", {})
        nuv = {}
        if d.get("tcall", None):
            nuv["property_call"] = None
            nuv["property_value"] = {"default": [d.get("tcall", None)]}
            nuv["ulp_thresh"] = {"default": ["0"]}
        elif d.get("tuple", None):
            nuv["property_call"] = None
            nuv["property_value"] = {"default": [d.get("tcal0", None), d.get("tcal1", None)]}
            nuv["ulp_thresh"] = {"default": ["0", "0"]}
        elif d.get("verif", None):

            def mklist(l):
                return l if type(l) is list else [l]

            nuv["property_call"] = {"default": mklist(d.get("verif", None))}
            nuv["property_value"] = {"default": mklist(d.get("verva", None))}
            nuv["ulp_thresh"] = {"default": mklist(d.get("verth", "0"))}

        nu["verif_test"] = nuv

        n["unit"] = nu
        n["version"] = "0.1"
        nl.append(n)
    return nl
Example #6
0
def construct_new_dict_0_1(od) :
    nl = []
    if type(od) is dict : od = [od]
    author = Nt2_base_infos.get_author()
    date = datetime.datetime.now().strftime("%d/%m/%Y")
    for d in od :
        n = {}
        nf = {} 
        nf[ 'arity'      ] = str(d.get('arity',1))
        nf[ 'ret_arity'  ] = '2' if "random_tuple" in d else '0'
        nf[ 'types'      ] = (d.get('types',[]))    
        nf[ 'rturn'      ] = (d.get('rturn',{'default': 'T',})) 
        nf[ 'call_types' ] = (d.get('buftp',[]))
        nf[ 'type_defs'  ] = (d.get('tpdef',[]))

        n["functor"]=nf
        nu = {}
        nug = {}
        nug['first_stamp'] = d.get("stamp",'created  by ' + author +' the ' +date)
        nug['stamp']       = 'modified by ' + author +' the ' +date
        nug['included']    = (d.get('incld',[]))
        nug['notes']       = (d.get('notes',[]))
        nu['global_header'] = nug
        
        nu['specific_values'] = (d.get('specv',{}))
        nu['ranges']          = (d.get('rnges',{}))
        nuv = {}
        if d.get('tcall',None) :
            nuv['property_call'] = None
            nuv['property_value']= { "default" : [d.get('tcall',None)] }
            nuv['ulp_thresh'] = { "default" : ['0']}
        elif d.get('tuple',None) :
            nuv['property_call'] = None
            nuv['property_value']= { "default" :[d.get('tcal0',None),d.get('tcal1',None)]}
            nuv['ulp_thresh'] =  { "default" : ['0','0']}
        elif d.get('verif',None) :
            def mklist(l) : return l if type(l) is list else [l]
            nuv['property_call'] = { "default" :mklist(d.get('verif',None))}
            nuv['property_value']= { "default" :mklist(d.get('verva',None))} 
            nuv['ulp_thresh'] =    { "default" :mklist(d.get('verth','0'))}
            
        nu['verif_test']= nuv

        n["unit"]=nu
        n["version"]='0.1'
        nl.append(n)
    return nl
Example #7
0
 def __init__(self, tb_name) :
     Nt2_base_infos.__init__(self)
     Nt2_tb_struct.__init__(self)
     self.__tb_name = tb_name
     self.__tb_path = os.path.join(self.get_nt2_path(),'nt2/toolbox',tb_name)
     self.__tb_style = self. __read_style()
Example #8
0
 def __init__(self) :
     Nt2_base_infos.__init__(self)
Example #9
0
 def __init__(self, tb_name,fct_name) :
     Nt2_fct_props.__init__(self, tb_name, fct_name)
     self.author = Nt2_base_infos.get_author()
     self.date = datetime.datetime.now().strftime("%d/%m/%Y")
     print("zut2")
Example #10
0
 def __init__(self):
     Nt2_base_infos.__init__(self)