def __init__(self, ecf_path, top_level=False): self.location = ecf_path ecf_ctx = XPATH_CONTEXT(ecf_path, 'ec') self.uuid = ecf_ctx.attribute("/ec:system/@uuid") self.name = ecf_ctx.attribute("/ec:system/@name") self.libraries_table = {self.uuid: self} self.precompile_path = None if top_level: self.__set_top_level_properties(ecf_ctx) self.external_libs = self.__external_libs(ecf_ctx) self.c_shared_objects = self.__external_shared_objects(ecf_ctx) library_condition = "not (starts-with(@location,'$ISE_LIBRARY')) and count (%s)=0" % self.__excluded_library_or_external_object_conditions( ) xpath = "//ec:system/ec:target/ec:library[%s]/@location" % library_condition for attrib in ecf_ctx.node_list(xpath): location = expanded_path(attrib) #print 'location:', location if not path.isabs(location): location = path.join(path.dirname(ecf_path), location) # Recurse ecf file ecf = EIFFEL_CONFIG_FILE(location) self.libraries_table[ecf.uuid] = ecf for uuid in ecf.libraries_table: self.libraries_table[uuid] = ecf.libraries_table[uuid] if top_level: self.libraries = [] for uuid in self.libraries_table: self.libraries.append(self.libraries_table[uuid])
def __init__(self): # Get version from Eiffel class BUILD_INFO in source f = open(path.normpath('source/build_info.e'), 'r') for ln in f.readlines(): if ln.startswith('\tVersion_number'): numbers = ln[ln.rfind(' ') + 1:-1].split('_') break f.close() for i, n in enumerate(numbers): numbers[i] = str(int(n)) self.version = ('.').join(numbers) project_name = glob('*.ecf')[0] self.exe_name = XPATH_CONTEXT(project_name, 'ec').attribute('/ec:system/@name')
def __init__(self, ecf_path, ecf_table=dict()): self.location = ecf_path ecf_ctx = XPATH_CONTEXT(ecf_path, 'ec') self.uuid = ecf_ctx.attribute("/ec:system/@uuid") self.name = ecf_ctx.attribute("/ec:system/@name") self.libraries_table = {self.uuid: self} self.precompile_path = None top_level = len(ecf_table) == 0 if top_level: self.__set_top_level_properties(ecf_ctx) print "\nLibraries:", print path.basename(ecf_path), ',', ecf_table[ecf_path] = self self.external_libs = self.__external_libs(ecf_ctx) self.c_shared_objects = self.__external_shared_objects(ecf_ctx) library_condition = "not (starts-with(@location,'$ISE_LIBRARY')) and count (%s)=0" % self.__excluded_library_or_external_object_conditions( ) xpath = "//ec:system/ec:target/ec:library[%s]/@location" % library_condition for attrib in ecf_ctx.node_list(xpath): location = expanded_path(attrib) #print 'location:', location if not path.isabs(location): location = path.normpath( path.join(path.dirname(ecf_path), location)) # prevent infinite recursion for circular references if ecf_table.has_key(location): ecf = ecf_table[location] else: # Recurse ecf file ecf = EIFFEL_CONFIG_FILE(location, ecf_table) self.libraries_table[ecf.uuid] = ecf for uuid in ecf.libraries_table: self.libraries_table[uuid] = ecf.libraries_table[uuid] if top_level: self.libraries = [] for uuid in self.libraries_table: self.libraries.append(self.libraries_table[uuid]) print '' print ''
def __init__(self): self.ecf_name = glob('*.ecf')[0] self.name = path.splitext(self.ecf_name)[0] ecf_ctx = XPATH_CONTEXT(self.ecf_name, 'ec') self.exe_name = self.ecf_exe_name(ecf_ctx, '/ec:system/@name') # Get version from Eiffel class BUILD_INFO in source f = open(build_info_path(ecf_ctx), 'r') for ln in f.readlines(): if ln.startswith('\tVersion_number'): numbers = ln[ln.rfind(' ') + 1:-1].split('_') break f.close() for i, n in enumerate(numbers): numbers[i] = str(int(n)) self.version = ('.').join(numbers)