targets/__init__.py
changeset 1747 6046ffa2280f
parent 1740 b789b695b5c6
child 1749 d73b64672238
equal deleted inserted replaced
1746:45d6f5fba016 1747:6046ffa2280f
    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 targets = dict([(name, {"xsd": path.join(_base_path, name, "XSD"),
    46 targets = dict([(name, {"xsd": path.join(_base_path, name, "XSD"),
    47                         "class": _GetLocalTargetClassFactory(name),
    47                         "class": _GetLocalTargetClassFactory(name),
    48                         "code": { fname: path.join(_base_path, name, fname)
    48                         "code": {fname: path.join(_base_path, name, fname)
    49                            for fname in listdir(path.join(_base_path, name))
    49                            for fname in listdir(path.join(_base_path, name))
    50                              if fname.startswith("plc_%s_main" % name) and
    50                              if fname.startswith("plc_%s_main" % name) and
    51                                fname.endswith(".c")}})
    51                                fname.endswith(".c")}})
    52                 for name in listdir(_base_path)
    52                 for name in listdir(_base_path)
    53                     if path.isdir(path.join(_base_path, name))
    53                     if path.isdir(path.join(_base_path, name))