4 # Copyright 2008 Develer S.r.l. (http://www.develer.com/)
9 # Author: Lorenzo Berni <duplo@develer.com>
17 def isBertosDir(directory):
18 return os.path.exists(directory + "/VERSION")
20 def bertosVersion(directory):
21 return open(directory + "/VERSION").readline().strip()
23 def createBertosProject(directory):
24 if not os.path.isdir(directory):
26 open(directory + "/project.bertos", "w")
28 def findDefinitions(ftype, path):
31 for filename in element[2]:
32 if fnmatch.fnmatch(filename, "*." + ftype):
33 yield (filename, element[0])
35 def loadCpuInfos(path):
37 for definition in findDefinitions(const.CPU_DEFINITION, path):
39 D.update(const.CPU_DEF)
40 def include(filename, dict = D, directory=definition[1]):
41 execfile(directory + "/" + filename, {}, D)
42 D["include"] = include
43 include(definition[0], D)
44 D["CPU_NAME"] = definition[0].split(".")[0]