Пример #1
0
 def keypress(self, size, key):
     global edit,Num
     if key != 'enter':
         return super(QuestionBox_2, self).keypress(size, key)
     if edit_w.edit_text == 'q':
         raise urwid.ExitMainLoop()
     edit = urwid.Edit(u"Box2\n")
     #self.original_widget = QuestionBox(edit)
     Num, Result1, Result2, ResultT = Needle_Spell.main(edit_w.edit_text,DB,Num) # main function
     edit2.contents[0] = (QuestionBox(edit), edit2.options())
     Fresh_Qbox(Result1, Result2,ResultT,Num)
Пример #2
0
 def keypress(self, size, key):
     global edit,Num
     if key != 'enter':
         return super(QuestionBox_2, self).keypress(size, key)
     if edit_w.edit_text == 'q':
         raise urwid.ExitMainLoop()
     edit = urwid.Edit(u"Box2\n")
     #self.original_widget = QuestionBox(edit)
     Num, Result1, Result2 = Needle_Spell.main(edit_w.edit_text,DB,Num) # main function
     Head_w1.contents[0] = (BigTxt(Result1), Head_w1.options())
     Head_w2.contents[0] = (BigTxt(Result2), Head_w2.options())
     edit2.contents[0] = (QuestionBox(edit), edit2.options())
     Dic_widge.contents[0] = (urwid.Text(Dictionary.Dic_WB(Result2)), Dic_widge.options())
Пример #3
0
            return super(QuestionBox_2, self).keypress(size, key)
        if edit_w.edit_text == 'q':
            raise urwid.ExitMainLoop()
        edit = urwid.Edit(u"Box2\n")
        #self.original_widget = QuestionBox(edit)
        Num, Result1, Result2, ResultT = Needle_Spell.main(
            edit_w.edit_text, DB, Num)  # main function
        edit2.contents[0] = (QuestionBox(edit), edit2.options())
        Fresh_Qbox(Result1, Result2, ResultT, Num)


'''
reading Words List
'''

DB = Needle_Spell.read_DB(open(sys.path[0] + '/Needlman/Word', "r"))
Num = 0
#Num, Result = Needle_Spell.main("biology",DB,Num) # main function
'''
Main Page
'''

palette = [('banner', 'black', 'light gray'),
           ('body', 'black', 'light gray', 'standout'),
           ('header', 'white', 'light gray', 'bold'),
           ('Green_BG', 'white', 'dark green', 'bold'),
           ('Green_RG', 'white', 'dark red', 'bold'),
           ('button normal', 'light gray', 'dark blue', 'standout'),
           ('button select', 'white', 'dark green'),
           ('button disabled', 'dark gray', 'dark blue'),
           ('edit', 'light gray', 'dark blue'), ('bigtext', 'white', 'black'),