Exemplo n.º 1
0
 def sort(self, e=None):
     self.words = init_list()
     self.btn_sort.Disable()
     self.words.sort(key=lambda x: x.score)
     save_list(self.words)
     time.sleep(1)
     self.btn_sort.Enable()
Exemplo n.º 2
0
 def sort(self, e=None):
     self.words = init_list()
     self.btn_sort.Disable()
     self.words.sort(key=lambda x: x.score)
     save_list(self.words)
     time.sleep(1)
     self.btn_sort.Enable()
Exemplo n.º 3
0
 def __init__(self, material_queue, middle_queue, product_queue):
     super(GUI, self).__init__(None, title, size)
     self.material_queue = material_queue
     self.middle_queue = middle_queue
     self.product_queue = product_queue
     self.item_queue = Queue.Queue()
     self.Bind(wx.EVT_CLOSE, self.close_handler)
     self.words = init_list()
     self.bind()
     wx.CallLater(delta, self.respond)
Exemplo n.º 4
0
 def __init__(self, material_queue, word_queue, product_queue):
     super(GUI, self).__init__(None, title, size)
     self.material_queue = material_queue
     self.word_queue = word_queue
     self.product_queue = product_queue
     self.item_queue = queue.Queue()
     self.Bind(wx.EVT_CLOSE, self.close_handler)
     self.words = init_list()
     self.bind()
     wx.CallLater(delta, self.respond)
     if HotKey:
         HotKey(self)
Exemplo n.º 5
0
 def add_to_xml(self, event=None):
     self.btn_add.Disable()
     self.words = init_list()
     if self.in_xml():  # strange duplicate items
         return
     # if add a word that is not in db now to xml, save it to db.
     try:
         temp = Item.get(name=self.item.name)
     except Exception:
         temp = None
     if not temp:
         self.item.save(force_insert=True)  # only save() not save to db
     try:
         if self.words:
             self.words.insert(1, self.item.convert())
         else:
             self.words.insert(0, self.item.convert())
         save_list(self.words)
     except Exception as e:
         print(e)
Exemplo n.º 6
0
 def add_to_xml(self, e=None):
     self.btn_add.Disable()
     self.words = init_list()
     if self.in_xml():  # strange duplicate items
         return
     # if add a word that is not in db now to xml, save it to db.
     try:
         temp = Item.get(name=self.item.name)
     except:
         temp = None
     if not temp:
         self.item.save(force_insert=True)  # only save() not save to db
     try:
         if self.words:
             self.words.insert(1, self.item.convert())
         else:
             self.words.insert(0, self.item.convert())
         save_list(self.words)
     except Exception as e:
         print e
Exemplo n.º 7
0
 def create_flash_window(self, e=None):
     self.words = init_list()
     self.flash = Flash(self)
     self.btn_recite.Disable()
     self.btn_flash.Disable()
Exemplo n.º 8
0
 def create_recite_window(self, e=None):
     self.words = init_list()
     self.recite = Recite(self)
     self.btn_recite.Disable()
     self.btn_flash.Disable()
Exemplo n.º 9
0
 def create_flash_window(self, e=None):
     self.words = init_list()
     self.flash = Flash(self)
     self.btn_recite.Disable()
     self.btn_flash.Disable()
Exemplo n.º 10
0
 def create_recite_window(self, e=None):
     self.words = init_list()
     self.recite = Recite(self)
     self.btn_recite.Disable()
     self.btn_flash.Disable()