Esempio n. 1
0
 def compute(self):
     self.check_input('csvFile')
     self.check_input('dbEntry')
     csv_file = self.get_input('csvFile')
     db_entry = self.get_input('dbEntry')
     self.annotate({'used_files':
                       str([csv_file.file_entry.FilePath]),
                    'generated_tables':
                        str([(db_entry.db_entry.ConnectionString, 
                              db_entry.db_entry.DBName,
                              csv_file.file_entry.TargetTable)])})
     res = LoadAppLogic.LoadCSVFileIntoTable(db_entry.db_entry,
                                             csv_file.file_entry)
     self.set_output('success', res)
Esempio n. 2
0
 def compute(self):
     self.check_input('csvFile')
     self.check_input('dbEntry')
     csv_file = self.get_input('csvFile')
     print 'csv_file:', csv_file
     db_entry = self.get_input('dbEntry')
     self.annotate({'used_files':
                       str([csv_file.file_entry.FilePath])})
     self.annotate({'generated_tables':
                        str([(db_entry.db_entry.ConnectionString, 
                              db_entry.db_entry.DBName,
                              csv_file.file_entry.TargetTable)])})
     if not LoadAppLogic.LoadCSVFileIntoTable(db_entry.db_entry,
                                              csv_file.file_entry):
         raise ModuleError(self, "LoadCSVFileIntoTable failed")
     self.set_output('dbEntry', db_entry)