targets/__init__.py
changeset 1767 c74815729afd
parent 1758 845ca626db09
child 1782 5b6ad7a7fd9d
equal deleted inserted replaced
1766:c1e5b9f19483 1767:c74815729afd
    42 
    42 
    43 def _GetLocalTargetClassFactory(name):
    43 def _GetLocalTargetClassFactory(name):
    44     return lambda: getattr(__import__(name, globals(), locals()), name+"_target")
    44     return lambda: getattr(__import__(name, globals(), locals()), name+"_target")
    45 
    45 
    46 
    46 
    47 targets = dict([(name, {"xsd": path.join(_base_path, name, "XSD"),
    47 targets = dict([(name, {"xsd":   path.join(_base_path, name, "XSD"),
    48                         "class": _GetLocalTargetClassFactory(name),
    48                         "class": _GetLocalTargetClassFactory(name),
    49                         "code": {fname: path.join(_base_path, name, fname)
    49                         "code":  {fname: path.join(_base_path, name, fname)
    50                            for fname in listdir(path.join(_base_path, name))
    50                                   for fname in listdir(path.join(_base_path, name))
    51                              if fname.startswith("plc_%s_main" % name) and
    51                                   if (fname.startswith("plc_%s_main" % name) and
    52                                fname.endswith(".c")}})
    52                                       fname.endswith(".c"))}})
    53                 for name in listdir(_base_path)
    53                 for name in listdir(_base_path)
    54                     if path.isdir(path.join(_base_path, name))
    54                 if (path.isdir(path.join(_base_path, name))
    55                        and not name.startswith("__")])
    55                     and not name.startswith("__"))])
    56 
    56 
    57 toolchains = {"gcc":  path.join(_base_path, "XSD_toolchain_gcc"),
    57 toolchains = {"gcc":  path.join(_base_path, "XSD_toolchain_gcc"),
    58               "makefile":  path.join(_base_path, "XSD_toolchain_makefile")}
    58               "makefile":  path.join(_base_path, "XSD_toolchain_makefile")}
    59 
    59 
    60 
    60