def _create_code(self, zsel): gen = DaoGen() self.order_class.sep = zsel if self.can_create(gen): self.gen_ok = gen.write_code(self.pref, self.order_class, self.import_file_name.get()) return self.gen_ok return False
from SqltDAO.CodeGen01.OrderClass import OrderClass from SqltDAO.CodeGen01.CodeGen import DaoGen if __name__ == "__main__": data_file = "../DaoTest01/nasdaqlisted.txt" order = OrderClass(class_name='NasdaqDAO', table_name='TOK_NASDAQ', db_name='./StockInfo.sqlt3', file_name='./NasdaqDAO.py') gen = DaoGen() print(gen.write_code(order, data_file, sep="|"))
import os import sys sys.path.insert(1, os.path.join(sys.path[0], '../..')) from SqltDAO.CodeGen01.OrderClass import OrderClass from SqltDAO.CodeGen01.CodeGen import DaoGen from SqltDAO.Gui.DataPreferences import Dp1 as DataPreferences test = DaoGen() order = OrderClass() order.class_name = "TC001" order.file_name = "./foo.py" order.sep = 'CSV' print("Order Delimiter:", order.sep) try: data_file = "./tc001_data.txt" print(test.write_code(DataPreferences.Load('.'), order, data_file)) except: data_file = "./DaoTest01/tc001_data.txt" order.file_name = "./DaoTest01/foo.py" print(test.write_code(DataPreferences.Load('.'), order, data_file))
def _create_code(self, zsel): gen = DaoGen() self.gen_ok = gen.write_code(self.order_info, self.file_name.get(), sep=zsel[2]) return self.gen_ok
from SqltDAO.CodeGen01.OrderClass import OrderClass from SqltDAO.CodeGen01.CodeGen import DaoGen test = DaoGen() data_file = "./tc001_data.txt" order = OrderClass() order.class_name = "TC001" order.file_name = "./foo.py" print(test.write_code(order, data_file))