Esempio n. 1
0
 def compute(self):
     self.check_input('csvRootPath')
     path = self.get_input('csvRootPath')
     self.annotate({'used_files':
                        str([os.path.join(path, "csv_ready.csv")])})
     csv_files = LoadAppLogic.ReadCSVReadyFile(path)
     # wrapped_res = Collection([CSVFileEntry(e) for e in res], CSVFileEntry)
     list_of_elts = [CSVFileEntry(f) for f in csv_files]
     for elt in list_of_elts:
         elt.upToDate = True
     self.set_output('csvFiles', list_of_elts)
Esempio n. 2
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)