Пример #1
0
    def compute(self):
        self.check_input('csvRootPath')
        path = self.get_input('csvRootPath')
        if not LoadAppLogic.IsCSVReadyFileExists(path):
            raise ModuleError(self, "IsCSVReadyFileExists failed")
        self.annotate({'used_files':
                           str([os.path.join(path, "csv_ready.csv")])})
        csv_files = LoadAppLogic.ReadCSVReadyFile(path)
        if not LoadAppLogic.IsMatchCSVFileTables(csv_files):
            raise ModuleError(self, "IsMatchCSVFileTables failed")
#         getter = get_module_registry().get_descriptor_by_name
#         descriptor = getter('edu.utah.sci.vistrails.basic', 
#                             'List')
#         list_of_elts = descriptor.module()
#         list_of_elts.value = [CSVFileEntry(f) for f in csv_files]
#         self.set_output('csvFiles', list_of_elts)
        list_of_elts = [CSVFileEntry(f) for f in csv_files]
        for elt in list_of_elts:
            elt.upToDate = True
        print 'list_of_elts:', list_of_elts
        self.set_output('csvFiles', list_of_elts)
Пример #2
0
 def compute(self):
     self.check_input('csvFiles')
     csv_files = self.get_input('csvFiles')
     res = LoadAppLogic.IsMatchCSVFileTables([f.file_entry 
                                              for f in csv_files])
     self.set_output('tablesMatch', res)
Пример #3
0
 def compute(self):
     self.checkInputPort('csvFiles')
     csv_files = self.getInputFromPort('csvFiles')
     res = LoadAppLogic.IsMatchCSVFileTables(
         [f.file_entry for f in csv_files])
     self.setResult('tablesMatch', res)