Example #1
0
 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
Example #2
0
 def _create_project(self):
     gen = DaoGen()
     if self.can_create(gen):
         self.gen_ok = gen.write_project(
             self.pref,
             self.order_class,
             self.import_file_name.get())
         return self.gen_ok
     return False
Example #3
0
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="|"))
Example #4
0
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))
Example #5
0
 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
Example #6
0
 def _create_project(self, zsel):
     gen = DaoGen()
     self.gen_ok = gen.gen_order(self.order_info,
                                 self.file_name.get(),
                                 sep=zsel[2])
     return self.gen_ok
Example #7
0
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))