targets/__init__.py
changeset 1734 750eeb7230a1
parent 1731 6ebd9c40b2be
child 1736 7e61baa047f0
equal deleted inserted replaced
1733:dea107dce0c4 1734:750eeb7230a1
    43 
    43 
    44 targets = dict([(name, {"xsd":path.join(_base_path, name, "XSD"),
    44 targets = dict([(name, {"xsd":path.join(_base_path, name, "XSD"),
    45                         "class":_GetLocalTargetClassFactory(name),
    45                         "class":_GetLocalTargetClassFactory(name),
    46                         "code": { fname: path.join(_base_path, name, fname)
    46                         "code": { fname: path.join(_base_path, name, fname)
    47                            for fname in listdir(path.join(_base_path, name))
    47                            for fname in listdir(path.join(_base_path, name))
    48                              if fname.startswith("plc_%s_main"%name) and
    48                              if fname.startswith("plc_%s_main" % name) and
    49                                fname.endswith(".c")}})
    49                                fname.endswith(".c")}})
    50                 for name in listdir(_base_path)
    50                 for name in listdir(_base_path)
    51                     if path.isdir(path.join(_base_path, name))
    51                     if path.isdir(path.join(_base_path, name))
    52                        and not name.startswith("__")])
    52                        and not name.startswith("__")])
    53 
    53 
    68                 open(xsdfilename).read()
    68                 open(xsdfilename).read()
    69 
    69 
    70     # Get all xsd targets
    70     # Get all xsd targets
    71     for targetname,nfo in targets.iteritems():
    71     for targetname,nfo in targets.iteritems():
    72         xsd_string = open(nfo["xsd"]).read()
    72         xsd_string = open(nfo["xsd"]).read()
    73         targetchoices +=  xsd_string%DictXSD_toolchain
    73         targetchoices +=  xsd_string % DictXSD_toolchain
    74 
    74 
    75     return targetchoices
    75     return targetchoices
    76 
    76 
    77 def GetTargetCode(targetname):
    77 def GetTargetCode(targetname):
    78     codedesc = targets[targetname]["code"]
    78     codedesc = targets[targetname]["code"]