예제 #1
0
파일: control.py 프로젝트: sychov/conditer
def show_control(master, data):
    """Выводит блокнот управления с пятью закладками"""

    if data.is_restart:
        reload(control_a)
        reload(control_b)
        reload(control_c)
        reload(control_d)
        reload(control_e)
        reload(control_f)

    from control_a import show_goods
    from control_b import show_calc
    from control_c import show_sales_goods
    from control_d import show_sales
    from control_e import show_others
    from control_f import show_plus


    def tab_changes(tab):
        """функция, срабатывающая при нажатии закладок переключения
        между правыми (основными) фреймами"""

        window_names = controlTabs.tabs()
        index = window_names.index(controlTabs.select())

        if not FLAGS[index]:
            CONTROL[index](workArea[index], data)                   #нужна ли эта дата?
            FLAGS[index] = True
        else:
            CONTROL[index].renew()


    CONTROL = (show_goods, show_calc, show_sales_goods,
               show_sales, show_others, show_plus)

    FLAGS = [False, False, False, False, False, False]

    heads = (u' Товары ', u' Калькуляции ',
             u' Акционные товары ', u' Акционные цены ',
             u' Категории, скидки, причины списания ', u' Дополнительно ')

    workArea = []

    controlTabs = Notebook(master)
    for q in range (6):
        frame = Canvas(controlTabs, relief=GROOVE, highlightthickness=0)
        if USE_BACKGROUND:
            frame.create_image(0,0, anchor='nw', image=data.photo)
        controlTabs.add(frame, text=heads[q])
        workArea.append(frame)
    controlTabs.pack(side=TOP, fill=BOTH, expand=YES)
    controlTabs.bind('<<NotebookTabChanged>>', tab_changes)
    Style().configure("TNotebook.Tab", font=('Verdana', FONT_SIZE))
예제 #2
0
def main():
    root = tk.Tk()
    root.geometry("600x400+150+150")
    app = frame_make(root)

    fileloc = "list.txt"  # Local directory file
    #Format: [short name],[long name],[path to sh file]

    global termID, frameID, winID 
    termID = []     # PIDs in Terminals
    frameID = []    # Frame ID
    winID = []      # Window IDs of the Terminal windows
    gameID = []     # List of short names as we add them

    note = Notebook(root)
    with open(fileloc, 'rb') as csvfile:
        read = csv.reader(csvfile, delimiter=',', quotechar='|')
        for i, row in enumerate(read):
            if len(row) > 0:
                shortname, longname, command = map(str.strip, row)

                frameID.append(tk.Frame(note))
                note.add(frameID[i], text=shortname)
                               
                lbutton = 'Launch: ' + longname
                launch_command = lambda com, j: lambda : send_launch_game(com, j)
                lg = tk.Button(frameID[i],
                          text=lbutton,
                          command=launch_command(command, i))
                #kg = tk.Button(frameID[i],
                #          text="Stop Game",
                #          command=lambda: send_kill_game(wip,i))

                gameID.append(shortname)
                
                lg.pack(in_=frameID[i])
                #kg.pack(in_=frameID[i])

                term = tk.Frame(frameID[i], height=300, width=500)
                term.pack(fill=tk.BOTH,side='top', expand=tk.YES)
                
                wip = term.winfo_id()
                winID.append(wip)

    note.pack(fill='both', expand=True)            
    tk.Button(root, text='Refresh List',command= lambda : refresh_tabs(note, fileloc, gameID)).pack(side='left')
    tk.Button(root, text='Exit', command=root.destroy).pack(side='right')
    #tk.Button(root, text='Exit',command=destroy_all(root)).pack(side='right')
    
    root.mainloop()
    
    send_kill_all() #At end of program, kill all open terminal processes
예제 #3
0
    def __init__(self, master):
        master.minsize(width=1500, height=1500)
        root = Frame(master)
        root.pack(side=TOP, fill=BOTH)
        master.title('Stocks evaluation - Sandeep Joshi (FE520)')

        n = Notebook(root)
        n.enable_traversal()
        n.pack(fill=BOTH)
        self._create_stat_tab(n)
        self._create_help_tab(n)
        self.data = {}
        self.start = ''
        self.end = ''
        self.tickers = []
        self.tree
예제 #4
0
    def __init__(self, master):
        master.minsize(width=1500, height=1500)
        root = Frame(master)
        root.pack(side=TOP, fill=BOTH)
        master.title('Stocks evaluation - Sandeep Joshi (FE520)')

        n = Notebook(root)
        n.enable_traversal()
        n.pack(fill=BOTH)
        self._create_stat_tab(n)
        self._create_help_tab(n)
        self.data = {}
        self.start = ''
        self.end = ''
        self.tickers = []
        self.tree
예제 #5
0
파일: gui.py 프로젝트: ravescovi/tomosaic2
    def initUI(self):

        self.parent.title('Tomosaic')

        # ======================================================
        # menubar

        menuFrame = Frame(self.parent)
        menubar = Menu(menuFrame)
        self.parent.config(menu=menubar)

        fileFenu = Menu(menubar)
        fileFenu.add_command(label='Save parameters...',
                             command=self.saveAllAttr)
        fileFenu.add_command(label='Load parameters...',
                             command=self.loadAllAttr)
        fileFenu.add_command(label='Exit', command=self.onExit)
        menubar.add_cascade(label='File', menu=fileFenu)

        # ======================================================d
        # tabs

        tabFrame = Frame(root)
        tabs = Notebook(tabFrame)
        self.tabMeta = Frame(tabs)
        self.tabRegi = Frame(tabs)
        self.tabMerg = Frame(tabs)
        self.tabPhas = Frame(tabs)
        self.tabCent = Frame(tabs)
        self.tabReco = Frame(tabs)

        tabs.add(self.tabMeta, text='Metadata')
        tabs.add(self.tabRegi, text='Registration')
        tabs.add(self.tabMerg, text='Merging')
        tabs.add(self.tabPhas, text='Phase')
        tabs.add(self.tabCent, text='Center optimization')
        tabs.add(self.tabReco, text='Reconstruction')

        metatab_ui(self)
        regitab_ui(self)
        mergtab_ui(self)
        phastab_ui(self)
        centtab_ui(self)
        recotab_ui(self)

        tabFrame.pack()
        tabs.pack()
def init_UI():
	'''create tabs and required content'''

	# initialize main window
	main = Tk()
	main.title('data2knowledge')

	# component for 'tab' functionality
	n = Notebook(main)

	# initialize the various tabs
	EnrichTab(n, 'Enrich', main)
	ProcessTab(n, 'Process', main)
	MergeTab(n, 'Merge', main)
	LearningTab(n, 'Learn', main)
	ReportTab(n, 'Report', main)
	AboutTab(n, 'About', main)

	# finish up, return UI
	n.pack()
	return main
예제 #7
0
def init_UI():
    '''create tabs and required content'''

    # initialize main window
    main = Tk()
    main.title('data2knowledge')

    # component for 'tab' functionality
    n = Notebook(main)

    # initialize the various tabs
    EnrichTab(n, 'Enrich', main)
    ProcessTab(n, 'Process', main)
    MergeTab(n, 'Merge', main)
    LearningTab(n, 'Learn', main)
    ReportTab(n, 'Report', main)
    AboutTab(n, 'About', main)

    # finish up, return UI
    n.pack()
    return main
예제 #8
0
def report_sell(master, from_date=None, to_date=None,  cathegory=-1,
    from_check=None, to_check=None, item=None, discount=None):
    """Создает и выводи на экран окно с отчетом по продажам, составленным на
    основании заданных фильтров"""


    def press(index):
        """функция, срабатывающая при нажатии кнопок переключения
        между видами сортировок. Переключает вкладки в блокноте"""

        window_names = tabs.tabs()
        tabs.select(window_names[index])


    def make_query_sell(from_date=None, to_date=None,  cathegory=-1,
        from_check=None, to_check=None, item=None, discount=None):
        """Возвращает кортеж запросов для последующего использования при
        составлении отчета по продажам"""

        select = queries.report_sell_query()

        if cathegory <> -1:
            for q in range(len(select)):
                new_select = []
                for element in select[q]:
                    if element.goods.cathegory == cathegory:
                        new_select.append(element)
                select[q] = new_select

        if item:
            for q in range(len(select)):
                new_select = []
                for element in select[q]:
                    if element.goods == item:
                        new_select.append(element)
                select[q] = new_select

        if from_check and to_check:
            for q in range(len(select)):
                new_select = []
                for element in select[q]:
                    if (element.check.id >= from_check) and (element.check.id
                                                                   <= to_check):
                        new_select.append(element)
                select[q] = new_select

        elif from_check:
            for q in range(len(select)):
                new_select = []
                for element in select[q]:
                    if element.check.id >= from_check:
                        new_select.append(element)
                select[q] = new_select

        elif to_check:
            for q in range(len(select)):
                new_select = []
                for element in select[q]:
                    if element.check.id <= to_check:
                        new_select.append(element)
                select[q] = new_select

        if discount <> None:
            if discount:
                for q in range(len(select)):
                    new_select = []
                    for element in select[q]:
                        if element.discount:
                            new_select.append(element)
                    select[q] = new_select
            else:
                for q in range(len(select)):
                    new_select = []
                    for element in select[q]:
                        if not element.discount:
                            new_select.append(element)
                    select[q] = new_select

        if from_date and to_date:
            for q in range(len(select)):
                new_select = []
                for element in select[q]:
                    if (element.check.date_time >= from_date) and \
                       (element.check.date_time <= to_date + timedelta(days=1)):
                        new_select.append(element)
                select[q] = new_select

        elif from_date:
            for q in range(len(select)):
                new_select = []
                for element in select[q]:
                    if element.check.date_time >= from_date:
                        new_select.append(element)
                select[q] = new_select

        elif to_date:
            for q in range(len(select)):
                new_select = []
                for element in select[q]:
                    if element.check.date_time <= to_date + timedelta(days=1):
                        new_select.append(element)
                select[q] = new_select

        return select


    def show(frame, iterator):
        """Выводит на экран выборку, заданную в iterator"""

        scrollbar = Scrollbar(frame)
        tree = Treeview(frame, selectmode='none', padding=3,
                                style='Custom.Treeview', height=REPORT_HEIGHT,
                                yscrollcommand=scrollbar.set)
        tree.pack(side=LEFT, fill=BOTH, expand=YES)
        scrollbar.config(command=tree.yview)
        scrollbar.pack(side=LEFT, fill=Y)

        tree.tag_configure('1', font=('Verdana', FONT_SIZE_REPORT))
        tree.tag_configure('2', font=('Verdana', FONT_SIZE_REPORT),
                                                           background='#f5f5ff')

        Style().configure('Custom.Treeview', rowheight=FONT_SIZE_REPORT*2)

        columns = ['#' + str(x + 1) for x in range(8)]
        tree.configure(columns=columns)

        for q in range(len(header)):
            tree.heading('#%d' % (q + 1), text=header[q], anchor='w')
            tree.column('#%d' % (q + 1), width=REPORT_SCALE * col_width[q + 1],
                                                                     anchor='w')
        tree.heading('#0', text='', anchor='w')
        tree.column('#0', width=0, anchor='w', minwidth=0)

        flag = True
        summ = 0
        for item in iterator:

            value = item.quantity * item.price * (100 - item.discount) / 100
            summ += value

            col = []
            col.append(add_s(item.check.id))
            col.append(add_s(item.goods.cathegory.name))
            col.append(add_s(item.goods.name))
            col.append(add_s(item.quantity))
            col.append(add_s(item.discount) +'%' if item.discount else ' -- ')
            col.append(add_s(u'%6.2f грн.' % value))
            col.append(add_s(item.check.date_time.strftime('%d.%m.%Y')))
            col.append(add_s(item.check.date_time.time())[:8])

            flag = not flag
            if flag:
                tree.insert('', 'end', text='', values=col, tag='2')
            else:
                tree.insert('', 'end', text='', values=col, tag='1')

        return summ

    # --------------------------------------------#

    tl = Toplevel(master)
    tl.title(u'Отчет по продажам')

    bottom = Frame(tl, relief=SUNKEN)
    bottom.pack(side=BOTTOM, fill=X)

    showArea = []
    tabs = Notebook(tl, style='Hidden.TNotebook')
    for q in range (4):
        frame = Frame(tabs,  height=REPORT_HEIGHT)
        tabs.add(frame, text='')
        showArea.append(frame)
    tabs.pack(side=TOP, fill=BOTH, expand=YES)
    Style().layout('Hidden.TNotebook.Tab', '')

    header = [u'Чек', u'Категория', u'Товар', u'Кол-во', u'Скидка',
                u'Стоимость', u'Дата', u'Время']

    col_width = (0, 10, 15, 38, 10, 10, 20, 16, 16)


    #---------------------TEST-----------
##    cathegory = list(Cathegory.select())[1]
##    item = Assortiment.get(Assortiment.name == u'Солнышко')
##    from_check = 12
##    to_check = 16
##    discount = False
##    from_date = datetime(year=2014, month=9, day=25)
##    to_date = datetime(year=2014, month=9, day=25)
    #------------------------------------


    query = make_query_sell(from_date, to_date, cathegory, from_check, to_check,
                                                                 item, discount)
    for q in range(len(query)):
        summ = show(showArea[q], query[q])

    Button(bottom, text=u'Сортировка\nпо чеку', command=lambda: press(0)).pack(
                                    side=LEFT, padx=REPORT_PAD, pady=REPORT_PAD)

    Button(bottom, text=u'Сортировка\nпо категории', command=lambda: press(1)
                             ).pack(side=LEFT, padx=REPORT_PAD, pady=REPORT_PAD)

    Button(bottom, text=u'Сортировка\nпо товару', command=lambda:press(2)).pack(
                                    side=LEFT, padx=REPORT_PAD, pady=REPORT_PAD)

    Button(bottom, text=u'Сортировка\nпо дате', command=lambda: press(3)).pack(
                                    side=LEFT, padx=REPORT_PAD, pady=REPORT_PAD)


    Button(bottom, text=u'Экспорт в\nMS Excel').pack(
                                   side=RIGHT, padx=REPORT_PAD, pady=REPORT_PAD)

    Label(bottom,
          text=u'Итого: %.2f грн.' % summ,
          font=('Lucida Console', FONT_SIZE_BIG,'bold')).pack(side=RIGHT,
                                               padx=REPORT_PAD, pady=REPORT_PAD)
    tl.focus_set()
예제 #9
0
def report_storage(master, cathegory=-1, item=None):
    """Создает и выводи на экран окно с отчетом по остаткам"""


    def press(index):
        """функция, срабатывающая при нажатии кнопок переключения
        между видами сортировок. Переключает вкладки в блокноте"""

        window_names = tabs.tabs()
        tabs.select(window_names[index])


    def make_query_storage(cathegory=-1, item=None):
        """Возвращает кортеж запросов для последующего использования при
        составлении отчета по остаткам"""

        select = queries.report_storage_query()

        if cathegory <> -1:
            for q in range(len(select)):
                new_select = []
                for element in select[q]:
                    if element.cathegory == cathegory:
                        new_select.append(element)
                select[q] = new_select

        if item:
            for q in range(len(select)):
                new_select = []
                for element in select[q]:
                    if element == item:
                        new_select.append(element)
                select[q] = new_select

        return select


    def show(frame, iterator):
        """Выводит на экран выборку, заданную в iterator"""

        scrollbar = Scrollbar(frame)
        tree = Treeview(frame, selectmode='none', padding=3,
                                    style='Custom.Treeview', height=REPORT_HEIGHT,
                                    yscrollcommand=scrollbar.set)
        tree.pack(side=LEFT, fill=BOTH, expand=YES)
        scrollbar.config(command=tree.yview)
        scrollbar.pack(side=LEFT, fill=Y)

        tree.tag_configure('1', font=('Verdana', FONT_SIZE_REPORT))
        tree.tag_configure('2', font=('Verdana', FONT_SIZE_REPORT),
                                                           background='#f5f5ff')
        tree.tag_configure('red1', font=('Verdana', FONT_SIZE_REPORT),
                                                               foreground='red')
        tree.tag_configure('red2', font=('Verdana', FONT_SIZE_REPORT),
                                         background='#f5f5ff', foreground='red')
        tree.tag_configure('grey1', font=('Verdana', FONT_SIZE_REPORT),
                                                              foreground='#dddddd')
        tree.tag_configure('grey2', font=('Verdana', FONT_SIZE_REPORT),
                                        background='#f5f5ff', foreground='#dddddd')

        Style().configure('Custom.Treeview', rowheight=FONT_SIZE_REPORT*2)

        columns = ['#' + str(x + 1) for x in range(4)]
        tree.configure(columns=columns)

        for q in range(len(header)):
            tree.heading('#%d' % (q + 1), text=header[q], anchor='w')
            tree.column('#%d' % (q + 1), width=REPORT_SCALE * col_width[q + 1],
                                                                     anchor='w')
        tree.heading('#0', text='', anchor='w')
        tree.column('#0', width=0, anchor='w', minwidth=0)

        flag = True
        for item in iterator:
            if not item.calculation:
                col = []
                col.append(add_s(item.cathegory.name if item.cathegory
                                                                 else u'-Нет-'))
                col.append(add_s(item.name))
                storage = queries.items_in_storage(item)
                col.append(add_s(storage))
                col.append(add_s(item.measure))
                if int(storage) > 0:
                    flag = not flag
                    if flag:
                        tree.insert('', 'end', text='', values=col, tag='2')
                    else:
                        tree.insert('', 'end', text='', values=col, tag='1')
                elif storage == '0':
                    flag = not flag
                    if flag:
                        tree.insert('', 'end', text='', values=col, tag='grey2')
                    else:
                        tree.insert('', 'end', text='', values=col, tag='grey1')
                else:
                    flag = not flag
                    if flag:
                        tree.insert('', 'end', text='', values=col, tag='red2')
                    else:
                        tree.insert('', 'end', text='', values=col, tag='red1')


    # --------------------------------------------#

    tl = Toplevel(master)
    tl.title(u'Отчет по остаткам')

    bottom = Frame(tl, relief=SUNKEN)
    bottom.pack(side=BOTTOM, fill=X)

    showArea = []
    tabs = Notebook(tl, style='Hidden.TNotebook')
    for q in range (2):
        frame = Frame(tabs,  height=REPORT_HEIGHT)
        tabs.add(frame, text='')
        showArea.append(frame)
    tabs.pack(side=TOP, fill=BOTH, expand=YES)
    Style().layout('Hidden.TNotebook.Tab', '')

    header = [u'Категория', u'Товар', u'Кол-во', u'Ед.изм.']

    col_width = (0, 15, 38, 14, 8)

    query = make_query_storage(cathegory, item)
    for q in range(len(query)):
        summ = show(showArea[q], query[q])


    Button(bottom, text=u'Сортировка\nпо категории', command=lambda: press(0)
                             ).pack(side=LEFT, padx=REPORT_PAD, pady=REPORT_PAD)

    Button(bottom, text=u'Сортировка\nпо товару', command=lambda:press(1)).pack(
                                    side=LEFT, padx=REPORT_PAD, pady=REPORT_PAD)

    Button(bottom, text=u'Экспорт в\nMS Excel').pack(
                                   side=RIGHT, padx=REPORT_PAD, pady=REPORT_PAD)

    tl.focus_set()
예제 #10
0
    def __init__(self, master):
        
	self.fname=""
        #global variables
        self.t1=StringVar()
        self.t2=StringVar()
        self.t3=StringVar()
        self.t4=StringVar()
        self.t5=StringVar()
        self.t6=StringVar()
        self.t7=StringVar()
        self.t8=StringVar()
        
        self.var1=StringVar()
        self.var2=StringVar()
        self.var3=StringVar()
        self.var4=StringVar()
        self.var5=StringVar()
        self.var6=StringVar()
        self.var7=StringVar()
        self.var8=StringVar()
        #end
        
        mymaster = Frame(master, name='mymaster') # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window    
        #master.minsize(width=900, height=900)
        #master.maxsize(width=870, height=420)
        #end
        
        #title of window
        master.title("Airolib-ng")
        #end
        
        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont=tkFont.Font(family="Helvetica", size=15,underline = True)
        self.myfontnew=tkFont.Font(family="Helvetica", size=11,underline = True)
        #end
        
        
       
        nb = Notebook(mymaster, name='nb') # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3) # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1") # add tab to Notebook
    
        # repeat for each tab
        self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")
        
        #End
        
	#frame content 7
	Label(self.frame_content7, text = 'Airolib-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        btndetect=Button(self.frame_content7, text = 'Detect', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 1, column = 0, padx = 5, pady = 5)
		
	btndbrowse=Button(self.frame_content7, text = 'Attach File', command =self.browse_file, height=2, width=15, font=self.customFont).grid(row = 3, column = 0, padx = 5, pady = 5)	
	self.lilnew1=Listbox(self.frame_content7,bg="black", fg="white", font=self.myfont, selectmode=SINGLE, width=30, height=15)
        self.lilnew1.grid(row = 1, column = 1, rowspan=3)
	#End
	
        Label(self.frame_content, text = 'Airolib-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content, text = 'Options :',font=self.myfontnew, bg="white").grid(row = 1, column = 1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5, text = 'Edit Command From Here',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 0, column = 0)
        TextCommandBox=Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output=Text(self.frame_content5,bg="black", fg="white", font=self.myfont, height=20, width=42)
        self.output.grid(row = 0, column = 1, padx=50, pady=5, rowspan=3)
        btnsubmit=Button(self.frame_content5, width=15, height=2, text="Get Result", command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear=Button(self.frame_content5, width=15, height=2, text="Clear Output", command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "--stats", \
                 onvalue = "--stats", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var1)
        self.C1.grid(row = 2, column = 0, padx = 5, pady = 5)
        self.t1=Text(self.frame_content,height=1,width = 20)
        self.t1.grid(row = 2, column = 1, padx = 5, pady = 5)
        l1=Label(self.frame_content, text = ': Output some information about the database.',font=self.myfont, bg="white", justify=LEFT).grid(row = 2, column = 2, padx = 5, pady = 5)
        
        self.C2 = Checkbutton(self.frame_content, text = "--sql", \
                 onvalue = "--sql", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var2)
        self.C2.grid(row = 3, column = 0, padx = 5, pady = 5)
        self.t2=Text(self.frame_content,height=1,width = 20)
        self.t2.grid(row = 3, column = 1, padx = 5, pady = 5)
        l2=Label(self.frame_content, text = ': Execute the specified SQL statement.',font=self.myfont, bg="white", justify=LEFT).grid(row = 3, column = 2, padx = 5, pady = 5)
        
        self.C3 = Checkbutton(self.frame_content, text = "--clean", \
                 onvalue = "--clean", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row = 4, column = 0, padx = 5, pady = 5)
        self.t3=Text(self.frame_content,height=1,width = 20)
        self.t3.grid(row = 4, column = 1, padx = 5, pady = 5)
        l3=Label(self.frame_content, text = ':   Perform steps to clean the database from old junk.',font=self.myfont, bg="white", justify=LEFT).grid(row = 4, column = 2, padx = 5, pady = 5)
        
        self.C4 = Checkbutton(self.frame_content, text = "- -batch", \
                 onvalue = "--verify", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var4)
        self.C4.grid(row = 5, column = 0, padx = 5, pady = 5)
        self.t4=Text(self.frame_content,height=1,width = 20)
        self.t4.grid(row = 5, column = 1, padx = 5, pady = 5)
        l4=Label(self.frame_content, text = ': Start batch-processing all combinations of ESSIDs and passwords.',font=self.myfont, bg="white", justify=LEFT).grid(row = 5, column = 2, padx = 5, pady = 5)
        
        self.C5 = Checkbutton(self.frame_content, text = "--verify", \
                 onvalue = "--verify", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var5)
        self.C5.grid(row = 6, column = 0, padx = 5, pady = 5)
        self.t5=Text(self.frame_content,height=1,width = 20)
        self.t5.grid(row = 6, column = 1, padx = 5, pady = 5)
        l5=Label(self.frame_content, text = ':  Verify a set of randomly chosen PMKs.',font=self.myfont, bg="white", justify=LEFT).grid(row = 6, column = 2, padx = 5, pady = 5)
        
        self.C6 = Checkbutton(self.frame_content, text = "--export", \
                 onvalue = "--export", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var6)
        self.C6.grid(row = 7, column = 0, padx = 5, pady = 5)
        self.t6=Text(self.frame_content,height=1,width = 20)
        self.t6.grid(row = 7, column = 1, padx = 5, pady = 5)
        l6=Label(self.frame_content, text = ':  Export to a cowpatty file.',font=self.myfont, bg="white", justify=LEFT).grid(row = 7, column = 2, padx = 5, pady = 5)
        
        self.C7 = Checkbutton(self.frame_content, text = "--import cowpatty", \
                 onvalue = "--import cowpatty", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var7)
        self.C7.grid(row = 8, column = 0, padx = 5, pady = 5)
        self.t7=Text(self.frame_content,height=1,width = 20)
        self.t7.grid(row = 8, column = 1, padx = 5, pady = 5)
        l7=Label(self.frame_content, text = ':  Import a cowpatty file and create the database.',font=self.myfont, bg="white", justify=LEFT).grid(row = 8, column = 2, padx = 5, pady = 5)
        
        self.C8 = Checkbutton(self.frame_content, text = "--import", \
                 onvalue = "--import", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var8)
        self.C8.grid(row = 9, column = 0, padx = 5, pady = 5)
        self.t8=Text(self.frame_content,height=1,width = 20)
        self.t8.grid(row = 9, column = 1, padx = 5, pady = 5)
        l8=Label(self.frame_content, text = ':  Import a text flat file as a list of either ESSIDs or passwords and create the database.',font=self.myfont, bg="white", justify=LEFT).grid(row = 9, column = 2, padx = 5, pady = 5)
예제 #11
0
    def initUI(self, students):

        note = Notebook(self.parent)

        #Tabs
        external_tab = Frame(note)
        records_tab = Frame(note)
        edit_tab = Frame(note)
        note.config()
        note.add(external_tab, text="Attendance")
        note.add(records_tab, text="  Records  ")
        note.add(edit_tab, text="    Edit    ")

        #Create the scrollable list on the left side
        scrollbar = tk.Scrollbar(external_tab, orient="vertical")
        lb = tk.Listbox(external_tab,
                        selectmode=MULTIPLE,
                        width=30,
                        height=20,
                        yscrollcommand=scrollbar.set)
        scrollbar.config(command=lb.yview)
        scrollbar.pack(side="left", fill="y")
        lb.pack(side="left", fill="y")
        self.setList(students, lb)

        #Add dialogue box for new student
        frame1 = Frame(external_tab, relief=GROOVE, borderwidth=0)
        info_frame2 = Frame(records_tab, relief=GROOVE, borderwidth=3)
        name = tk.Entry(frame1)
        name.pack(anchor=CENTER, side=BOTTOM)
        frame1.pack(fill=BOTH, expand=1)
        self.pack(fill=BOTH, expand=1)

        #Add the buttons on the right to manipulate the list
        frame = Frame(external_tab, relief=RAISED, borderwidth=0)
        addButton = Button(
            frame,
            text="Add Student",
            command=lambda: self.addStudent(name.get(), lb, lb2, lb3))
        addButton.pack()
        deleteButton = Button(frame,
                              text="Remove Student",
                              command=lambda: self.deleteStudent(
                                  lb.curselection(), lb, lb2, lb3))
        deleteButton.pack(anchor=E, pady=20, side=RIGHT)
        frame.pack()

        markCalendarFrame = Frame(external_tab)
        self.markCalendar = Calendar.newCalendar(markCalendarFrame, True)
        markCalendarFrame.pack()

        #Add the reset button and the mark absent button
        frame2 = Frame(external_tab, relief=RAISED, borderwidth=0)
        absentButton = Button(
            frame2,
            text="Mark as Absent",
            command=lambda: self.markAbsent(lb.curselection()))
        absentButton.pack(side=TOP, pady=20)
        resetButton = Button(frame2,
                             text="Reset Today's Attendance",
                             command=self.resetDay)
        resetButton.pack(side=TOP, pady=20)
        frame2.pack(fill=BOTH, expand=1)
        self.pack(fill=BOTH, expand=1)

        #Create the Records Listbox
        scrollbar2 = tk.Scrollbar(records_tab, orient="vertical")
        lb2 = tk.Listbox(records_tab,
                         selectmode=BROWSE,
                         width=30,
                         height=20,
                         yscrollcommand=scrollbar2.set)
        scrollbar2.config(command=lb2.yview)
        scrollbar2.pack(side="left", fill="y")

        #Bind a click to finding attendance
        lb2.bind('<<ListboxSelect>>', self.getTotals)
        lb2.pack(side="left", fill="y")
        self.setList(students, lb2)

        #Create the text that updates in real time based on selection

        self.present_variable.set('')
        self.absent_variable.set('')
        info_frame = Frame(records_tab, relief=GROOVE, borderwidth=3)
        present_setup = tk.Message(records_tab,
                                   anchor=W,
                                   justify=CENTER,
                                   width=100,
                                   text="Days Present: ")
        present_setup.pack(fill=X, side=TOP)
        present_message = tk.Message(records_tab,
                                     anchor=E,
                                     justify=CENTER,
                                     width=100,
                                     textvariable=self.present_variable)
        present_message.pack(fill=X, side=TOP)
        info_frame.pack(side=TOP)

        absent_setup = tk.Message(records_tab,
                                  anchor=W,
                                  justify=CENTER,
                                  width=100,
                                  text="Days Absent: ")
        absent_setup.pack(fill=X, side=TOP)
        absent_variable = tk.Message(records_tab,
                                     anchor=E,
                                     justify=CENTER,
                                     width=100,
                                     textvariable=self.absent_variable)
        absent_variable.pack(fill=X, side=TOP)
        info_frame2.pack(side=TOP)

        #Create a see Calendar Button
        # calendarButton = Button(records_tab, text="See Specific Days", command= lambda : self.setStudentCalendar(lb2.curselection()))
        # calendarButton.pack(side=TOP)

        calendar_frame = Frame(records_tab,
                               relief=GROOVE,
                               borderwidth=3,
                               width=300)
        self.theCalendar = Calendar.newCalendar(calendar_frame, False)
        calendar_frame.pack(side=TOP, pady=20)

        clearCalendarButton = Button(records_tab,
                                     text="Clear Calendar",
                                     command=self.clearStudentCalendar)
        clearCalendarButton.pack(side=TOP)

        # close and excel buttons
        bottomFrame = Frame(width=20)
        excelButton = Button(bottomFrame,
                             text="Generate Excel",
                             command=self.generateExcel)
        excelButton.pack(side=LEFT, padx=5, pady=5)

        closeButton = Button(bottomFrame,
                             text="Close",
                             command=self.closeButton)
        closeButton.pack(side=RIGHT, padx=10, pady=5)
        bottomFrame.pack(side=BOTTOM)

        scrollbar3 = tk.Scrollbar(edit_tab, orient="vertical")
        lb3 = tk.Listbox(edit_tab,
                         selectmode=BROWSE,
                         width=30,
                         height=20,
                         yscrollcommand=scrollbar3.set)
        scrollbar3.config(command=lb3.yview)
        scrollbar3.pack(side="left", fill="y")
        lb3.bind('<<ListboxSelect>>', self.get_dates)
        lb3.pack(side="left", fill="y")
        self.setList(students, lb3)

        addFrame = Frame(edit_tab)
        remove_date = Button(
            addFrame,
            text="Remove Date",
            command=lambda: self.remove_date(self.lbedit.curselection(
            ), self.lbedit2.curselection(), True))
        remove_date.pack(side=TOP, pady=2)
        add_dates = Button(addFrame,
                           text="Add Date",
                           command=lambda: self.add_date(lb3.curselection()))
        add_dates.pack(side=LEFT, pady=2)
        edit_selection = Button(
            addFrame,
            text="Edit Date",
            command=lambda: self.edit_date(self.lbedit.curselection(),
                                           self.lbedit2.curselection()))
        edit_selection.pack(side=LEFT, pady=2)

        addFrame.pack(side=TOP)

        dateFrame = Frame(edit_tab)
        presentLabel = Label(dateFrame, text="Present")
        presentLabel.pack(side=TOP)
        scrollbar4 = tk.Scrollbar(dateFrame, orient="vertical")
        self.lbedit = tk.Listbox(dateFrame,
                                 selectmode=BROWSE,
                                 width=29,
                                 height=9,
                                 yscrollcommand=scrollbar4.set)
        self.lbedit.pack(side=TOP)

        absentLabel = Label(dateFrame, text="Absent")
        absentLabel.pack(side=TOP)
        scrollbar5 = tk.Scrollbar(dateFrame, orient="vertical")
        self.lbedit2 = tk.Listbox(dateFrame,
                                  selectmode=BROWSE,
                                  width=29,
                                  height=8,
                                  yscrollcommand=scrollbar5.set)
        self.lbedit2.pack(side=TOP, fill="y")

        dateFrame.pack(side=LEFT, fill="y")

        self.pack(fill=BOTH, expand=1)

        note.pack(fill=BOTH, expand=1)
예제 #12
0
    def __init__(self, root):
        # 数据载入和分类器训练
        bc_dataset = BreastCancerDataSet()
        bc_x_train = bc_dataset.x_train
        bc_y_train = bc_dataset.y_train
        bc_x_test = bc_dataset.x_test
        bc_y_test = bc_dataset.y_test

        ctg_dataset = CardiotocographyDataSet()
        ctg_x_train = ctg_dataset.x_train
        ctg_y_train = ctg_dataset.y_train
        ctg_x_test = ctg_dataset.x_test
        ctg_y_test = ctg_dataset.y_test

        # 初始化UI
        menubar = Tk.Menu(root)  # 添加菜单
        root.config(menu=menubar)
        filemenu = Tk.Menu(menubar)
        filemenu.add_command(label="Exit", command=sys.exit)
        menubar.add_cascade(label="File", menu=filemenu)

        notebook = Notebook(root)  # 添加标签页
        notebook.pack(fill=Tk.BOTH)

        page_0 = Tk.Frame(notebook)
        notebook.add(page_0, text="Main  ")
        notebook_0 = Notebook(page_0)  # 添加子标签页
        notebook_0.pack(fill=Tk.BOTH)
        page_01 = Tk.Frame(notebook_0)
        notebook_0.add(page_01, text="Breast Cancer")
        page_02 = Tk.Frame(notebook_0)
        notebook_0.add(page_02, text="Cardiotocography")
        page_05 = Tk.Frame(notebook_0)
        notebook_0.add(page_05, text="Cardiotocography Features Rank")
        page_04 = Tk.Frame(notebook_0)
        notebook_0.add(page_04, text="Cardiotocography Features Corr")
        page_03 = Tk.Frame(notebook_0)
        notebook_0.add(page_03, text="Cardiotocography Features Pair")
        page_06 = Tk.Frame(notebook_0)
        notebook_0.add(page_06, text="Console Output")

        page_1 = Tk.Frame(notebook)
        notebook.add(page_1, text="Training  ")
        notebook_1 = Notebook(page_1)  # 添加子标签页
        notebook_1.pack(fill=Tk.BOTH)
        page_11 = Tk.Frame(notebook_1)
        notebook_1.add(page_11, text="LR")
        page_12 = Tk.Frame(notebook_1)
        notebook_1.add(page_12, text="SVM")
        page_13 = Tk.Frame(notebook_1)
        notebook_1.add(page_13, text="RF")

        page_2 = Tk.Frame(notebook)
        notebook.add(page_2, text="Testing  ")
        subnotebook_2 = Notebook(page_2)  # 添加子标签页
        subnotebook_2.pack(fill=Tk.BOTH)
        page_21 = Tk.Frame(subnotebook_2)
        subnotebook_2.add(page_21, text="LR")
        page_22 = Tk.Frame(subnotebook_2)
        subnotebook_2.add(page_22, text="SVM")
        page_23 = Tk.Frame(subnotebook_2)
        subnotebook_2.add(page_23, text="RF")

        page_3 = Tk.Frame(notebook)
        notebook.add(page_3, text="Learning Curve")

        page_4 = Tk.Frame(notebook)
        notebook.add(page_4, text="Validation Curve")

        page_5 = Tk.Frame(notebook)
        notebook.add(page_5, text="ROC & AUC")

        page_6 = Tk.Frame(notebook)
        notebook.add(page_6, text="GridSearchCV")

        page_7 = Tk.Frame(notebook)
        notebook.add(page_7, text="t-SNE")

        # 第0页 主页

        console = ConsoleFrame(page_06)
        console.pack(fill=Tk.BOTH)

        bc_eva = Evaluator(scaler=StandardScaler(), pca=PCA(n_components=2), clf=SVC(probability=True, random_state=1))
        BreastCancerMainFrame(page_01, bc_x_train, bc_y_train, bc_x_test, bc_y_test, bc_eva, console).pack(fill=Tk.BOTH)

        ctg_eva = Evaluator(scaler=StandardScaler(), pca=PCA(n_components=2), clf=SVC(probability=True, random_state=1))
        CardiotocographyMainFrame(page_02, ctg_x_train, ctg_y_train, ctg_x_test, ctg_y_test, ctg_eva, console).pack(fill=Tk.BOTH)

        FeaturesPairFrame(page_03, ctg_x_train, ctg_y_train, ctg_x_test, ctg_y_test, ctg_eva, ctg_dataset.df, console).pack(
            fill=Tk.BOTH)

        FeaturesCorrFrame(page_04, ctg_x_train, ctg_y_train, ctg_x_test, ctg_y_test, ctg_eva, ctg_dataset.df, console).pack(
            fill=Tk.BOTH)

        FeaturesRankFrame(page_05, ctg_x_train, ctg_y_train, ctg_x_test, ctg_y_test, ctg_eva, ctg_dataset.df, console).pack(
            fill=Tk.BOTH)
예제 #13
0
class GUI:

    ## GUI variables
    titleText = 'PyCX Simulator'  # window title
    timeInterval = 0              # refresh time in milliseconds
    running = False
    modelFigure = None
    stepSize = 1
    currentStep = 0
    def __init__(self,title='PyCX Simulator',interval=0,stepSize=1,parameterSetters=[]):
        self.titleText = title
        self.timeInterval = interval
        self.stepSize = stepSize
        self.parameterSetters = parameterSetters
        self.varEntries = {}
        self.statusStr = ""
               
        self.initGUI()
    def initGUI(self):
        #create root window
        self.rootWindow = Tk()
        self.statusText = StringVar(value=self.statusStr) 
        self.setStatusStr("Simulation not yet started")

        self.rootWindow.wm_title(self.titleText)
        self.rootWindow.protocol('WM_DELETE_WINDOW',self.quitGUI)
        self.rootWindow.geometry('550x400')
        self.rootWindow.columnconfigure(0, weight=1)
        self.rootWindow.rowconfigure(0, weight=1)
        
        self.notebook = Notebook(self.rootWindow)      
        self.notebook.grid(row=0,column=0,padx=2,pady=2,sticky='nswe')
        

        self.frameRun = Frame()
        self.frameSettings = Frame()
        self.frameParameters = Frame()
        self.frameInformation = Frame()          
        
        self.notebook.add(self.frameRun,text="Run")
        self.notebook.add(self.frameSettings,text="Settings")
        self.notebook.add(self.frameParameters,text="Parameters")
        self.notebook.add(self.frameInformation,text="Info")
     
        self.notebook.pack(expand=YES, fill=BOTH, padx=5, pady=5 ,side=TOP)
        self.status = Label(self.rootWindow, width=40,height=3, relief=SUNKEN, bd=1,textvariable=self.statusText)
        self.status.grid(row=1,column=0,padx=2,pady=2,sticky='nswe')
        self.status.pack(side=TOP, fill=X, padx=1, pady=1, expand=NO)



        
        self.runPauseString = StringVar()
        self.runPauseString.set("Run")
        self.buttonRun = Button(self.frameRun,width=30,height=2,textvariable=self.runPauseString,command=self.runEvent)
        self.buttonRun.pack(side=TOP, padx=5, pady=5)



        self.showHelp(self.buttonRun,"Runs the simulation (or pauses the running simulation)")
        self.buttonStep = Button(self.frameRun,width=30,height=2,text='Step Once',command=self.stepOnce)
        self.buttonStep.pack(side=TOP, padx=5, pady=5)
        self.showHelp(self.buttonStep,"Steps the simulation only once")
        self.buttonReset = Button(self.frameRun,width=30,height=2,text='Reset',command=self.resetModel)
        self.buttonReset.pack(side=TOP, padx=5, pady=5) 
        self.showHelp(self.buttonReset,"Resets the simulation")
 
   
        
        can = Canvas(self.frameSettings)
        lab = Label(can, width=25,height=1,text="Step size ", justify=LEFT, anchor=W,takefocus=0)
        lab.pack(side='left')
        self.stepScale = Scale(can,from_=1, to=50, resolution=1,command=self.changeStepSize,orient=HORIZONTAL, width=25,length=150)
        self.stepScale.set(self.stepSize)
        self.showHelp(self.stepScale,"Skips model redraw during every [n] simulation steps\nResults in a faster model run.")
        self.stepScale.pack(side='left')    
        can.pack(side='top')
    
        can = Canvas(self.frameSettings)
        lab = Label(can, width=25,height=1,text="Step visualization delay in ms ", justify=LEFT, anchor=W,takefocus=0)
        lab.pack(side='left')
        self.stepDelay = Scale(can,from_=0, to=max(2000,self.timeInterval), resolution=10,command=self.changeStepDelay,orient=HORIZONTAL, width=25,length=150)
        self.stepDelay.set(self.timeInterval)
        self.showHelp(self.stepDelay,"The visualization of each step is delays by the given number of milliseconds.")
        self.stepDelay.pack(side='left')    
        can.pack(side='top')
        scrollInfo = Scrollbar(self.frameInformation)
        self.textInformation = Text(self.frameInformation, width=45,height=13,bg='lightgray',wrap=WORD,font=("Courier",10))
        scrollInfo.pack(side=RIGHT, fill=Y)
        self.textInformation.pack(side=LEFT,fill=BOTH,expand=YES)
        scrollInfo.config(command=self.textInformation.yview)
        self.textInformation.config(yscrollcommand=scrollInfo.set)
        for variableSetter in self.parameterSetters:
            can = Canvas(self.frameParameters)
            lab = Label(can, width=25,height=1,text=variableSetter.__name__+" ",anchor=W,takefocus=0)
            lab.pack(side='left')
            ent = Entry(can, width=11)
            ent.insert(0, str(variableSetter()))
            if variableSetter.__doc__ != None and len(variableSetter.__doc__) > 0:
                self.showHelp(ent,variableSetter.__doc__.strip())
            ent.pack(side='left')            
            can.pack(side='top')
            self.varEntries[variableSetter]=ent
        if len(self.parameterSetters) > 0:
            self.buttonSaveParameters = Button(self.frameParameters,width=50,height=1,command=self.saveParametersCmd,text="Save parameters to the running model",state=DISABLED)
            self.showHelp(self.buttonSaveParameters,"Saves the parameter values.\nNot all values may take effect on a running model\nA model reset might be required.")
            self.buttonSaveParameters.pack(side='top',padx=5,pady=5)
            self.buttonSaveParametersAndReset = Button(self.frameParameters,width=50,height=1,command=self.saveParametersAndResetCmd,text="Save parameters to the model and reset the model")
            self.showHelp(self.buttonSaveParametersAndReset,"Saves the given parameter values and resets the model")
            self.buttonSaveParametersAndReset.pack(side='top',padx=5,pady=5)
        
    
    def setStatusStr(self,newStatus):
        self.statusStr = newStatus
        self.statusText.set(self.statusStr)  
    #model control functions
    def changeStepSize(self,val):        
        self.stepSize = int(val)
    def changeStepDelay(self,val):        
        self.timeInterval= int(val)    
    def saveParametersCmd(self):
        for variableSetter in self.parameterSetters:
            variableSetter(float(self.varEntries[variableSetter].get()))
        self.setStatusStr("New parameter values have been set")
    def saveParametersAndResetCmd(self):
        self.saveParametersCmd()
        self.resetModel()

    def runEvent(self):
        self.running = not self.running
        if self.running:
            self.rootWindow.after(self.timeInterval,self.stepModel)
            self.runPauseString.set("Pause")
            self.buttonStep.configure(state=DISABLED)
            self.buttonReset.configure(state=DISABLED)
            if len(self.parameterSetters) > 0:
                self.buttonSaveParameters.configure(state=NORMAL)
                self.buttonSaveParametersAndReset.configure(state=DISABLED)     
        else:
            self.runPauseString.set("Continue Run")
            self.buttonStep.configure(state=NORMAL)
            self.buttonReset.configure(state=NORMAL)
            if len(self.parameterSetters) > 0:
                self.buttonSaveParameters.configure(state=NORMAL)
                self.buttonSaveParametersAndReset.configure(state=NORMAL)

    def stepModel(self):
        if self.running:
            self.modelStepFunc()
            self.currentStep += 1
            self.setStatusStr("Step "+str(self.currentStep))
            self.status.configure(foreground='black')
            if (self.currentStep) % self.stepSize == 0:
                self.drawModel()
            self.rootWindow.after(int(self.timeInterval*1.0/self.stepSize),self.stepModel)

    def stepOnce(self):
        self.running = False
        self.runPauseString.set("Continue Run")
        self.modelStepFunc()
        self.currentStep += 1
        self.setStatusStr("Step "+str(self.currentStep))
        self.drawModel()
        if len(self.parameterSetters) > 0:
            self.buttonSaveParameters.configure(state=NORMAL)

    def resetModel(self):
        self.running = False        
        self.runPauseString.set("Run")
        self.modelInitFunc()
        self.currentStep = 0;
        self.setStatusStr("Model has been reset")
        self.drawModel()

    def drawModel(self):
        
        if self.modelFigure == None or self.modelFigure.canvas.manager.window == None:
            self.modelFigure = PL.figure()
            PL.ion()
            PL.show()
        self.modelDrawFunc()
        self.modelFigure.canvas.manager.window.update()

    def start(self,func=[]):
        if len(func)==3:
            self.modelInitFunc = func[0]
            self.modelDrawFunc = func[1]
            self.modelStepFunc = func[2]            
            if (self.modelStepFunc.__doc__ != None and len(self.modelStepFunc.__doc__)>0):
                self.showHelp(self.buttonStep,self.modelStepFunc.__doc__.strip())                
            if (self.modelInitFunc.__doc__ != None and len(self.modelInitFunc.__doc__)>0):
                self.textInformation.config(state=NORMAL)
                self.textInformation.delete(1.0, END)
                self.textInformation.insert(END, self.modelInitFunc.__doc__.strip())
                self.textInformation.config(state=DISABLED)
                
            self.modelInitFunc()
            self.drawModel()     
        self.rootWindow.mainloop()

    def quitGUI(self):
        PL.close('all')
        self.rootWindow.quit()
        self.rootWindow.destroy()
    
    
    
    def showHelp(self, widget,text):
        def setText(self):
            self.statusText.set(text)
            self.status.configure(foreground='blue')
            
        def showHelpLeave(self):
            self.statusText.set(self.statusStr)
            self.status.configure(foreground='black')
        widget.bind("<Enter>", lambda e : setText(self))
        widget.bind("<Leave>", lambda e : showHelpLeave(self))
예제 #14
0
class Arrendatarios(Frame):
        def __init__(self, parent, controller):
                Frame.__init__(self, parent)
                
                #VARIABLES GLOBALES
                global cedula, titulo, residencia, nombres, apellidos, direccion, telefono, envio, correo, celular, dia, mes, profesion, empresa, oficina, tel, telfax, banco, tcuenta, numcuenta, tipopersona, retefuente, reteiva, gcontribuyente, gfactura, gcheque, notas, co1cc, co1nombres, co1dir, co1tel1, co1cargo, co1empresa, co1oficina, co1tel2, co2cc, co2nombres, co2dir, co2tel1, co2cargo, co2empresa, co2oficina, co2tel2, co3cc, co3nombres, co3dir, co3tel1, co3cargo, co3empresa, co3oficina, co3tel2, lb, note, busqueda, dato, E
                
                #INSTANCIEAS DE LOS WIDGETS
                global codeE, refE, cityE, nameE, lastnameE, adressE, phoneE, mailE, emailE, mobileE, birthdayE, birthdayCbx, ocupationE, companyE, ofiE, officetelE, faxE, bankCbx, banktypeCbx, numbankE, personR1, personR2, Ch1, Ch2, Ch3, Ch4, Ch5, note, cc1E, name1E, adress1E, phone1E, job1E, jobphone1E, office1E, officetel1E, cc2E, name2E, adress2E, phone2E, job2E, jobphone2E, office2E, officetel2E, cc3E, name3E, adress3E, phone3E, job3E, jobphone3E, office3E, officetel3E, add, update, delete, clean, cancel
                global info, _arrendatarios

                _arrendatarios = dict()
                
                #Variables
                cedula = StringVar()
                titulo = StringVar()
                residencia = StringVar()
                nombres = StringVar()
                apellidos = StringVar()
                direccion = StringVar()
                telefono = StringVar()
                envio = StringVar()
                correo = StringVar()
                celular = StringVar()
                dia = IntVar()
                mes = StringVar()
                meses = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto","Septiembre", "Octubre", "Noviembre", "Diciembre"]
                profesion = StringVar()
                empresa = StringVar()
                oficina = StringVar()
                tel = StringVar()
                telfax = StringVar()
                banco = StringVar()
                bancos = ['Bancolombia', "Banco Bogotá", "Banco Agrario", "Banco Occidente"]
                banktype = ['Corriente','Ahorro']
                tcuenta = StringVar()
                numcuenta = StringVar()
                tipopersona = IntVar()  
                retefuente = IntVar()
                reteiva = IntVar()
                gcontribuyente = IntVar()
                gfactura = IntVar()
                gcheque = IntVar()
                notas = StringVar()
                
                #----------------------------
                
                co1cc = StringVar()
                co1nombres = StringVar()
                co1dir = StringVar()
                co1tel1 = StringVar()
                co1cargo = StringVar()
                co1empresa = StringVar()
                co1oficina = StringVar()
                co1tel2 = StringVar()
                
                co2cc = StringVar()
                co2nombres = StringVar()
                co2dir = StringVar()
                co2tel1 = StringVar()
                co2cargo = StringVar()
                co2empresa = StringVar()
                co2oficina = StringVar()
                co2tel2 = StringVar()
                
                co3cc = StringVar()
                co3nombres = StringVar()
                co3dir = StringVar()
                co3tel1 = StringVar()
                co3cargo = StringVar()
                co3empresa = StringVar()
                co3oficina = StringVar()
                co3tel2 = StringVar()
                
                #BUSQUEDA = ["Nombre","CC/Nit"]
                busqueda = StringVar()
                busqueda.trace("w", lambda name, index, mode: buscar())
                info = IntVar()
                dato = StringVar()

                #WIDGETS
                
                #========================= HEADER ===========================
                
                self.header = Label(self, text="GESTIÓN DE ARRENDATARIOS", font="bold")
                self.header.pack(pady=20, side=TOP)
                
                #========================= WRAPPER ===========================
                
                self.wrapper = Frame (self)
                self.wrapper.pack(side=LEFT, fill=Y)
                #Esto centro el wrapper
                #self.wrapper.pack(side=LEFT, fill=BOTH, expand=True)
                
                #================ NOTEBOOK =============>
                
                self.nb = Notebook(self.wrapper)
                
                #-----------------------> TAB 1
                
                self.tab1 = Frame (self.nb)
                
                self.f0 = Frame(self.tab1)#Para dejar espacio entre Tab y Label
                self.f0.pack(fill=X, pady=10)#-------------------------------

                #======================= DATOS GENERALES =======================
                
                self.f0 = Frame(self.tab1)
                self.f0.pack(pady=5,fill=X)#------------------------------------
                
                self.codeL = Label(self.f0, text='CC:')
                self.codeL.pack(side=LEFT)
                codeE = Entry(self.f0, textvariable=cedula, width=10)
                codeE.pack(side=LEFT, fill=X, expand=1)
                codeE.focus_set()

                self.refL = Label(self.f0, text='Título:')
                self.refL.pack(side=LEFT)
                refE = Entry(self.f0, textvariable=titulo, width=10)
                refE.pack(side=LEFT)
                #refE.bind("<KeyRelease>", caps)

                self.cityL = Label(self.f0, text='Ciudad de residencia:')
                self.cityL.pack(side=LEFT)
                cityE = Entry(self.f0, textvariable=residencia, width=10)
                cityE.pack(side=LEFT)
                cityE.bind("<KeyRelease>", caps)

                self.f1 = Frame(self.tab1)#-------------------------------
                self.f1.pack(pady=5,fill=X)

                self.nameL = Label(self.f1, text='Nombres:')
                self.nameL.pack(side=LEFT)
                nameE = Entry(self.f1, textvariable=nombres)
                nameE.pack(side=LEFT, fill=X, expand=1)
                nameE.bind("<KeyRelease>", caps)

                self.lastnameL = Label(self.f1, text='Apellidos:')
                self.lastnameL.pack(side=LEFT)
                lastnameE = Entry(self.f1, textvariable=apellidos)
                lastnameE.pack(side=LEFT, fill=X, expand=1)
                lastnameE.bind("<KeyRelease>", caps)

                self.f2 = Frame(self.tab1)
                self.f2.pack(pady=5,fill=X)#------------------------------------

                self.adressL = Label(self.f2, text='Dir. Casa:')
                self.adressL.pack(side=LEFT)
                adressE = Entry(self.f2, textvariable=direccion)
                adressE.pack(side=LEFT, fill=X, expand=1)
                adressE.bind("<KeyRelease>", caps)

                self.phoneL = Label(self.f2, text='Teléfono:')
                self.phoneL.pack(side=LEFT)
                phoneE = Entry(self.f2, textvariable=telefono, width=20)
                phoneE.pack(side=LEFT)

                self.f3 = Frame(self.tab1)
                self.f3.pack(pady=5,fill=X)#---------------------------

                self.mailL = Label(self.f3, text='Dir. Correspondencia:')
                self.mailL.pack(side=LEFT)
                mailE = Entry(self.f3, textvariable=envio)
                mailE.pack(side=LEFT, fill=X, expand=1)
                mailE.bind("<KeyRelease>", caps)

                self.emailL = Label(self.f3, text='Email:')
                self.emailL.pack(side=LEFT)
                emailE = Entry(self.f3, textvariable=correo, width=15)
                emailE.pack(side=LEFT, fill=X, expand=1)

                self.f4 = Frame(self.tab1)
                self.f4.pack(pady=5,fill=X)#---------------------------
                
                self.mobileL = Label(self.f4, text='Celular:')
                self.mobileL.pack(side=LEFT)
                mobileE = Entry(self.f4, textvariable=celular, width=10)
                mobileE.pack(side=LEFT, fill=X, expand=1)

                self.birthdayL = Label(self.f4, text='Cumpleaños:')
                self.birthdayL.pack(side=LEFT)

                self.birthdayL2 = Label(self.f4, text='Día:')
                self.birthdayL2.pack(padx=5,side=LEFT)

                birthdayE = Entry(self.f4, textvariable=dia, width=3)
                birthdayE.pack(side=LEFT)
                
                #s = Spinbox(self.f4, from_=1, to=31,textvariable=dia, width=3)
                #s.pack(side=LEFT)

                self.birthdayL3 = Label(self.f4, text='Mes:')
                self.birthdayL3.pack(padx=5,side=LEFT)

                birthdayCbx = Combobox(self.f4, textvariable=mes, values=meses, width=10)
                birthdayCbx.set('Enero')
                birthdayCbx.pack(side=LEFT)

                self.lf = LabelFrame(self.tab1, text="Info laboral")#========

                self.f5 = Frame(self.lf)
                self.f5.pack(pady=5,fill=X)#---------------------------

                self.ocupationL = Label(self.f5, text='Profesión:')
                self.ocupationL.pack(side=LEFT)
                ocupationE = Entry(self.f5, textvariable=profesion, width=20)
                ocupationE.pack(side=LEFT, fill=X, expand=1)
                ocupationE.bind("<KeyRelease>", caps)

                self.companyL = Label(self.f5, text='Empresa:')
                self.companyL.pack(side=LEFT)
                companyE = Entry(self.f5, textvariable=empresa, width=24)
                companyE.pack(side=LEFT, fill=X, expand=1)
                companyE.bind("<KeyRelease>", caps)

                self.f6 = Frame(self.lf)
                self.f6.pack(pady=5,fill=X)#--------------------

                self.ofiL = Label(self.f6, text='Dir. Oficina:')
                self.ofiL.pack(side=LEFT)
                ofiE = Entry(self.f6, textvariable=oficina)
                ofiE.pack(side=LEFT, fill=X, expand=1)
                ofiE.bind("<KeyRelease>", caps)

                self.officetelL = Label(self.f6, text='Tel:')
                self.officetelL.pack(side=LEFT)
                officetelE = Entry(self.f6, textvariable=tel, width=10)
                officetelE.pack(fill=X, side=LEFT)

                self.faxL = Label(self.f6, text='Fax:')
                self.faxL.pack(side=LEFT)
                faxE = Entry(self.f6, textvariable=telfax, width=10)
                faxE.pack(side=LEFT)
                
                self.lf.pack(fill=X)#===========================================
        
                self.f7 = Frame(self.tab1)
                self.f7.pack(pady=5,fill=X)#-----------------

                self.bankL = Label(self.f7, text='Banco:')
                self.bankL.pack(side=LEFT)

                bankCbx = Combobox(self.f7, textvariable=banco, values=bancos, width=12)
                bankCbx.set('')
                bankCbx.pack(side=LEFT)

                self.bankL = Label(self.f7, text='Tipo Cuenta:')
                self.bankL.pack(side=LEFT)

                banktypeCbx = Combobox(self.f7, textvariable=tcuenta, values=banktype, width=10)
                banktypeCbx.set('')
                banktypeCbx.pack(side=LEFT)

                self.numbankL = Label(self.f7, text="# Cuenta:")
                self.numbankL.pack(side=LEFT)
                numbankE = Entry(self.f7, textvariable=numcuenta, width=13)
                numbankE.pack(side=LEFT, fill=X, expand=1)

                self.f8 = Frame(self.tab1)
                self.f8.pack(pady=5,fill=X)#--------------------

                self.personL = Label(self.f8, text='Tipo Persona:')
                self.personL.pack(side=LEFT)
                personR1 = Radiobutton(self.f8, text="Natural", variable=tipopersona, value=1)
                personR1.pack(padx=20,side=LEFT)
                personR2 = Radiobutton (self.f8, text="Jurídica", variable=tipopersona, value=2)
                personR2.pack(padx=20,side=LEFT)
                
                self.f = Frame(self.tab1)
                self.f.pack(pady=5,fill=X)#------------------------------------

                Ch1 = Checkbutton(self.f, text="Retefuente", variable=retefuente)
                Ch1.pack(side=LEFT)
                
                Ch2 = Checkbutton(self.f, text="Rete IVA", variable=reteiva)
                Ch2.pack(side=LEFT)
                
                Ch3 = Checkbutton(self.f, text="Gran Contribuyente", variable=gcontribuyente)
                Ch3.pack(side=LEFT)
                
                Ch4 = Checkbutton(self.f, text="Genera Factura", variable=gfactura)
                Ch4.pack(side=LEFT)
                
                Ch5 = Checkbutton(self.f, text="Genera Cheque", variable=gcheque)
                Ch5.pack(side=LEFT)

                self.f9 = Frame(self.tab1)
                self.f9.pack(pady=5,fill=X)#--------------------

                self.notesL = Label(self.f9, text='Observaciones:')
                self.notesL.pack(side=LEFT)

                self.f10 = Frame(self.tab1)
                self.f10.pack(pady=5,fill=X)#-------------------

                note = Text(self.f10, height=5)
                note.pack(fill=X, side=LEFT)
                #note.bind("<KeyRelease>", caps)
                
                #-----------------------> TAB 2
                
                self.tab2 = Frame (self.nb)
                self.tab2.pack()
                
                self.f0 = Frame(self.tab2)#Para dejar espacio entre Tab y Label
                self.f0.pack(fill=X, pady=10)#----------------------------------
                
                #===================== INFORMACIÓN CODEUDOR ====================
                
                self.lf1 = LabelFrame(self.tab2, text="Codeudor 1")
                
                self.f0 = Frame(self.lf1)
                self.f0.pack(fill=X, pady=5)#-------------------------------
                
                self.ccL = Label(self.f0, text='CC:')
                self.ccL.pack(side=LEFT)
                cc1E = Entry(self.f0, textvariable= co1cc, width=10)
                cc1E.pack(side=LEFT, fill=X, expand=1)
                
                self.nameL = Label(self.f0, text='Nombres:')
                self.nameL.pack(side=LEFT)
                name1E = Entry(self.f0, textvariable=co1nombres)
                name1E.pack(side=LEFT, fill=X, expand=1)
                name1E.bind("<KeyRelease>", caps)
                
                self.f1 = Frame(self.lf1)
                self.f1.pack(fill=X, pady=5)#-------------------------------
                
                self.adressL = Label(self.f1, text='Dir. Casa:')
                self.adressL.pack(side=LEFT)
                adress1E = Entry(self.f1, textvariable=co1dir)
                adress1E.pack(side=LEFT, fill=X, expand=1)
                adress1E.bind("<KeyRelease>", caps)

                self.phoneL = Label(self.f1, text='Tel:')
                self.phoneL.pack(side=LEFT)
                phone1E = Entry(self.f1, textvariable=co1tel1, width=20)
                phone1E.pack(side=LEFT)
                
                self.f2 = Frame(self.lf1)
                self.f2.pack(fill=X, pady=5)#-------------------------------
                
                self.jobL = Label(self.f2, text='Cargo:')
                self.jobL.pack(side=LEFT)
                job1E = Entry(self.f2, textvariable=co1cargo, width=20)
                job1E.pack(side=LEFT, fill=X, expand=1)
                job1E.bind("<KeyRelease>", caps)

                self.phoneL = Label(self.f2, text='Empresa:')
                self.phoneL.pack(side=LEFT)
                jobphone1E = Entry(self.f2, textvariable=co1empresa)
                jobphone1E.pack(side=LEFT)
                jobphone1E.bind("<KeyRelease>", caps)
                
                self.f3 = Frame(self.lf1)
                self.f3.pack(fill=X, pady=5)#-------------------------------
                
                self.officeL = Label(self.f3, text='Dir. Oficina:')
                self.officeL.pack(side=LEFT)
                office1E = Entry(self.f3, textvariable=co1oficina)
                office1E.pack(side=LEFT, fill=X, expand=1)
                office1E.bind("<KeyRelease>", caps)

                self.officetelL = Label(self.f3, text='Tel:')
                self.officetelL.pack(side=LEFT)
                officetel1E = Entry(self.f3, textvariable=co1tel2, width=20)
                officetel1E.pack(fill=X, side=LEFT)
                
                self.lf1.pack(fill=X, ipady=5)#=================================
                
                self.lf2 = LabelFrame(self.tab2, text="Codeudor 2")
                
                self.f0 = Frame(self.lf2)
                self.f0.pack(fill=X, pady=5)#-------------------------------
                
                self.ccL = Label(self.f0, text='CC:')
                self.ccL.pack(side=LEFT)
                cc2E = Entry(self.f0, textvariable=co2cc, width=10)
                cc2E.pack(side=LEFT, fill=X, expand=1)
                
                self.nameL = Label(self.f0, text='Nombres:')
                self.nameL.pack(side=LEFT)
                name2E = Entry(self.f0, textvariable=co2nombres)
                name2E.pack(side=LEFT, fill=X, expand=1)
                name2E.bind("<KeyRelease>", caps)
                
                self.f1 = Frame(self.lf2)
                self.f1.pack(fill=X, pady=5)#-------------------------------
                
                self.adressL = Label(self.f1, text='Dir. Casa:')
                self.adressL.pack(side=LEFT)
                adress2E = Entry(self.f1, textvariable=co2dir)
                adress2E.pack(side=LEFT, fill=X, expand=1)
                adress2E.bind("<KeyRelease>", caps)

                self.phoneL = Label(self.f1, text='Tel:')
                self.phoneL.pack(side=LEFT)
                phone2E = Entry(self.f1, textvariable=co2tel1, width=20)
                phone2E.pack(side=LEFT)
                
                self.f2 = Frame(self.lf2)
                self.f2.pack(fill=X, pady=5)#-------------------------------
                
                self.adressL = Label(self.f2, text='Cargo:')
                self.adressL.pack(side=LEFT)
                job2E = Entry(self.f2, textvariable=co2cargo, width=20)
                job2E.pack(side=LEFT, fill=X, expand=1)
                job2E.bind("<KeyRelease>", caps)

                self.phoneL = Label(self.f2, text='Empresa:')
                self.phoneL.pack(side=LEFT)
                jobphone2E = Entry(self.f2, textvariable=co2empresa)
                jobphone2E.pack(side=LEFT)
                jobphone2E.bind("<KeyRelease>", caps)
                
                self.f3 = Frame(self.lf2)
                self.f3.pack(fill=X, pady=5)#-------------------------------
                
                self.officeL = Label(self.f3, text='Dir. Oficina:')
                self.officeL.pack(side=LEFT)
                office2E = Entry(self.f3, textvariable=co2oficina)
                office2E.pack(side=LEFT, fill=X, expand=1)
                office2E.bind("<KeyRelease>", caps)

                self.officetelL = Label(self.f3, text='Tel:')
                self.officetelL.pack(side=LEFT)
                officetel2E = Entry(self.f3, textvariable=co2tel2, width=20)
                officetel2E.pack(fill=X, side=LEFT)
                
                self.lf2.pack(fill=X, ipady=5)#=================================
                
                self.lf3 = LabelFrame(self.tab2, text="Codeudor 3")
                
                self.f0 = Frame(self.lf3)
                self.f0.pack(fill=X, pady=5)#-------------------------------
                
                self.ccL = Label(self.f0, text='CC:')
                self.ccL.pack(side=LEFT)
                cc3E = Entry(self.f0, textvariable=co3cc, width=10)
                cc3E.pack(side=LEFT, fill=X, expand=1)
                
                self.nameL = Label(self.f0, text='Nombres:')
                self.nameL.pack(side=LEFT)
                name3E = Entry(self.f0, textvariable=co3nombres)
                name3E.pack(side=LEFT, fill=X, expand=1)
                name3E.bind("<KeyRelease>", caps)
                
                self.f1 = Frame(self.lf3)
                self.f1.pack(fill=X, pady=5)#-------------------------------
                
                self.adressL = Label(self.f1, text='Dir. Casa:')
                self.adressL.pack(side=LEFT)
                adress3E = Entry(self.f1, textvariable=co3dir)
                adress3E.pack(side=LEFT, fill=X, expand=1)
                adress3E.bind("<KeyRelease>", caps)

                self.phoneL = Label(self.f1, text='Tel:')
                self.phoneL.pack(side=LEFT)
                phone3E = Entry(self.f1, textvariable=co3tel1, width=20)
                phone3E.pack(side=LEFT)
                
                self.f2 = Frame(self.lf3)
                self.f2.pack(fill=X, pady=5)#-------------------------------
                
                self.adressL = Label(self.f2, text='Cargo:')
                self.adressL.pack(side=LEFT)
                job3E = Entry(self.f2, textvariable=co3cargo, width=20)
                job3E.pack(side=LEFT, fill=X, expand=1)
                job3E.bind("<KeyRelease>", caps)

                self.phoneL = Label(self.f2, text='Empresa:')
                self.phoneL.pack(side=LEFT)
                jobphone3E = Entry(self.f2, textvariable=co3empresa)
                jobphone3E.pack(side=LEFT)
                jobphone3E.bind("<KeyRelease>", caps)
                
                self.f3 = Frame(self.lf3)
                self.f3.pack(fill=X, pady=5)#-------------------------------
                
                self.officeL = Label(self.f3, text='Dir. Oficina:')
                self.officeL.pack(side=LEFT)
                office3E = Entry(self.f3, textvariable=co3oficina)
                office3E.pack(side=LEFT, fill=X, expand=1)
                office3E.bind("<KeyRelease>", caps)

                self.officetelL = Label(self.f3, text='Tel:')
                self.officetelL.pack(side=LEFT)
                officetel3E = Entry(self.f3, textvariable=co3tel2, width=20)
                officetel3E.pack(fill=X, side=LEFT)
                
                self.lf3.pack(fill=X, ipady=5)#=================================
                
                #---------------------------------------------------------------
                
                self.nb.add (self.tab1, text="Datos Generales")
                self.nb.add(self.tab2, text="Información Codeudor")
                
                self.nb.pack()

                #=========================== BOTONES ===========================
                
                self.fBtn = Frame(self.wrapper)
                self.fBtn.pack()#-------------------------------
        
                clean = Button(self.fBtn, text='Limpiar', bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=limpiar)
                clean.pack(side=RIGHT)
                
                update = Button(self.fBtn, text='Actualizar', bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=actualizar, state=DISABLED)
                update.pack(side=RIGHT)
                
                add = Button(self.fBtn, text='Agregar', bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=agregar)
                add.pack(side=RIGHT)
                
                #========================= ASIDE ===========================
                
                self.aside = Frame(self)
                self.aside.pack(side=TOP, fill=BOTH)
                
                self.wrap1 = Frame(self.aside)
                self.wrap1.pack()
                
                self.viewer = Label(self.wrap1, text="LISTA DE ARRENDATARIOS")
                self.viewer.pack()

                scroll = Scrollbar(self.wrap1, orient=VERTICAL)
                scroll.pack(side=RIGHT, fill=Y)
                
                lb = Listbox(self.wrap1, yscrollcommand=scroll.set, height=20, width=30, bg='#d8ecf3')
                scroll.config (command=lb.yview)
                lb.pack(fill=BOTH)
                lb.bind("<Double-Button-1>", callback)
                
                self.wrap2 = Frame(self.aside)
                self.wrap2.pack()
                
                load = Button(self.wrap2, text='Cargar lista', width=20, bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=cargar_lista)
                load.pack(fill=X)
                
                delete = Button(self.wrap2, text='Borrar', width=20, bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=borrar)
                delete.pack(fill=X)
                
                edit = Button(self.wrap2, text='Modificar', width=20, bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=modificar)
                edit.pack(fill=X)
                
                self.wrap3 = Frame(self.aside)
                self.wrap3.pack()
                
                buscador = Label(self.wrap3, text="Buscar por:")
                buscador.pack(side=LEFT)
                
                R1 = Radiobutton(self.wrap3, text="CC", variable=info, value=1)
                R1.pack(side=LEFT)
                R2 = Radiobutton (self.wrap3, text="Apellido", variable=info, value=2)
                R2.pack(side=LEFT)
                info.set(1)
                
                self.wrap4 = Frame(self.aside)
                self.wrap4.pack()
                
                E = Entry(self.wrap4, textvariable=busqueda, width=24)
                E.pack()
                E.bind("<KeyRelease>", caps)
                
                """
예제 #15
0
class easy_Access_GUI (Frame) :
    
    def __init__(self):
        self.config_file = "easy_Access_Config.bin"
        
        self.hostlist = []
        self.connections = {}
        self.statusLED_dict = {}
        self.activeServers = {"CMTS" : "CMTS1" , "SNMP" : "SNMP1"}
        
        self.readFromConfiguration(self.config_file)
        self.connect_servers( self.hostlist, "CMTS1")
        self.connect_servers( self.hostlist, "CMTS2")
        self.connect_servers( self.hostlist, "SNMP1")
        
        self.printDict(self.connections)
        
        self.frame = Tk()
        self.content = Frame( self.frame)
        self.tabbedFrame = Frame ( self.content ) 
        self.tabbed = Notebook( self.tabbedFrame, width = 500, height = 500)
          
        self.statusFrame = Frame ( self.content) 
        
        self.cmtsTab = Frame ( self.tabbed )
        self.snmpTab = Frame ( self.tabbed )
        
      
        self.tabbed.add ( self.cmtsTab, text = "CMTS")
        self.tabbed.add ( self.snmpTab, text = "SNMP")
        
        
        #####CMTS TAB items 
        self.CMTSMacaddrFrame = LabelFrame ( self.cmtsTab, text = " Enter the MAC addr of the GW")
        self.CMTSConfigureFrame    = LabelFrame ( self.cmtsTab, text = "Configure CMTS")
        self.CMTSSubmitFrame       = Frame ( self.cmtsTab)
        self.CMTSScrolledTextFrame = LabelFrame ( self.cmtsTab, text = "Output from CMTS")
        
        ####$ Status Frame Items
        self.connCMTS1_Stat = Canvas ( self.statusFrame, height = 20, width = 20) 
        self.connCMTS1_Label = Label ( self.statusFrame, text = " CMTS1 ")
        self.statusLED_dict["CMTS1"] = self.connCMTS1_Stat 
        self.connCMTS2_Stat = Canvas ( self.statusFrame, height = 20, width = 20) 
        self.connCMTS2_Label = Label ( self.statusFrame, text = " CMTS2 ")
        self.statusLED_dict["CMTS2"] = self.connCMTS2_Stat
        self.connSNMP_Stat = Canvas ( self.statusFrame, height = 20, width = 20)
        self.connSNMP_Label = Label ( self.statusFrame, text = " SNMP ")
        self.statusLED_dict["SNMP1"] = self.connSNMP_Stat
        
        ####CMTS Tab Items
  
        
        valMacEntry = (self.frame.register(self.onValidate),'%d', '%i', '%P', '%s', '%S', '%v', '%V', '%W')
        self.macAddr_entry = Entry ( self.CMTSMacaddrFrame , validate = 'focus' , validatecommand = valMacEntry)
        self.cmtsTabSubmit = Button ( self.CMTSSubmitFrame, text = "Submit", command = lambda:self.cmtsTabButtonSubmit())
        self.resultFromCMTS_text = ScrolledText ( self.CMTSScrolledTextFrame, width = 65)
        
        self.CMTSSelectVal =  StringVar()
        self.CMTSSelectVal.set("CMTS1")
        self.CMTS1Radio    =  Radiobutton(self.CMTSConfigureFrame, text = "CMTS1", variable = self.CMTSSelectVal, value = "CMTS1", command = lambda : self.setActiveServer("CMTS", self.CMTSSelectVal.get()))
        self.CMTS2Radio    =  Radiobutton(self.CMTSConfigureFrame, text = "CMTS2", variable = self.CMTSSelectVal, value = "CMTS2", command = lambda : self.setActiveServer("CMTS", self.CMTSSelectVal.get()))
        self.CMTSConfigureButton = Button ( self.CMTSConfigureFrame, text = "Configure")

        for led in self.statusLED_dict:
          self.status = self.statusLED_dict[led].create_oval(10,10,20,20, fill = "red" )
        
        #self.status = self.connCMTS1_Stat.create_oval(10,10,20,20, fill = "red" )
        #self.status = self.connCMTS2_Stat.create_oval(10,10,20,20, fill = "red" )
        #self.status = self.connSNMP_Stat.create_oval(10,10,20,20, fill = "red" )
        
        #####SNMP TAB items
        self.SNMPInterfaceFrame = LabelFrame ( self.snmpTab, text = "Interface", padx = 10, pady = 10)
        self.SNMPFuntionFrame   = LabelFrame ( self.snmpTab, text = "SNMP Function", padx = 10, pady = 10)
        self.SNMPCommunityStringFrame = LabelFrame ( self.snmpTab, text = "Community String", padx = 10, pady = 10)
        self.SNMPScrolledTextFrame = LabelFrame ( self.snmpTab , text = "SNMP Output", padx = 10, pady = 10)
        
        #####SNMPInterfaceFrame
        self.SNMPIFCMVal = StringVar()
        self.SNMPIFCMVal.set("MTA")
        self.SNMPIFCM_Radiobutton = Radiobutton(self.SNMPInterfaceFrame, text = "CM", variable = self.SNMPIFCMVal, value = "CM")
        self.SNMPIFMTA_Radiobutton = Radiobutton(self.SNMPInterfaceFrame, text = "MTA", variable = self.SNMPIFCMVal, value = "MTA")
        self.SNMPIFCM_entry = Entry ( self.SNMPInterfaceFrame)
        self.SNMPIFMTA_entry= Entry ( self.SNMPInterfaceFrame)
        
        #####SNMPFuntionFrame
        self.snmpFuncVal = StringVar()
        self.snmpFuncVal.set("snmpwalk")
        self.SNMPgetradio = Radiobutton ( self.SNMPFuntionFrame, text = 'SNMPSET', variable = self.snmpFuncVal, value = "snmpset")
        self.SNMPwalkradio = Radiobutton ( self.SNMPFuntionFrame, text = "SNMPWALK", variable = self.snmpFuncVal, value = "snmpwalk")
        
        #####SNMPCommunityStringFrame
        self.SNMPCSentryState = ['disabled','disabled', 'normal']
        self.snmpCSVal = IntVar()

        self.snmpCSVal.set(1)
        self.SNMPCSCustomEntry = Entry ( self.SNMPCommunityStringFrame, state = self.SNMPCSentryState[self.snmpCSVal.get()])
        self.SNMPCSPublic = Radiobutton ( self.SNMPCommunityStringFrame, text = 'PUBLIC', variable = self.snmpCSVal, value = 0, command = lambda:self.changedSNMPCS())
        self.SNMPCSPrivate = Radiobutton ( self.SNMPCommunityStringFrame, text = "PRIVATE", variable = self.snmpCSVal, value = 1, command = lambda:self.changedSNMPCS())
        self.SNMPCSCustom = Radiobutton ( self.SNMPCommunityStringFrame, text = "CUSTOM", variable = self.snmpCSVal, value = 2, command = lambda:self.changedSNMPCS())
        self.SNMPCSCustomEntry = Entry ( self.SNMPCommunityStringFrame, state = self.SNMPCSentryState[self.snmpCSVal.get()])
        #self.snmpCSVal.trace("w", self.changedSNMPCS())
        print  self.SNMPCSentryState[self.snmpCSVal.get()]
        
        ####SNMPScrolledText
        self.resultFromSNMP_text = ScrolledText ( self.SNMPScrolledTextFrame)
                
        
        self.content.pack() 
        self.tabbedFrame.pack()
        self.tabbed.pack()
        self.statusFrame.pack()
        
        self.CMTSMacaddrFrame.pack(fill = 'x', ipady = 5)
        self.CMTSConfigureFrame.pack( fill = 'x', ipady = 5)
        self.CMTSSubmitFrame.pack(fill = 'x')
        self.CMTSScrolledTextFrame.pack(fill = 'x')
        self.SNMPInterfaceFrame.pack(fill = 'x')
        self.SNMPFuntionFrame.pack(fill = 'x')
        self.SNMPCommunityStringFrame.pack( fill = 'x')
        self.SNMPScrolledTextFrame.pack( fill = 'x')
        
        self.connCMTS1_Stat.pack(side = LEFT )
        self.connCMTS1_Label.pack(side = LEFT)
        self.connCMTS2_Stat.pack(side = LEFT )
        self.connCMTS2_Label.pack(side = LEFT)
        self.connSNMP_Stat.pack(side = LEFT)
        self.connSNMP_Label.pack(side = LEFT)
        
        self.macAddr_entry.pack()
        self.cmtsTabSubmit.pack(ipadx = 30)
        self.resultFromCMTS_text.pack(fill = 'x', anchor = S )
        self.CMTS1Radio.pack(side = LEFT, padx = 30)
        self.CMTS2Radio.pack(side = LEFT, padx = 30)
        self.CMTSConfigureButton.pack(side=LEFT, padx = 30)
        
         
        self.SNMPIFCM_Radiobutton.pack( side = LEFT)
        self.SNMPIFCM_entry.pack( side = LEFT)
        self.SNMPIFMTA_Radiobutton.pack(side = LEFT)
        self.SNMPIFMTA_entry.pack(side = LEFT)
        
        self.SNMPgetradio.pack(side = LEFT , padx = 60)
        self.SNMPwalkradio.pack(side = LEFT , padx = 60)
        
        self.SNMPCSPrivate.pack(side = LEFT, padx = 10)
        self.SNMPCSPublic.pack(side = LEFT, padx = 20)
        self.SNMPCSCustom.pack(side = LEFT, padx= 20)
        self.SNMPCSCustomEntry.pack(side = LEFT)
        
        self.resultFromSNMP_text.pack ( side = LEFT)
        self.change_StatusLED()

        self.frame.update()
#        self.frame.mainloop()
        
        
    def change_StatusLED (self):
      for host, hostConnection in self.connections.items():
        if hostConnection != "FAILED":
          self.statusLED_dict[host].itemconfig( self.status, fill = "green")
        else:
          self.statusLED_dict[host].itemconfig( self.status, fill = "red")  
        
    #def cmtsTabButtonSubmit (self):  
        
    def readFromConfiguration (self, configFile):
        fileConfig = open( configFile, 'rw+')
        for line in fileConfig:
           hoststr = line.split("###")
           for singleHost in hoststr: 
             hostline = singleHost.split(",")
             print hostline
             self.hostlist.append(hostline)
        fileConfig.close()    
        
    def connect_servers(self, hostlist, hosttoConnect):
        for host in hostlist:
           if host[0] == hosttoConnect:
            client = paramiko.SSHClient()
            client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
            try:
                client.connect(host[1], username=host[2], password=host[3])
            except :
                client = str ( "FAILED") 
                print sys.exc_info()[0]  
            self.connections[hosttoConnect] = client
            
    def printList (self , MyList):
        for i in MyList:
            print i 
            
    def printDict (self , dicttoPrint):      
        for connectName, connectStr in dicttoPrint.items():
           print connectName + "-->" + str(connectStr)
           
    def changedSNMPCS(self):
        self.SNMPCSCustomEntry.configure(state = self.SNMPCSentryState[self.snmpCSVal.get()])
        
    def setActiveServer(self, server, serverName):    
        self.activeServers[server] = serverName
        
   # def submitToCMTS(self):   Update from Apr19
    def onValidate ( self, d, i, P, s, S, v, V, W): 
        print self.resultFromCMTS_text.insert("end", "d=%s\n" % d) 
        print self.resultFromCMTS_text.insert("end", "i=%s\n" % i) 
        print self.resultFromCMTS_text.insert("end", "d=%s\n" % P) 
        print self.resultFromCMTS_text.insert("end", "d=%s\n" % s) 
        print self.resultFromCMTS_text.insert("end", "d=%s\n" % S)   
        print self.resultFromCMTS_text.insert("end", "d=%s\n" % v)  
        print self.resultFromCMTS_text.insert("end", "d=%s\n" % V)  
        print self.resultFromCMTS_text.insert("end", "d=%s\n" % W)  
예제 #16
0
class Contratos(Frame):
        def __init__(self, parent, controller):
                        Frame.__init__(self, parent)
                        
                        #VARIABLES GLOBALES
                        global cod, cc, inquilino, codinm, inmueble, nit, owner, rel, vlrenta, duracion 
                        global contratos, tcontrato, incremento, gfacturaIni, facturaSgte, fecha, hoy 
                        global notas, anexos, destinacion, servicios, conexos, tercero, nombret, fecha
                        global aplicado, cc_aplicado, n_aplicado, inm_aplicado, novedad, n_nombre, n_valor
                        global h, busqueda, clean, update, add
                        
                        #INSTANCIEAS DE LOS WIDGETS
                        global e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, Cbx1, chkb1, chkb2, lb, cedulaE, notas
                        
                        fecha = datetime.date.today()
                        hoy = "%s" %fecha #ESTE NUESTRA LA FECHA EN FORMATO AÑO-MES-DIA (YYYY/MM/DD)
                        #hoy = time.strftime("%d/%m/%y") #ESTO PARA VER FORMATO FECHA EN DIA/MES/AÑO
                        #hoy = time.strftime("%y/%m/%d")
                        h = hoy
                        
                        #VARIABLES
                        lupa = PhotoImage(file='img/lupa.png')
                        schedule = PhotoImage(file='img/calendar.gif')
                        
                        cod = IntVar()
                        cc = StringVar()
                        inquilino = StringVar()
                        codinm = IntVar()
                        inmueble = StringVar()
                        nit = StringVar()
                        owner = StringVar()
                        rel = IntVar()
                        
                        vlrenta = DoubleVar()
                        duracion = IntVar()
                        contratos = ['Vivienda', 'Comercial', 'Mixta']
                        tcontrato = StringVar()
                        incremento = DoubleVar()
                        gfacturaIni = IntVar()
                        facturaSgte = IntVar()
                        fecha = StringVar()
                        
                        notas = StringVar()
                        anexos = StringVar()
                        destinacion = StringVar()
                        servicios = StringVar()
                        conexos = StringVar()
                        
                        tercero = StringVar()
                        nombret = StringVar()
                        
                        aplicado = IntVar()
                        cc_aplicado = StringVar()
                        n_aplicado = StringVar()
                        inm_aplicado = StringVar()
                        novedad = StringVar()
                        n_nombre = StringVar()
                        n_valor = DoubleVar()
                        
                        #BUSQUEDA = ["Nombre","CC/Nit"]
                        busqueda = StringVar()
                        busqueda.trace("w", lambda name, index, mode: buscar())
                        dato = StringVar()
                        
                        #WIDGETS
                        
                        #========================= HEADER ===========================
                        
                        self.header = Label(self, text="CONTRATOS", font="bold")
                        self.header.pack(pady=20, side=TOP)
                        
                        #========================== WRAPPER ==========================
                        
                        self.wrapper = Frame (self)
                        self.wrapper.pack(side=LEFT, fill=Y)
                        
                        #================ NOTEBOOK =============>
                        
                        self.nb = Notebook(self.wrapper)
                        
                        #-----------------------> TAB 1
                        
                        self.tab1 = Frame (self.nb)
                        
                        self.f0 = Frame(self.tab1)#-------------------------------------
                        self.f0.pack(pady=5,fill=X)
                        
                        l1 = Label(self.f0, text='Código:')
                        l1.pack(side=LEFT)
                        
                        e1 = Entry(self.f0, textvariable=cod, width=10)
                        e1.pack(side=LEFT)
                        
                        self.f1 = Frame(self.tab1)#-------------------------------------
                        self.f1.pack(pady=5,fill=X)
                        
                        l2 = Label(self.f1, text='Arrendatario:')
                        l2.pack(side=LEFT, fill=X)
                        
                        e2 = Entry(self.f1, textvariable=cc, width=15)
                        e2.pack(side=LEFT)
                        e2.bind('<Return>', buscarA)
                        
                        b1 = Button(self.f1, image=lupa, command=topArrendatario)
                        b1.image = lupa
                        b1.pack(side=LEFT)
                        
                        e3 = Entry(self.f1, textvariable=inquilino, state=DISABLED)
                        e3.pack(side=LEFT, fill=X, expand=1)
                        
                        self.f2 = Frame(self.tab1)
                        self.f2.pack(pady=5,fill=X)#------------------------------------
                        
                        l3 = Label(self.f2, text='Inmueble:')
                        l3.pack(side=LEFT)
                        
                        e4 = Entry(self.f2, textvariable=codinm, width=10)
                        e4.pack(side=LEFT)
                        e4.bind('<Return>', buscarR)
                        
                        b2 = Button(self.f2, image=lupa, command=topRelacion)
                        b2.pack(side=LEFT)
                        
                        e5 = Entry(self.f2, textvariable=inmueble, state=DISABLED)
                        e5.pack(side=LEFT, fill=X, expand=1)
                        
                        self.f3 = Frame(self.tab1)
                        self.f3.pack(pady=5,fill=X)#------------------------------------
                        
                        l4 = Label(self.f3, text='Propietario:')
                        l4.pack(side=LEFT)
                        
                        e6 = Entry(self.f3, width=15, textvariable=nit, state=DISABLED)
                        e6.pack(side=LEFT)
                        e7 = Entry(self.f3, width=5, textvariable=owner, state=DISABLED)
                        e7.pack(side=LEFT, fill=X, expand=1)
                        
                        self.f4 = Frame(self.tab1)
                        self.f4.pack(pady=5,fill=X)#------------------------------------
                        
                        self.arriendo = Label(self.f4, text='Arriendo $:')
                        self.arriendo.pack(side=LEFT)
                        e8 = Entry(self.f4, textvariable=vlrenta, state=DISABLED, width=20)
                        e8.pack(side=LEFT)
                        
                        self.duracion = Label(self.f4, text='Duración Contrato:')
                        self.duracion.pack(side=LEFT)
                        e9 = Entry(self.f4, textvariable=duracion, width=5)
                        e9.pack(side=LEFT)
                        
                        self.meses = Label(self.f4, text='Meses')
                        self.meses.pack(side=LEFT)
                        
                        self.f5 = Frame(self.tab1)
                        self.f5.pack(pady=5,fill=X)#------------------------------------
                        
                        self.tcontrato = Label(self.f5, text='Tipo Contrato:')
                        self.tcontrato.pack(side=LEFT)
                        
                        Cbx1 = Combobox(self.f5, textvariable=tcontrato, values=contratos, width=10)
                        Cbx1.set('')
                        Cbx1.pack(side=LEFT)
                        
                        self.incremento = Label(self.f5, text='Incremento:')
                        self.incremento.pack(side=LEFT)
                        e10 = Entry(self.f5, textvariable=incremento, width=5)
                        e10.pack(side=LEFT)
                        
                        chkb1 = Checkbutton(self.f5, text="General factura\n inicial", variable=gfacturaIni)
                        chkb1.pack(side=LEFT)
                        chkb2 = Checkbutton(self.f5, text="Facturar príodo\n siguiente", variable=facturaSgte)
                        chkb2.pack(side=LEFT)
                        
                        self.f6 = Frame(self.tab1)
                        self.f6.pack(pady=5,fill=X)#------------------------------------
                        
                        btime = Button(self.f6, image=schedule, command=calendario)
                        btime.image = schedule
                        btime.pack(side=RIGHT)
                        
                        etime = Entry(self.f6, textvariable=fecha, width=10)
                        fecha.set(hoy)
                        etime.pack(side=RIGHT)
                        
                        #ltime = Label(self.f6, text=hoy, font="bold", foreground='red')
                        #ltime.pack(side=RIGHT)
                        
                        self.fi = Label(self.f6, text='Fecha Inicio: ')
                        self.fi.pack(side=RIGHT)
                        
                        self.tab1.pack()
                        
                        #-----------------------> TAB 2
                        
                        self.tab2 = Frame (self.nb)
                        self.tab2.pack()
                        
                        self.f7 = Frame(self.tab2)#-------------------------------------
                        self.f7.pack(fill=X, pady=10)
                        
                        notas = Text(self.f7, height=5)
                        notas.pack(side=LEFT, fill=X, expand=1)
                        
                        self.f8 = Frame(self.tab2)
                        self.f8.pack(pady=5,fill=X)#-------------------------------------------
                        
                        self.destino = Label(self.f8, text='Destinación:')
                        self.destino.pack(side=LEFT)
                        self.destinoE = Entry(self.f8, textvariable=destinacion, width=5)
                        self.destinoE.pack(side=LEFT, fill=X, expand=1)
                        
                        self.f9 = Frame(self.tab2)
                        self.f9.pack(pady=5,fill=X)#-------------------------------------------
                        
                        self.servicios = Label(self.f9, text='Servicios adicionales:')
                        self.servicios.pack(side=LEFT)
                        self.serviciosE = Entry(self.f9, textvariable=servicios, width=5)
                        self.serviciosE.pack(side=LEFT, fill=X, expand=1)
                        
                        self.f10 = Frame(self.tab2)
                        self.f10.pack(pady=5,fill=X)#-------------------------------------------
                        
                        self.conexos = Label(self.f10, text='Conexos:')
                        self.conexos.pack(side=LEFT)
                        self.conexosE = Entry(self.f10, textvariable=conexos, width=5)
                        self.conexosE.pack(side=LEFT, fill=X, expand=1)
                        
                        #-----------------------> TAB 3
                        
                        self.tab3 = Frame (self.nb)
                        self.tab3.pack()
                        
                        self.f11 = Frame(self.tab3)#-------------------------------------
                        self.f11.pack(fill=X, pady=5)
                        
                        self.cedula = Label (self.f11, text='CC/Nit: ')
                        self.cedula.pack(side=LEFT)
                        
                        cedulaE = Entry(self.f11, textvariable=tercero, width=15)
                        cedulaE.pack(side=LEFT)
                        cedulaE.bind('<Return>', buscarT)
                        
                        b4 = Button(self.f11, image=lupa, command=topTercero)
                        b4.image = lupa
                        b4.pack(side=LEFT)
                        
                        self.f12 = Frame(self.tab3) #-------------------------------------
                        self.f12.pack(fill=X, pady=5)
                        
                        self.tercero = Label (self.f12, text='Nombre: ')
                        self.tercero.pack(side=LEFT)
                        
                        self.terceroE = Entry(self.f12, textvariable=nombret, width=5, state=DISABLED)
                        self.terceroE.pack(side=LEFT, fill=X, expand=1)
                        
                        #-----------------------> TAB 4
                        
                        self.tab4 = Frame (self.nb)
                        self.tab4.pack()
                        
                        self.f13 = Frame(self.tab4) #-------------------------------------
                        self.f13.pack(fill=X, pady=5)
                        
                        l = Label (self.f13, text='Aplicar a: ')
                        l.pack(side=LEFT)
                        
                        Ch = Checkbutton(self.f13, text="Propietario", variable=aplicado)
                        Ch.pack(side=LEFT)
                        
                        self.f14 = Frame(self.tab4) #-------------------------------------
                        self.f14.pack(fill=X, pady=5)
                        
                        l13 = Label (self.f14, text='CC/Nit: ')
                        l13.pack(side=LEFT)
                        
                        e13 = Entry(self.f14, textvariable=cc_aplicado, width=15)
                        e13.pack(side=LEFT)
                        
                        b13 = Button(self.f14, image=lupa, command=None)
                        b13.image = lupa
                        b13.pack(side=LEFT)
                        
                        e13 = Entry(self.f14, textvariable=n_aplicado, state=DISABLED)
                        e13.pack(side=LEFT, fill=X, expand=1)
                        
                        self.f15 = Frame(self.tab4)
                        self.f15.pack(fill=X, pady=5)#------------------------------------
                        
                        l14 = Label(self.f15, text='Cod.Inmueble:')
                        l14.pack(side=LEFT)
                        
                        e14 = Entry(self.f15, textvariable=inm_aplicado, width=5, state=DISABLED)
                        e14.pack(side=LEFT, fill=X, expand=1)
                        
                        self.f16 = Frame(self.tab4)
                        self.f16.pack(fill=X, pady=5)#------------------------------------
                        
                        l16 = Label(self.f16, text='Novedad:')
                        l16.pack(side=LEFT, fill=X)
                        
                        e16 = Entry(self.f16, textvariable=novedad, width=15)
                        e16.pack(side=LEFT)
                        
                        b16 = Button(self.f16, image=lupa, command=None)
                        b16.image = lupa
                        b16.pack(side=LEFT)
                        
                        e16 = Entry(self.f16, textvariable=n_nombre, state=DISABLED)
                        e16.pack(side=LEFT, fill=X, expand=1)
                        
                        self.f17 = Frame(self.tab4)
                        self.f17.pack(fill=X, pady=5)#------------------------------------
                        
                        l17 = Label(self.f17, text='Vlr Novedad:')
                        l17.pack(side=LEFT, fill=X)
                        
                        e17 = Entry(self.f17, textvariable=n_valor, width=15)
                        e17.pack(side=LEFT)
                        
                        #---------------------------------------------------------------
                        
                        self.nb.add (self.tab1, text="General")
                        self.nb.add(self.tab2, text="Anexos")
                        self.nb.add(self.tab3, text="Tercero")
                        self.nb.add(self.tab4, text="Gasto fijo")
                        
                        self.nb.pack()
                        
                        self.fBtn = Frame(self.wrapper)
                        self.fBtn.pack()#-------------------------------
                        
                        clean = Button(self.fBtn, text='Limpiar', bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=limpiar)
                        clean.pack(side=RIGHT)
                        
                        update = Button(self.fBtn, text='Actualizar', bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=actualizar, state=DISABLED)
                        update.pack(side=RIGHT)
                        
                        add = Button(self.fBtn, text='Agregar', bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=agregar)
                        add.pack(side=RIGHT)
                        
                        #========================= ASIDE ===========================
                        
                        self.aside = Frame(self)
                        self.aside.pack(side=TOP, fill=BOTH)
                        
                        self.wrap1 = Frame(self.aside)
                        self.wrap1.pack()
                        
                        self.viewer = Label(self.wrap1, text="LISTA DE CONTRATOS")
                        self.viewer.pack()
                        
                        scroll = Scrollbar(self.wrap1, orient=VERTICAL)
                        scroll.pack(side=RIGHT, fill=Y)
                        lb = Listbox(self.wrap1, yscrollcommand=scroll.set, height=20, width=30)
                        scroll.config (command=lb.yview)
                        lb.pack(fill=BOTH)
                        lb.bind("<Double-Button-1>", callback)
                        
                        self.wrap2 = Frame(self.aside)
                        self.wrap2.pack()
                        
                        show = Button(self.wrap2, text='Cargar lista', bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=cargar)
                        show.pack(fill=X)
                        
                        delete = Button(self.wrap2, text='Borrar', bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=borrar)
                        delete.pack(fill=X)
                        
                        edit = Button(self.wrap2, text='Modificar', bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=modificar)
                        edit.pack(fill=X)
                        
                        buscador = Label(self.wrap2, text="Buscar por CC:")
                        buscador.pack()
                        E = Entry(self.wrap2, textvariable=busqueda, width=24)
                        E.pack()
예제 #17
0
class Application(tk.Frame):
    def __init__(self, master):
        tk.Frame.__init__(self, master)
        self.master = master
        self.master.title("Netstat Live")
        self.pack(fill=tk.BOTH, expand=tk.Y)
        
        master.protocol("WM_DELETE_WINDOW", self.app_quit)
        self._app_quit = False
        
        self._freeze = False
        
        self.tabs = Notebook(self)
        
        self.tabs_frames = OrderedDict()
        self.tabs_frames['TCP4'] = {'query': netstat_tcp4}
        self.tabs_frames['UDP4'] = {'query': netstat_udp4}
        self.tabs_frames['TCP6'] = {'query': netstat_tcp6}
        self.tabs_frames['UDP6'] = {'query': netstat_udp6}
        
        for tab in self.tabs_frames:
            # Creating tabs
            self.tabs_frames[tab]['tab'] = tk.Frame(self.tabs)
            self.tabs.add(self.tabs_frames[tab]['tab'], text=tab)
            #self.tabs_frames[tab]['tab'].pack(fill=tk.BOTH)
            # Adding Treeview widget to tabs
            self.tabs_frames[tab]['tbl'] = Treeview(self.tabs_frames[tab]['tab'])
            self.tabs_frames[tab]['tbl']['columns'] = ('Pid', 'User', 'Local addr', 'Remote addr', 'State')
            for column in self.tabs_frames[tab]['tbl']['columns']:
                self.tabs_frames[tab]['tbl'].heading(column, text=column)
                self.tabs_frames[tab]['tbl'].column(column, width=150)
            self.tabs_frames[tab]['scrollbar_y'] = Scrollbar(self.tabs_frames[tab]['tab'], orient=tk.VERTICAL, command=self.tabs_frames[tab]['tbl'].yview)
            self.tabs_frames[tab]['tbl']['yscroll'] = self.tabs_frames[tab]['scrollbar_y'].set
            self.tabs_frames[tab]['scrollbar_y'].pack(side=tk.RIGHT, fill=tk.Y)
            self.tabs_frames[tab]['tbl'].pack(expand=tk.Y, fill=tk.BOTH)
            # Bind right click event for displaying context menu
            self.tabs_frames[tab]['tbl'].bind('<Button-3>', self.context_menu_popup)
            self.tabs_frames[tab]['tbl'].bind('<Button-1>', self.context_menu_unpost)
            # Creating queue for each tab
            self.tabs_frames[tab]['queue'] = Queue(maxsize=1)
        self.tabs.pack(fill=tk.BOTH, expand=tk.Y)
        
        # Freeze button
        self.buttons = tk.Frame(master)
        self.buttons.pack(side=tk.BOTTOM, fill=tk.BOTH)
        self.freeze_btn = tk.Button(self.buttons, text='Freeze', command=self.freeze_btn_handler)
        self.freeze_btn.pack(side=tk.RIGHT)
        
        # Check dependencies
        self._xclip = True
        self._whois = True
        try:
            out = subprocess.check_output(['xclip', '-h'], stderr=subprocess.STDOUT)
        except:
            self._xclip = False
        try:
            out = subprocess.check_output(['whois', '--version'], stderr=subprocess.STDOUT)
        except:
            self._whois = False
        
        # Connections list context menu
        self._remote_addr = ''
        self.context_menu = tk.Menu(self, tearoff=0)
        if self._xclip:
            self.context_menu.add_command(label='Copy remote addr.', command=self.xclip)
        if self._whois:
            self.context_menu.add_command(label='Whois', command=self.whois)
        self.tabs.bind('<Button-1>', self.context_menu_unpost)
        
        self.poll = Thread(target=self.thread)
        self.poll.start()
        
    def context_menu_popup(self, event):
        current_tab = self.get_active_tab()
        tbl = self.tabs_frames[current_tab]['tbl']
        item = tbl.identify_row(event.y)
        if item and len(tbl.get_children(item)) == 0:
            tbl.selection_set(item)
            # Get remote addr value
            self._remote_addr = tbl.set(item, column='Remote addr')
            self.context_menu.post(event.x_root, event.y_root)
        else:
            # Mouse pointer is not over item
            pass
    
    def context_menu_unpost(self, event):
        self.context_menu.unpost()

    def get_active_tab(self):
        try:
            current_tab = self.tabs.tab(self.tabs.select(), 'text')
            return current_tab
        except RuntimeError:
            # Sometimes raised on KeyboardInterrupt
            sys.stderr.write('Terminated.\n')
            self._app_quit = True
            sys.exit(0)
    
    def thread(self):
        while not self._app_quit:
            current_tab = self.tabs_frames[self.get_active_tab()]
            if current_tab['queue'].empty():
                # Get netstat data
                try:
                    netstat = current_tab['query']()
                except RuntimeError:
                    sys.stderr.write('Main thread destroyed.\n')
                # Put to queue
                current_tab['queue'].put(netstat, True)
            else:
                sleep(0.5)
    
    def app_quit(self):
        self._app_quit = True
        self.master.destroy()
    
    def refresh(self):
        current_tab = self.get_active_tab()
        queue = self.tabs_frames[current_tab]['queue']
        if not self._freeze and not queue.empty():
            
            # Get active tab
            tbl = self.tabs_frames[current_tab]['tbl']
            
            # Remember focus
            self.tabs_frames[current_tab]['focus'] = tbl.selection()
            
            data = queue.get(False)
            processes = []
            for proc in data:
                processes.append(proc[6])
            processes = tuple(set(processes)) # Unique list of processes in netstat
            
            # Clear tree:
            for proc in tbl.get_children():
                tbl.delete(*tbl.get_children(proc))
        
            for proc in processes:
                proc_name = '%s (%s)' % (os.path.basename(str(proc)), str(proc))
                if not tbl.exists(proc_name):
                    # Create root items for each process name
                    tbl.insert('', 'end', proc_name, text=proc_name)
        
            for proc in data:
                proc_name = '%s (%s)' % (os.path.basename(str(proc[6])), str(proc[6]))
                #         Pid           User          Local addr    Remote addr   State
                values = (str(proc[5]), str(proc[1]), str(proc[2]), str(proc[3]), str(proc[4]))
                h = hash(tuple(proc))
                try:
                    tbl.insert(proc_name, 'end', h, text=proc_name, values=values)
                except:
                    pass
    
            # Removing empty root items
            for proc in tbl.get_children():
                if len(tbl.get_children(proc)) == 0:
                    tbl.delete(proc)
            
            # Restore focus
            try:
                tbl.selection_set(self.tabs_frames[current_tab]['focus'])
            except:
                pass
            
        self.master.after(500, self.refresh)
        
    def freeze_btn_handler(self):
        # Toggle freeze state
        if self._freeze:
            self.freeze_btn['text'] = 'Freeze'
        else:
            self.freeze_btn['text'] = 'Continue'
        self._freeze = not self._freeze

    def xclip(self, data=None):
        if not data:
            data = self._remote_addr
        try:
            xclip = subprocess.Popen(['xclip', '-selection', 'clipboard'], stdin=subprocess.PIPE)
            xclip.communicate(input=data)
            xclip.terminate()
        except:
            pass
    
    def whois(self, addr=None):
        if not addr:
            addr = self._remote_addr
        addr = addr.split(':')
        try:
            reverse = subprocess.check_output(['dig', '+short', '-x', addr[0]])
        except:
            reverse = None
        
        try:
            out = subprocess.check_output(['whois', addr[0]])
        except:
            out = 'No info for this host.'
        
        self.whois_popup = {}
        self.whois_popup['window'] = tk.Toplevel(self)
        self.whois_popup['window'].title('Whois %s' % addr[0])
        self.whois_popup['frame'] = tk.Frame(self.whois_popup['window'])
        self.whois_popup['frame'].pack(fill=tk.BOTH, expand=tk.Y)
        self.whois_popup['text'] = tk.Text(self.whois_popup['frame'], wrap=tk.WORD, height=32, width=96)
        self.whois_popup['text'].pack(fill=tk.BOTH, expand=tk.Y, side=tk.LEFT)
        self.whois_popup['scrollbar_y'] = Scrollbar(self.whois_popup['frame'])
        self.whois_popup['scrollbar_y'].config(command=self.whois_popup['text'].yview)
        self.whois_popup['scrollbar_y'].pack(side=tk.RIGHT, fill=tk.Y)
        self.whois_popup['text'].config(yscrollcommand=self.whois_popup['scrollbar_y'].set)
        if reverse:
            reverse = 'Reverse lookup: %s\n' % reverse
            self.whois_popup['text'].insert(tk.END, reverse)
        self.whois_popup['text'].insert(tk.END, out)
            
        tk.Button(self.whois_popup['window'], text='Ok', command=self.whois_popup['window'].destroy).pack()
예제 #18
0
    def __init__(self, master):
        
	self.fname=""
        #global variables
        self.t1=StringVar()
        self.t2=StringVar()
        self.t3=StringVar()
        self.t4=StringVar()
        self.t5=StringVar()
        self.t6=StringVar()
        self.t7=StringVar()
        self.t8=StringVar()
        
        self.var1=StringVar()
        self.var2=StringVar()
        self.var3=StringVar()
        self.var4=StringVar()
        self.var5=StringVar()
        self.var6=StringVar()
        self.var7=StringVar()
        self.var8=StringVar()
       
        #end
        
        mymaster = Frame(master, name='mymaster') # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window    
        #master.minsize(width=900, height=900)
        #master.maxsize(width=650, height=500)
        #end
        
        #title of window
        master.title("Airdecloak-ng")
        #end
        
        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont=tkFont.Font(family="Helvetica", size=15,underline = True)
        self.myfontnew=tkFont.Font(family="Helvetica", size=11,underline = True)
        #end
        
        
       
        nb = Notebook(mymaster, name='nb') # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3) # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Page1") # add tab to Notebook
    
        # repeat for each tab
        self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")
        
        #End
        
	#frame content 7
	Label(self.frame_content7, text = 'Airdecloak-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        btndetect=Button(self.frame_content7, text = 'Detect', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 1, column = 0, padx = 5, pady = 5)
		
	btndbrowse=Button(self.frame_content7, text = 'Attach File', command =self.browse_file, height=2, width=15, font=self.customFont).grid(row = 3, column = 0, padx = 5, pady = 5)	
	self.lilnew1=Listbox(self.frame_content7,bg="black", fg="white", font=self.myfont, selectmode=SINGLE, width=30, height=15)
        self.lilnew1.grid(row = 1, column = 1, rowspan=3)
	#End

        Label(self.frame_content, text = 'Airdecloak-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content, text = 'Options :',font=self.myfontnew, bg="white").grid(row = 1, column = 1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5, text = 'Edit Command From Here',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 0, column = 0)
        TextCommandBox=Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output=Text(self.frame_content5,bg="black", fg="white", font=self.myfont, height=20, width=42)
        self.output.grid(row = 0, column = 1, padx=50, pady=5, rowspan=3)
        btnsubmit=Button(self.frame_content5, width=15, height=2, text="Get Result", command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear=Button(self.frame_content5, width=15, height=2, text="Clear Output", command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-i", \
                 onvalue = "-i", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var1)
        self.C1.grid(row = 2, column = 0, padx = 5, pady = 5)
        self.t1=Text(self.frame_content,height=1,width = 20)
        self.t1.grid(row = 2, column = 1, padx = 5, pady = 5)
        l1=Label(self.frame_content, text = ': Input capture file',font=self.myfont, bg="white", justify=LEFT).grid(row = 2, column = 2, padx = 5, pady = 5)
        
        self.C2 = Checkbutton(self.frame_content, text = "--ssid", \
                 onvalue = "--ssid", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var2)
        self.C2.grid(row = 3, column = 0, padx = 5, pady = 5)
        self.t2=Text(self.frame_content,height=1,width = 20)
        self.t2.grid(row = 3, column = 1, padx = 5, pady = 5)
        l2=Label(self.frame_content, text = ': ESSID of the network to filter',font=self.myfont, bg="white", justify=LEFT).grid(row = 3, column = 2, padx = 5, pady = 5)
        
        self.C3 = Checkbutton(self.frame_content, text = "--bssid", \
                 onvalue = "--bssid", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row = 4, column = 0, padx = 5, pady = 5)
        self.t3=Text(self.frame_content,height=1,width = 20)
        self.t3.grid(row = 4, column = 1, padx = 5, pady = 5)
        l3=Label(self.frame_content, text = ': BSSID of the network to filter',font=self.myfont, bg="white", justify=LEFT).grid(row = 4, column = 2, padx = 5, pady = 5)
        
        self.C4 = Checkbutton(self.frame_content, text = "--filters", \
                 onvalue = "--filters", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var4)
        self.C4.grid(row = 5, column = 0, padx = 5, pady = 5)
        self.t4=Text(self.frame_content,height=1,width = 20)
        self.t4.grid(row = 5, column = 1, padx = 5, pady = 5)
        l4=Label(self.frame_content, text = ': Apply filters (separated by a comma)',font=self.myfont, bg="white", justify=LEFT).grid(row = 5, column = 2, padx = 5, pady = 5)
        
        self.C5 = Checkbutton(self.frame_content, text = "--null-packets", \
                 onvalue = "--null-packets", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var5)
        self.C5.grid(row = 6, column = 0, padx = 5, pady = 5)
        self.t5=Text(self.frame_content,height=1,width = 20)
        self.t5.grid(row = 6, column = 1, padx = 5, pady = 5)
        l5=Label(self.frame_content, text = ': Assume that null packets can be cloaked.',font=self.myfont, bg="white", justify=LEFT).grid(row = 6, column = 2, padx = 5, pady = 5)
        
        self.C6 = Checkbutton(self.frame_content, text = "--disable-base_filter", \
                 onvalue = "--disable-base_filter", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var6)
        self.C6.grid(row = 8, column = 0, padx = 5, pady = 5)
        self.t6=Text(self.frame_content,height=1,width = 20)
        self.t6.grid(row = 8, column = 1, padx = 5, pady = 5)
        l6=Label(self.frame_content, text = ': Do not apply base filter.',font=self.myfont, bg="white", justify=LEFT).grid(row = 8, column = 2, padx = 5, pady = 5)
        
        self.C7 = Checkbutton(self.frame_content, text = "--drop-frag", \
                 onvalue = "--drop-frag", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var7)
        self.C7.grid(row = 9, column = 0, padx = 5, pady = 5)
        self.t7=Text(self.frame_content,height=1,width = 20)
        self.t7.grid(row = 9, column = 1, padx = 5, pady = 5)
        l7=Label(self.frame_content, text = ': Drop fragmented packets',font=self.myfont, bg="white", justify=LEFT).grid(row = 9, column = 2, padx = 5, pady = 5)
        
        self.C8 = Checkbutton(self.frame_content, text = "--help", \
                onvalue = "--help", offvalue = "", height=1, \
                width = 7, bg="white", font=self.customFont,variable=self.var8)
        self.C8.grid(row = 10, column = 0, padx = 5, pady = 5)
        self.t8=Text(self.frame_content,height=1,width = 20)
        self.t8.grid(row = 10, column = 1, padx = 5, pady = 5)
        l8=Label(self.frame_content, text = ': Displays this usage screen',font=self.myfont, bg="white", justify=LEFT).grid(row = 10, column = 2, padx = 5, pady = 5)
예제 #19
0
class Interface():
    def __init__(self):
        print("PASTA ATUAL MAIN: " + os.getcwd())
        self.errorReport = ErrorReport("logs_errors/error_db.log")
        self.db = DatabaseGui()
        if self.db.checkStatus():
            self.defineFontsVars()
            self.configWindow("1.0.0")
            self.defineVars()
            self.configWidgetsMenuOptions()
            self.configWidgetsCreateForm()
            self.configWidgetsGetApps()

            self.setWidgets()

            ############################ FUNCAO TEMPORARIA APENAS PARA DESENVOLVIMENTO
            self.nextTabFrameFieldForm()
        else:
            self.errorReport.showAndSaveError(
                self.db.getErrorDb(), "Erro ao inicializar banco de dados")

    def defineVars(self):
        self.frameOld = None
        self.optionVar = IntVar()
        self.nameFormVar = StringVar()
        self.pathImageFormVar = StringVar()
        self.titleFormVar = StringVar()

        self.validateDateReg = self.window.register(validateDate)
        self.validatePhoneReg = self.window.register(validatePhone)

        self.nameFormVar.trace("w", self.checkInfoAppCompleted)
        self.pathImageFormVar.trace("w", self.checkInfoAppCompleted)

        self.menuOptionsFunctions = [
            self.activeOptionCreateForm, self.activeOptionGetApps
        ]
        self.listElementThisForm = {}
        self.idTemporaryElement = 0
        self.menuRightStateVar = False

    def defineFontsVars(self):
        self.font = ("Arial", 13)
        self.fontMin = ("Arial", 10)
        self.fontMax = ("Arial", 15)

    def setWidgets(self):
        self.optionVar.set(0)
        self.pathImageFormVar.set("link da imagem")
        self.rb1.invoke(
        )  #Aciona o RadioButton CreateForm para renderizar os elementos na frameCreateForm

    def configWindow(self, version):
        self.window = Tk()
        self.window.title("Forms App {}".format(version))
        self.window.geometry("900x500+150+100")
        self.window.iconbitmap("images/imagesFormsApp/imageApp.ico")

        title = "Crie seu App, formulários, realize estatísticas, \nedite e estude seus dados com o Forms App"
        image = renderPhoto("images/imagesFormsApp/imageApp.png", (60, 60))
        Label(self.window, font=("Arial Rounded MT Bold", 15), background="thistle", foreground="chocolate", \
         text=title, padx=10, pady=10, image=image, compound=RIGHT)\
        .pack(side=TOP, fill="x", ipady=5)
        self.frameBody = Frame(self.window, background="paleturquoise")
        self.frameBody.pack(side=TOP, expand=True, fill=BOTH)

        self.menuRight = Frame(self.frameBody,
                               background="paleturquoise",
                               width=150)
        self.menuRight.pack(side=RIGHT, fill=Y)

    def configWidgetsMenuOptions(self):
        frameOptions = Frame(self.frameBody, background="paleturquoise")
        frameOptions.pack(side=LEFT, fill=Y, padx=5, pady=5)

        self.rb1 = Radiobutton(frameOptions,
                               font=self.font,
                               text="Novo App",
                               variable=self.optionVar,
                               value=0,
                               indicatoron=0,
                               width=15,
                               height=2,
                               command=self.actionOptions)
        self.rb1.grid(row=1, column=0)
        self.rb2 = Radiobutton(frameOptions,
                               font=self.font,
                               text="Todos",
                               variable=self.optionVar,
                               value=1,
                               indicatoron=0,
                               width=15,
                               height=2,
                               command=self.actionOptions)
        self.rb2.grid(row=2, column=0)

    def configWidgetsCreateForm(self):
        self.frameCreateForm = Frame(self.frameBody)

        self.framesNotebook = Notebook(self.frameCreateForm)
        self.framesNotebook.pack(expand=True, fill=BOTH)

        self.tabFrameInfoForm = Frame(self.framesNotebook)
        self.tabFrameFieldForm = Frame(self.framesNotebook)

        self.framesNotebook.add(self.tabFrameInfoForm,
                                compound=LEFT,
                                image=renderPhoto(
                                    "images\\imagesFormsApp\\app.png",
                                    (40, 40)),
                                sticky=W + E + N + S,
                                text="Info App",
                                padding='0.1i')
        self.framesNotebook.add(self.tabFrameFieldForm,
                                compound=LEFT,
                                image=renderPhoto(
                                    "images\\imagesFormsApp\\document.png",
                                    (40, 40)),
                                sticky=W + E + N + S,
                                text="Item",
                                padding='0.1i')
        self.framesNotebook.hide(self.tabFrameFieldForm)

        # -------------- tabFrameInfoForm -------------

        title = "Crie seu App aqui"
        Label(self.tabFrameInfoForm, text=title, font=self.font)\
        .grid(row=0, column=0, columnspan=5)

        Label(self.tabFrameInfoForm, text="Nome",
              font=self.fontMin).grid(row=1, column=0)
        inputName = Entry(self.tabFrameInfoForm,
                          font=self.fontMin,
                          textvariable=self.nameFormVar)
        inputName.grid(row=1, column=1, pady=10, sticky=W + E + N + S)
        #inputName.bind("<KeyPress>", self.checkInfoAppCompleted)

        Label(self.tabFrameInfoForm, text="Descrição",
              font=self.fontMin).grid(row=2, column=0)
        self.textWidget = Text(self.tabFrameInfoForm,
                               pady=10,
                               font=self.fontMin,
                               width=50,
                               height=3)
        self.textWidget.grid(row=2, column=1, sticky=W + E + N + S)
        self.descriptionFormVar = self.createVarByTextWidget(self.textWidget)

        self.imageWidget = Label(self.tabFrameInfoForm,
                                 padx=10,
                                 pady=10,
                                 background="lightcyan",
                                 anchor=N)
        self.imageWidget.grid(row=1,
                              column=2,
                              rowspan=2,
                              sticky=W + E + N + S,
                              padx=10,
                              pady=10)

        Label(self.tabFrameInfoForm, padx=10, pady=10, background="lightcyan", font=self.fontMin, textvariable=self.pathImageFormVar)\
        .grid(row=3, column=1, sticky=W+E+N+S)
        Button(self.tabFrameInfoForm, font=self.fontMin, text="Procurar Imagem", command=self.actionChoiseImageForm)\
        .grid(row=3, column=2, padx=10, pady=10)

        self.buttonNext = Button(self.tabFrameInfoForm,
                                 state="disabled",
                                 font=self.fontMin,
                                 text="Prosseguir",
                                 command=self.actionNextTabFrameFieldForm)
        self.buttonNext.grid(row=4, column=1, padx=20, pady=15)

        # -------------- tabFrameFieldForm -------------

        Label(self.tabFrameFieldForm, textvariable=self.titleFormVar, font=self.font)\
        .pack(side=TOP)

        frameBodyForm = Frame(self.tabFrameFieldForm, background="lightcyan")
        frameBodyForm.pack(side=TOP, fill=BOTH, expand=True, padx=5)

        frameMenuElementsForm = Frame(
            frameBodyForm)  #Frame que contera todos os elementos existentes
        frameMenuElementsForm.pack(side=LEFT, fill=Y, ipadx=5)
        self.frameRenderElementsForm = Frame(
            frameBodyForm
        )  #Frame que contera todos os elementos escolhidos pelo usuario
        self.frameRenderElementsForm.pack(side=LEFT, fill=Y, ipadx=5, ipady=5)

        Label(frameMenuElementsForm, text="Elementos",
              font=self.font).pack(side=TOP)
        for element in self.db.getAllElemments(
        ):  #Mostra todos os elementos em forma de botoes para serem adicionados no formulário
            function = lambda id_element=element[0], name_element=element[1], type_element=element[2], multline=element[3], widget_tkinter=element[5]:\
             self.actionAddElement(id_element, name_element, type_element, multline, widget_tkinter)

            Button(frameMenuElementsForm, width=15, height=2, \
             text=element[1], command=function, repeatdelay=700, \
             borderwidth=3, activebackground="lightseagreen", \
             background="darkcyan", cursor="sb_right_arrow").pack(side=TOP)

        #Cria opcoes especificas no meu direito para FieldForm
        self.createMenuSideForFieldForm()

    def checkInfoAppCompleted(
            self, a, b, c
    ):  #checa se todos os campos de informacoes do app foram preenchidas
        if self.nameFormVar.get(
        ) and self.pathImageFormVar.get() <> "link da imagem":
            self.buttonNext.config(state="active")
            self.titleFormVar.set("Crie o formulário para seu App( " +
                                  self.nameFormVar.get() + " ) aqui!")
        else:
            self.activeDeactivateTabFrameFieldForm()
            self.buttonNext.config(state="disabled")
            self.buttonSaveApp.config(state="disabled")

    def checkFormCompleted(self):
        if self.listElementThisForm:
            self.buttonSaveApp.config(state="active")
        else:
            self.buttonSaveApp.config(state="disabled")

    def actionAddElement(
        self, id_element, name_element, type_element, multline, widget_tkinter
    ):  #Adiciona elemento para renderizacao com evento de botao
        infoAppFrame = Frame(self.frameRenderElementsForm,
                             background="powderblue")
        infoAppFrame.pack(side=TOP, fill=X)
        infoAppFrame.idTemporaryElement = self.idTemporaryElement

        def removeElement(
        ):  #Funcao que remove o frame da tela e deleta o item da lista de elementos adicionados do formulario
            del self.listElementThisForm[infoAppFrame.idTemporaryElement]
            infoAppFrame.destroy()
            self.checkFormCompleted()

        Button(infoAppFrame, text="X", command=removeElement, font=("Arial", 6), takefocus=False)\
        .pack(side=RIGHT, ipadx=2, padx=2)

        nameElementVar = StringVar()
        nameElement = Entry(infoAppFrame, width=18, justify=CENTER, relief=FLAT, \
         textvariable=nameElementVar, font=("Agency FB", 14))
        nameElement.pack(side=LEFT, padx=10, fill=X)
        nameElementVar.set(name_element)
        nameElement.focus_force()
        nameElement.select_range(0, END)

        self.viewElement(infoAppFrame, widget_tkinter)

        #Salva na lista o id do elemento,nome da variavel controladora e o tipo de dado que sera inserido no banco
        self.listElementThisForm[self.idTemporaryElement] = (id_element,
                                                             nameElementVar,
                                                             type_element,
                                                             infoAppFrame)
        self.idTemporaryElement += 1
        self.checkFormCompleted()

    def viewElement(self, infoAppFrame, widget_tkinter):
        "Apenas renderiza os elementos na tela sem mais configuracoes"

        if widget_tkinter == "entry":
            inputElement = Entry(infoAppFrame,
                                 takefocus=False,
                                 state="disabled",
                                 width=40,
                                 font=self.font)
        elif widget_tkinter == "text":
            inputElement = Text(infoAppFrame,
                                takefocus=False,
                                state="disabled",
                                width=40,
                                height=4,
                                font=self.font)

        elif widget_tkinter == "spinbox":
            inputElement = Spinbox(infoAppFrame,
                                   takefocus=False,
                                   state="disabled",
                                   width=7,
                                   font=self.font)
        elif widget_tkinter == "entry-date":
            inputElement = Entry(infoAppFrame,
                                 takefocus=False,
                                 state="disabled",
                                 width=10,
                                 font=self.font)
        elif widget_tkinter == "entry-phone":
            inputElement = Entry(infoAppFrame,
                                 takefocus=False,
                                 state="disabled",
                                 width=15,
                                 font=self.font)

        inputElement.pack(side=LEFT, padx=10, pady=10)

        return inputElement

    def renderElement(self, infoAppFrame, widget_tkinter):
        "Renderiza os elementos na tela com configurações de variáveis"
        inputElementVar = None
        if widget_tkinter == "entry":
            inputElementVar = StringVar()
            inputElement = Entry(infoAppFrame,
                                 width=40,
                                 textvariable=inputElementVar,
                                 font=self.font)

        elif widget_tkinter == "entry-date":
            inputElementVar = StringVar()
            inputElement = Entry(infoAppFrame,
                                 width=10,
                                 textvariable=inputElementVar,
                                 font=self.font)
            inputElement.config(validate="key",
                                validatecommand=(self.validadeDateReg, '%i',
                                                 '%P', '%S', '%s'))

        elif widget_tkinter == "entry-phone":
            inputElementVar = StringVar()
            inputElement = Entry(infoAppFrame,
                                 width=15,
                                 textvariable=inputElementVar,
                                 font=self.font)
            inputElement.config(validate="key",
                                validatecommand=(self.validadePhoneReg, '%i',
                                                 '%P', '%S', '%s'))

        elif widget_tkinter == "spinbox":
            inputElementVar = StringVar()
            inputElement = Spinbox(infoAppFrame,
                                   width=5,
                                   textvariable=inputElementVar,
                                   font=self.font)

        elif widget_tkinter == "text":
            inputElement = Text(infoAppFrame,
                                width=40,
                                height=4,
                                font=self.font)
            inputElementVar = self.createVarByTextWidget(inputElement)

        inputElement.pack(side=LEFT, padx=10, pady=10)

        return (inputElement, inputElementVar)

    def createVarByTextWidget(self, textWidget):
        def funcSet(value):
            textWidget.delete("0.0", END)
            textWidget.insert("0.0", value)

        return type(
            "StringVar", (), {
                "set": staticmethod(funcSet),
                "get": staticmethod(lambda: textWidget.get("0.0", END))
            })

    def actionChoiseImageForm(self):
        path_origin = tkFileDialog.askopenfilename(
            initialdir="/",
            title="Selecione o Arquivo",
            filetypes=(("Arquivos jpeg", "*.jpg"), ("Arquivos png", "*.png"),
                       ("Todos arquivos", "*.*")))
        if path_origin:
            file_name = os.path.basename(path_origin)
            self.pathImageFormVar.set("images/iconsApps/" + file_name)

            path_origin = path_origin.encode("latin-1")
            path_destiny = ("images/iconsApps/" + file_name).encode("latin-1")

            print(path_origin, path_destiny, type(savePhoto))

            savePhoto(path_origin, path_destiny, (100, 100))
            image = renderPhoto(path_destiny, (100, 100))
            self.imageWidget["image"] = image
            self.imageWidget["background"] = "SystemButtonFace"

    def actionNextTabFrameFieldForm(self):
        "Salva o app na db e pula para a proxima aba"
        #self.nameFormVar.set("Eventos Mensais")
        #self.textWidget.insert("0.0", "Eventos e palestrar de tecnologia que estão perto de ocorrer no ano de 2018.")
        self.nextTabFrameFieldForm()

    def cleanInfoApp(self):
        self.nameFormVar.set("")
        self.pathImageFormVar.set("")
        self.descriptionFormVar.set("")

    def cleanFieldForm(self):
        for element in self.listElementThisForm.values():
            element[-1].destroy()

    def saveAll(self):
        nameTableFormated = self.formatNameTable(self.nameFormVar.get()) + str(
            randint(1, 1000000))
        appId = self.saveApp(nameTableFormated)  #Salva as informacoes do App
        self.saveFieldsForm(
            appId)  #Salva as ordens dos elementos no formulario
        self.saveTableForm(
            nameTableFormated)  #Salva a tabela para inserir os futuros itens

        self.cleanInfoApp()  #Limpa todos os campos preenchimentos de Info App
        self.cleanFieldForm(
        )  #Remove todos os Itens adicionados na criacao do formulario
        self.activeDeactivateTabFrameFieldForm(
        )  #Torna a aba Item invisivel novamente

    def saveApp(self, nameTableFormated):
        "Salva o app no banco de dados"

        self.db.saveRecordApp(self.nameFormVar.get(),
                              self.textWidget.get("0.0", END),
                              nameTableFormated, self.pathImageFormVar.get())

        return self.db.getIdOfLastRecordInApps()[0]

    def saveFieldsForm(self, appId):
        #(id_element, nameElementVar, type_element, inputElement)
        index_posicao = 0
        indexTemps = list(self.listElementThisForm)
        indexTemps.sort()

        for indexTemp in indexTemps:
            id_element, nameElementVar, type_element, _ = self.listElementThisForm.get(
                indexTemp)
            #salvar em saveFieldApp ---> id_formulario, id_elemento, titulo, texto_ajuda, index_posicao

            self.db.saveFieldApp(appId, id_element, str(nameElementVar.get()),
                                 "", index_posicao)
            index_posicao += 1

    def saveTableForm(self, nameTableFormated):
        try:
            fields_types = map(lambda element: self.formatNameColumn(element[1].get())+\
            " "+element[2], self.listElementThisForm.values())
            self.db.saveTableApp(nameTableFormated, fields_types)
        except Exception as error:
            self.errorReport.showAndSaveError(
                error.message, "Erro ocorreu durante salvamento da tabela")

    def createMenuSideForFieldForm(self):
        if not self.menuRightStateVar:
            self.menuRight["background"] = "red"
            self.menuRightCreateForm = Frame(self.menuRight)
            self.menuRightCreateForm.pack(side=TOP, padx=10, pady=10)

            self.buttonSaveApp = Button(self.menuRightCreateForm, command=self.saveAll, \
             font=self.font, text="Salvar App")
            self.buttonSaveApp.pack(side=TOP, ipadx=10)
        self.menuRightStateVar = True

    def hideMenuFieldForm(self):
        self.menuRightCreateForm.forget()

    def showMenuFieldForm(self):
        self.menuRightCreateForm.pack(side=TOP, padx=10, pady=10)

    def nextTabFrameFieldForm(self):
        self.activeDeactivateTabFrameFieldForm()
        self.framesNotebook.select(self.tabFrameFieldForm)

    def activeDeactivateTabFrameFieldForm(self):
        self.framesNotebook.hide(self.tabFrameFieldForm)

    def formatNameColumn(self, name_field):
        name_formated = "_".join(name_field.lower().split(" ")[0:2])
        return name_formated

    def formatNameTable(self, name_form):
        name_formated = "_".join(name_form.lower().split(" ")[0:2])
        return name_formated

    def configWidgetsGetApps(
        self
    ):  # Configura todos os widgets que pertencem ao frame que mostra todos os apps e forms
        self.frameGetApps = Frame(self.frameBody)

        self.frameAbasGetApps = Notebook(self.frameGetApps)
        self.frameAbasGetApps.pack(side=TOP, fill=BOTH)

        frameApp = Frame(self.frameAbasGetApps)
        frameInfoApp = Frame(frameApp)
        frameInfoApp.pack(side=TOP, fill=BOTH)
        frameFieldsApp = Frame(frameApp)
        frameFieldsApp.pack(side=TOP, fill=BOTH)

        for idApp, nomeApp, pathImage in self.db.getAllInfoForms(
                "id", "nome_formulario", "caminho_imagem"):
            image = renderPhoto(pathImage, (35, 35))
            self.frameAbasGetApps.add(frameApp,
                                      compound=LEFT,
                                      image=image,
                                      text=nomeApp,
                                      sticky=W + E + N + S)
            break

    # def generateTabsApps(self):
    # 	self.listTabsApps = []
    # 	for app_info in self.db.getAllInfoForms("id", "nome_formulario"):
    # 		self.listTabsApps.append(self.generateTab(  ))

    # def activeTabApp(self, name_form, description, name_table, path_image):

    # 	self.frameInfoApp
    # 	self.frameFieldsApp

    def actionOptions(self):
        if self.frameOld: self.frameOld.forget()
        self.frameOld = self.menuOptionsFunctions[self.optionVar.get()]()

    def activeOptionCreateForm(self):
        self.frameCreateForm.pack(side=LEFT, expand=True, fill=BOTH)
        self.showMenuFieldForm()
        return self.frameCreateForm

    def activeOptionGetApps(self):
        self.frameGetApps.pack(side=LEFT, expand=True, fill=BOTH)
        self.hideMenuFieldForm()
        return self.frameGetApps
예제 #20
0
파일: gui.py 프로젝트: sychov/conditer
    def show_main_frame(root):
        """Создаем основное окно программы"""

        #------------------------------------------------------------
        def press(button):
            """функция, срабатывающая при нажатии кнопок переключения
            между правыми (основными) фреймами"""

            index = BUTTONS.index(button)
            window_names = rightFrameTabs.tabs()
            rightFrameTabs.select(window_names[index])

        #--------------------------------------------------------------
        def tab_changes(tab):
            """функция, срабатывающая при нажатии закладок переключения
            между правыми (основными) фреймами"""

            window_names = rightFrameTabs.tabs()
            index = window_names.index(rightFrameTabs.select())
            button = BUTTONS[index]

            for but in BUTTONS:
                if but <> button:
                    but['style'] = 'Default.TButton'
                else:
                    but['style'] = 'Chosen.TButton'

            if button == button_rule:
                if not checks_exist('Остались незакрытые счета!\nВы уверены, ' +
                   ' что хотите перейти в раздел "Управление"?\nвсе незакрытые'+
                   ' счета в таком случае будут для вас потеряны!'):
                    press(button_sell)

            if not FLAGS[index]:
                SHOW[index](workArea[index],data)
                FLAGS[index] = True

        #-------------------------------------------------------------

        leftFrame = Canvas(root, width=PANEL_WIDTH, highlightthickness=0)
        leftFrame.pack(side=LEFT, fill=Y)
        leftFrame.pack_propagate(False)
        if USE_BACKGROUND:
            leftFrame.create_image(0,0, anchor='nw', image=data.photo)

        heads = (u'Продажи', u'Отчеты', u'Приход', u'Списание', u'Сверка',
                 u'Управление', u'Настройки',)

        workArea = []
        rightFrameTabs = Notebook(root, style='Hidden.TNotebook')
        for q in range (7):
            frame = Canvas(rightFrameTabs, relief=GROOVE)
            rightFrameTabs.add(frame, text=heads[q])
            workArea.append(frame)
        rightFrameTabs.pack(side=TOP, fill=BOTH, expand=YES)
        rightFrameTabs.bind('<<NotebookTabChanged>>', tab_changes)

        button_sell = Button(leftFrame, text = u'\nПРОДАЖИ\n',
                             command=lambda: press(button_sell))
        button_sell.pack(side=TOP, padx=10, pady=10, fill=X)
        button_comings = Button(leftFrame, text = u'\nПРИХОД\n',
                                command=lambda: press(button_comings))
        button_comings.pack(side=TOP, padx=10, pady=10, fill=X)
        button_lost = Button(leftFrame, text = u'\nСПИСАНИЕ\n',
                             command=lambda: press(button_lost))
        button_lost.pack(side=TOP, padx=10, pady=10, fill=X)
        button_inventory = Button(leftFrame, text = u'\nСВЕРКА\n',
                                  command=lambda: press(button_inventory))
        button_inventory.pack(side=TOP, padx=10, pady=10, fill=X)
        button_reports = Button(leftFrame, text = u'\nОТЧЕТЫ\n',
                         command=lambda: press(button_reports))
        button_reports.pack(side=TOP, padx=10, pady=10, fill=X)
        button_rule = Button(leftFrame, text = u'\nУПРАВЛЕНИЕ\n',
                             command=lambda: press(button_rule))
        button_rule.pack(side=TOP, padx=10, pady=10, fill=X)
        button_exit = Button(leftFrame, text = u'\nВЫХОД\n', command=shutdown,
                                style='Default.TButton')
        button_exit.pack(side=BOTTOM, padx=10, pady=10, fill=X)
        button_options = Button(leftFrame, text = u'\nНАСТРОЙКА\n',
                             command=lambda: press(button_options))
        button_options.pack(side=BOTTOM, padx=10, pady=10, fill=X)

        BUTTONS = (button_sell, button_reports, button_comings,
                     button_lost, button_inventory, button_rule, button_options)
        SHOW = (show_sell, show_report, show_incoming, show_lost, show_verify,
                        show_control, show_options)
        FLAGS = [True, False, False, False, False, False, True]
        styles()
        press(button_sell)

        return workArea
예제 #21
0
파일: sell.py 프로젝트: sychov/conditer
    def show_sell_bills(master):
        """Заполняет верхний фрейм продаж блокнотом со счетами и
        сответствующими элементами управления."""

        sellTopFrame = Frame(master, relief=GROOVE)
        sellTopFrame.pack(side=TOP, fill=X, padx=10, pady=5)

        #------------------------------------------------------------
        def b_add():
            """Срабатывает при нажатии кнопки "Добавить счет", добавляет таб в
            блокноте со счетами"""

            bill = Bill(note)
            bills.append(bill)
            tab = bill.frame
            note.add(tab, text = show_sell_bills.entry.get())
            button_del_bill.configure(state=NORMAL)

        button_add_bill = Button(sellTopFrame,text=u'Добавить\nсчет',
                        style='Little.TButton', command=b_add)
        button_add_bill.pack(side=LEFT, padx=10, pady=10, fill=X)

        #------------------------------------------------------------
        """Хоть и без отдельной функции, но комментарий расширенный стоит дать.
        Это окошко ввода названия для создаваемого счета"""

        show_sell_bills.entry = StringVar()
        show_sell_bills.entry.set(u'Стол ')
        entry = Entry(sellTopFrame, textvariable=show_sell_bills.entry,
                        font=('verdana', FONT_SIZE))
        entry.pack(side=LEFT, padx=10, pady=10)

        #------------------------------------------------------------
        def b_left():
            """Срабатывает при нажатии кнопки "влево", сдвигается влево на
            один таб в блокноте со счетами"""

            w_name = note.select()
            window_names = note.tabs()
            if window_names:
                index = window_names.index(w_name) - 1
                note.select(window_names[index])

        button_left = Button(sellTopFrame, image=data.IMG_INTERFACE[3],
                                command=b_left)
        button_left.pack(side=LEFT, padx=5, pady=5)

        #------------------------------------------------------------
        def b_right():
            """Срабатывает при нажатии кнопки "вправо", сдвигается вправо на
            один таб в блокноте со счетами"""

            w_name = note.select()
            window_names = note.tabs()
            if window_names:
                index = window_names.index(w_name) + 1
                if index == len(window_names):
                    index = 0
                note.select(window_names[index])

        button_right = Button(sellTopFrame, image=data.IMG_INTERFACE[4],
                                command=b_right)
        button_right.pack(side=LEFT, padx=5, pady=5)

        #------------------------------------------------------------
        def b_del():
            """Срабатывает при нажатии кнопки "удалить счет", удаляет таб в
            блокноте со счетами"""

            w_name = note.select()
            window_names = note.tabs()
            if not window_names:
                button_del_bill.configure(state=DISABLED)
            else:
                index = window_names.index(w_name)
                if not bills[index].bill:
                    note.forget(note.select())
                    del(bills[index])
                    if not note.tabs():
                        button_del_bill.configure(state=DISABLED)
                else:
                    if tkMessageBox.askokcancel('Внимание!',
                                   'Вы уверены, что хотите удалить этот счет?'):
                        note.forget(note.select())
                        del(bills[index])
                        if not note.tabs():
                            button_del_bill.configure(state=DISABLED)

        button_del_bill = Button(sellTopFrame,text=u'Удалить\nсчет',
                        style='Little.TButton', command=b_del)
        button_del_bill.pack(side=LEFT, padx=10, pady=10, fill=X)


        #----- ОСТАВШИЕСЯ ЭЛЕМЕНТЫ - БЛОКНОТ, СЧЕТЧИК ПРОДАЖ, КАЛЬКУЛЯТОР ------

        label = Label(sellTopFrame, text='', bg='white',
                                            font=('Lucida Console', FONT_SIZE))
        label.pack(side=RIGHT, padx=10, pady=5)

        def label_renew():
            """Обновляет счетчик продаж в верхнем правом углу экрана"""
            sold = '%6.2f' % round(queries.sell_in_day(),2) + ' грн.'
            label.configure(text='СЕГОДНЯ ПРОДАНО\n на ' + sold)

        label_renew()
        show_sell_bills.label_renew = label_renew

        #-----------
        button_calc = Button(sellTopFrame, image=data.IMG_INTERFACE[8],
                        command=calculator_press)
        button_calc.pack(side=RIGHT, padx=5, pady=5)

        button_paid = Button(sellTopFrame, image=data.IMG_INTERFACE[10], width=8,
                                     compound=LEFT, text=u'Блокнот\nрасходов',
                                     command=lambda: calc_pad(data))
        button_paid.pack(side=RIGHT, padx=5, pady=5)

        #-----------
        note = Notebook(master, style='Custom.TNotebook')
        bills = []
        note.pack(side=TOP, padx=BILL_PAD_X, pady=BILL_PAD_Y)

        #----------- Один пустой столик ставим по умолчанию ----------
        bill = Bill(note)
        bills.append(bill)
        tab = bill.frame
        note.add(tab, text = u' Стол 1 ')
        #-------------------------------------------------------------

        #--------Автоподъем высоты ------------
        sellTopFrame.update()
        y1 = sellTopFrame.winfo_height()
        y2 = note.winfo_height()
        master.configure(height = y1 + y2 + 40)
        master.pack_propagate(False)
        #---------------------------------------

        calculator_press.window_calc = False

        return bills, note
예제 #22
0
    def __init__(self, master):
	self.fname="" 
        self.t1=StringVar()
        self.t2=StringVar()
        self.t3=StringVar()
        self.t4=StringVar()
        self.var1=StringVar()
        self.var2=StringVar()
        self.var3=StringVar()
        self.var4=StringVar()
        
        mymaster = Frame(master, name='mymaster') # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window    
        #master.minsize(width=900, height=900)
        #master.maxsize(width=550, height=350)
        #end
        
        #title of window
        master.title("Airserv-ng")
        #end
        
        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont=tkFont.Font(family="Helvetica", size=15,underline = True)
        self.myfontnew=tkFont.Font(family="Helvetica", size=11,underline = True)
        #end
        
        
       
        nb = Notebook(mymaster, name='nb') # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3) # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1") # add tab to Notebook
    
        # repeat for each tab
        self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")
        #End
	#frame content 7
	Label(self.frame_content7, text = 'Aigraph-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        btndetect=Button(self.frame_content7, text = 'Detect', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 1, column = 0, padx = 5, pady = 5)
		
	btndbrowse=Button(self.frame_content7, text = 'Attach File', command =self.browse_file, height=2, width=15, font=self.customFont).grid(row = 3, column = 0, padx = 5, pady = 5)	
	self.lilnew1=Listbox(self.frame_content7,bg="black", fg="white", font=self.myfont, selectmode=SINGLE, width=30, height=15)
        self.lilnew1.grid(row = 1, column = 1, rowspan=3)
	#End        

        Label(self.frame_content, text = 'Airserv-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content, text = 'Options :',font=self.myfontnew, bg="white").grid(row = 1, column = 1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5, text = 'Edit Command From Here',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 0, column = 0)
        TextCommandBox=Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output=Text(self.frame_content5,bg="black", fg="white", font=self.myfont, height=15, width=30)
        self.output.grid(row = 0, column = 1, padx=50, pady=5, rowspan=3)
        btnsubmit=Button(self.frame_content5, width=15, height=2, text="Get Result", command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear=Button(self.frame_content5, width=15, height=2, text="Clear Output", command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-p", \
                 onvalue="-p",offvalue="", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var1)
        self.C1.grid(row = 2, column = 0, padx = 5, pady = 5)
        self.t1=Text(self.frame_content,height=1,width = 20)
        self.t1.grid(row = 2, column = 1, padx = 5, pady = 5)
        l1=Label(self.frame_content, text = ': TCP port to listen on. Defaults to 666.',font=self.myfont, bg="white", justify=LEFT).grid(row = 2, column = 2, padx = 5, pady = 5)
        
        self.C2 = Checkbutton(self.frame_content, text = "-d", \
                 onvalue = "-d", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var2)
        self.C2.grid(row = 3, column = 0, padx = 5, pady = 5)
        self.t2=Text(self.frame_content,height=1,width = 20)
        self.t2.grid(row = 3, column = 1, padx = 5, pady = 5)
        l2=Label(self.frame_content, text = ': wifi device to serve.',font=self.myfont, bg="white", justify=LEFT).grid(row = 3, column = 2, padx = 5, pady = 5)
        
        self.C3 = Checkbutton(self.frame_content, text = "-c", \
                 onvalue = "-c", offvalue ="", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row = 4, column = 0, padx = 5, pady = 5)
        self.t3=Text(self.frame_content,height=1,width = 20)
        self.t3.grid(row = 4, column = 1, padx = 5, pady = 5)
        l3=Label(self.frame_content, text = ':   Channel to start on.',font=self.myfont, bg="white", justify=LEFT).grid(row = 4, column = 2, padx = 5, pady = 5)
        
        self.C4 = Checkbutton(self.frame_content, text = "-v", \
                 onvalue = "-v", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var4)
        self.C4.grid(row = 5, column = 0, padx = 5, pady = 5)
        self.t4=Text(self.frame_content,height=1,width = 20)
        self.t4.grid(row = 5, column = 1, padx = 5, pady = 5)
        l4=Label(self.frame_content, text = ': debug level.',font=self.myfont, bg="white", justify=LEFT).grid(row = 5, column = 2, padx = 5, pady = 5)
예제 #23
0
    def __init__(self, master):
        
	self.fname=""
        #global variables
        self.t1=StringVar()
        self.t2=StringVar()
        self.t3=StringVar()
        self.t4=StringVar()
        self.t5=StringVar()
        self.t6=StringVar()
        self.t7=StringVar()
        self.t8=StringVar()
        self.t9=StringVar()
        self.t10=StringVar()
        self.t11=StringVar()
        self.t12=StringVar()
        self.t13=StringVar()
        self.t14=StringVar()
        self.t15=StringVar()
        self.t16=StringVar()
        self.t17=StringVar()
        self.t18=StringVar()
        self.t19=StringVar()
        self.t20=StringVar()
        self.t21=StringVar()
        self.t22=StringVar()
        self.t23=StringVar()
        self.t24=StringVar()
        self.t25=StringVar()
        self.t26=StringVar()
        
        self.var1=StringVar()
        self.var2=StringVar()
        self.var3=StringVar()
        self.var4=StringVar()
        self.var5=StringVar()
        self.var6=StringVar()
        self.var7=StringVar()
        self.var8=StringVar()
        self.var9=StringVar()
        self.var10=StringVar()
        self.var11=StringVar()
        self.var12=StringVar()
        self.var13=StringVar()
        self.var14=StringVar()
        self.var15=StringVar()
        self.var16=StringVar()
        self.var17=StringVar()
        self.var18=StringVar()
        self.var19=StringVar()
        self.var20=StringVar()
        self.var21=StringVar()
        self.var22=StringVar()
        self.var23=StringVar()
        self.var24=StringVar()
        self.var25=StringVar()
        self.var26=StringVar()
        #end
        
        mymaster = Frame(master, name='mymaster') # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window    
        #master.minsize(width=900, height=900)
        #master.maxsize(width=650, height=410)
        #end
        
        #title of window
        master.title("Airodump-ng")
        #end
        
        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont=tkFont.Font(family="Helvetica", size=15,underline = True)
        self.myfontnew=tkFont.Font(family="Helvetica", size=11,underline = True)
        #end
        
        
       
        nb = Notebook(mymaster, name='nb') # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3) # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1") # add tab to Notebook
    
        # repeat for each tab
        self.frame_content2 = Frame(nb, name='frame_content2', bg="white")
        nb.add(self.frame_content2, text="Filter-2")
        self.frame_content3 = Frame(nb, name='frame_content3', bg="white")
        nb.add(self.frame_content3, text="Filter-3")
        self.frame_content4 = Frame(nb, name='frame_content4', bg="white")
        nb.add(self.frame_content4, text="Filter-4")
	self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")        
	self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")
        #End
        
	#frame content 7
	Label(self.frame_content7, text = 'Airodump-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        btndetect=Button(self.frame_content7, text = 'Detect', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 1, column = 0, padx = 5, pady = 5)
		
	btndbrowse=Button(self.frame_content7, text = 'Attach File', command =self.browse_file, height=2, width=15, font=self.customFont).grid(row = 3, column = 0, padx = 5, pady = 5)	
	self.lilnew1=Listbox(self.frame_content7,bg="black", fg="white", font=self.myfont, selectmode=SINGLE, width=30, height=15)
        self.lilnew1.grid(row = 1, column = 1, rowspan=3)
	#End

        Label(self.frame_content, text = 'Airodump-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content, text = 'Options :',font=self.myfontnew, bg="white").grid(row = 1, column = 1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5, text = 'Edit Command From Here',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 0, column = 0)
        TextCommandBox=Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output=Text(self.frame_content5,bg="black", fg="white", font=self.myfont, height=20, width=42)
        self.output.grid(row = 0, column = 1, padx=50, pady=5, rowspan=3)
        btnsubmit=Button(self.frame_content5, width=15, height=2, text="Get Result", command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear=Button(self.frame_content5, width=15, height=2, text="Clear Output", command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "--ivs", \
                 onvalue = "--ivs", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var1)
        self.C1.grid(row = 2, column = 0, padx = 5, pady = 5)
        self.t1=Text(self.frame_content,height=1,width = 20)
        self.t1.grid(row = 2, column = 1, padx = 5, pady = 5)
        l1=Label(self.frame_content, text = ': Save only captured IVs',font=self.myfont, bg="white", justify=LEFT).grid(row = 2, column = 2, padx = 5, pady = 5)
        
        self.C2 = Checkbutton(self.frame_content, text = "--gpsd", \
                 onvalue = "--gpsd", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var2)
        self.C2.grid(row = 3, column = 0, padx = 5, pady = 5)
        self.t2=Text(self.frame_content,height=1,width = 20)
        self.t2.grid(row = 3, column = 1, padx = 5, pady = 5)
        l2=Label(self.frame_content, text = ': Use GPSd',font=self.myfont, bg="white", justify=LEFT).grid(row = 3, column = 2, padx = 5, pady = 5)
        
        self.C3 = Checkbutton(self.frame_content, text = "--write", \
                 onvalue = "--write", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row = 4, column = 0, padx = 5, pady = 5)
        self.t3=Text(self.frame_content,height=1,width = 20)
        self.t3.grid(row = 4, column = 1, padx = 5, pady = 5)
        l3=Label(self.frame_content, text = ': Dump file prefix',font=self.myfont, bg="white", justify=LEFT).grid(row = 4, column = 2, padx = 5, pady = 5)
        
        self.C4 = Checkbutton(self.frame_content, text = "-w", \
                 onvalue = "-w", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var4)
        self.C4.grid(row = 5, column = 0, padx = 5, pady = 5)
        self.t4=Text(self.frame_content,height=1,width = 20)
        self.t4.grid(row = 5, column = 1, padx = 5, pady = 5)
        l4=Label(self.frame_content, text = ': same as --write',font=self.myfont, bg="white", justify=LEFT).grid(row = 5, column = 2, padx = 5, pady = 5)
        
        self.C5 = Checkbutton(self.frame_content, text = "--beacons", \
                 onvalue = "--beacon", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var5)
        self.C5.grid(row = 6, column = 0, padx = 5, pady = 5)
        self.t5=Text(self.frame_content,height=1,width = 20)
        self.t5.grid(row = 6, column = 1, padx = 5, pady = 5)
        l5=Label(self.frame_content, text = ': Record all beacons in dump file',font=self.myfont, bg="white", justify=LEFT).grid(row = 6, column = 2, padx = 5, pady = 5)
        
        self.C6 = Checkbutton(self.frame_content, text = "--update", \
                 onvalue = "--update", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var6)
        self.C6.grid(row = 7, column = 0, padx = 5, pady = 5)
        self.t6=Text(self.frame_content,height=1,width = 20)
        self.t6.grid(row = 7, column = 1, padx = 5, pady = 5)
        l6=Label(self.frame_content, text = ': Display update delay in seconds',font=self.myfont, bg="white", justify=LEFT).grid(row = 7, column = 2, padx = 5, pady = 5)
        
        self.C7 = Checkbutton(self.frame_content, text = "--showack", \
                 onvalue = "--showack", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var7)
        self.C7.grid(row = 8, column = 0, padx = 5, pady = 5)
        self.t7=Text(self.frame_content,height=1,width = 20)
        self.t7.grid(row = 8, column = 1, padx = 5, pady = 5)
        l7=Label(self.frame_content, text = ': Prints ack/cts/rts statistics',font=self.myfont, bg="white", justify=LEFT).grid(row = 8, column = 2, padx = 5, pady = 5)
        
        self.C8 = Checkbutton(self.frame_content2, text = "-h", \
                 onvalue = "-h", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var8)
        self.C8.grid(row = 9, column = 0, padx = 5, pady = 5)
        self.t8=Text(self.frame_content2,height=1,width = 20)
        self.t8.grid(row = 9, column = 1, padx = 5, pady = 5)
        l8=Label(self.frame_content2, text = ': Hides known stations for --showack',font=self.myfont, bg="white", justify=LEFT).grid(row = 9, column = 2, padx = 5, pady = 5)
        
        self.C9 = Checkbutton(self.frame_content2, text = "-f", \
                 onvalue = "-f", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var9)
        self.C9.grid(row = 10, column = 0, padx = 5, pady = 5)
        self.t9=Text(self.frame_content2,height=1,width = 20)
        self.t9.grid(row = 10, column = 1, padx = 5, pady = 5)
        l9=Label(self.frame_content2, text = ': Time in ms between hopping channels',font=self.myfont, bg="white", justify=LEFT).grid(row = 10, column = 2, padx = 5, pady = 5)
        
        Label(self.frame_content2, text = 'Airodump-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        
        self.C10 = Checkbutton(self.frame_content2, text = "--berlin", \
                 onvalue = "--berlin", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var10)
        self.C10.grid(row = 11, column = 0, padx = 5, pady = 5)
        self.t10=Text(self.frame_content2,height=1,width = 20)
        self.t10.grid(row = 11, column = 1, padx = 5, pady = 5)
        l10=Label(self.frame_content2, text = ': Time before removing the AP/client',font=self.myfont, bg="white", justify=LEFT).grid(row = 11, column = 2, padx = 5, pady = 5)
        
        self.C11 = Checkbutton(self.frame_content2, text = "-r", \
                 onvalue = "-r", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var11)
        self.C11.grid(row = 12, column = 0, padx = 5, pady = 5)
        self.t11=Text(self.frame_content2,height=1,width = 20)
        self.t11.grid(row = 12, column = 1, padx = 5, pady = 5)
        l11=Label(self.frame_content2, text = ': Read packets from that file',font=self.myfont, bg="white", justify=LEFT).grid(row = 12, column = 2, padx = 5, pady = 5)
        
        self.C12 = Checkbutton(self.frame_content2, text = "-x", \
                 onvalue = "-x", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var12)
        self.C12.grid(row = 13, column = 0, padx = 5, pady = 5)
        self.t12=Text(self.frame_content2,height=1,width = 20)
        self.t12.grid(row = 13, column = 1, padx = 5, pady = 5)
        l12=Label(self.frame_content2, text = ': Active Scanning Simulation',font=self.myfont, bg="white", justify=LEFT).grid(row = 13, column = 2, padx = 5, pady = 5)
        
        self.C13 = Checkbutton(self.frame_content2, text = " --output-format", \
                 onvalue = "--output-format", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var13)
        self.C13.grid(row = 14, column = 0, padx = 5, pady = 5)
        self.t13=Text(self.frame_content2,height=1,width = 20)
        self.t13.grid(row = 14, column = 1, padx = 5, pady = 5)
        l13=Label(self.frame_content2, text = ': Output format. Possible values',font=self.myfont, bg="white", justify=LEFT).grid(row = 14, column = 2, padx = 5, pady = 5)
        
        self.C14 = Checkbutton(self.frame_content2, text = " --ignore-negative-one", \
                 onvalue = "--ignore-negative-one", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var14)
        self.C14.grid(row = 15, column = 0, padx = 5, pady = 5)
        self.t14=Text(self.frame_content2,height=1,width = 20)
        self.t14.grid(row = 15, column = 1, padx = 5, pady = 5)
        l14=Label(self.frame_content2, text = ': Removes the message that says fixed channel',font=self.myfont, bg="white").grid(row = 15, column = 2, padx = 5, pady = 5)
        
        
        Label(self.frame_content3, text = 'Airodump-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content3, text = 'Filter Options :',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 16, column = 1)
        
        self.C15 = Checkbutton(self.frame_content3, text = "--encrypt", \
                 onvalue = "--encrypt", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var15)
        self.C15.grid(row = 17, column = 0, padx = 5, pady = 5)
        self.t15=Text(self.frame_content3,height=1,width = 20)
        self.t15.grid(row = 17, column = 1, padx = 5, pady = 5)
        l15=Label(self.frame_content3, text = ': Filter APs by cipher suite',font=self.myfont, bg="white", justify=LEFT).grid(row = 17, column = 2, padx = 5, pady = 5)
        
        self.C16 = Checkbutton(self.frame_content3, text = "--netmask", \
                 onvalue = "--netmask", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var16)
        self.C16.grid(row = 18, column = 0, padx = 5, pady = 5)
        self.t16=Text(self.frame_content3,height=1,width = 20)
        self.t16.grid(row = 18, column = 1, padx = 5, pady = 5)
        l16=Label(self.frame_content3, text = ': Filter APs by mask',font=self.myfont, bg="white", justify=LEFT).grid(row = 18, column = 2, padx = 5, pady = 5)
        
        self.C17 = Checkbutton(self.frame_content3, text = "--bssid", \
                 onvalue = "--bssid", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var17)
        self.C17.grid(row = 19, column = 0, padx = 5, pady = 5)
        self.t17=Text(self.frame_content3,height=1,width = 20)
        self.t17.grid(row = 19, column = 1, padx = 5, pady = 5)
        l17=Label(self.frame_content3, text = ': Filter APs by BSSID',font=self.myfont, bg="white", justify=LEFT).grid(row = 19, column = 2, padx = 5, pady = 5)
        
        self.C18 = Checkbutton(self.frame_content3, text = "--essid", \
                 onvalue = "--essid", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var18)
        self.C18.grid(row = 20, column = 0, padx = 5, pady = 5)
        self.t18=Text(self.frame_content3,height=1,width = 20)
        self.t18.grid(row = 20, column = 1, padx = 5, pady = 5)
        l18=Label(self.frame_content3, text = ': Filter APs by ESSID',font=self.myfont, bg="white", justify=LEFT).grid(row = 20, column = 2, padx = 5, pady = 5)
        
        self.C19 = Checkbutton(self.frame_content3, text = "--essid-regex", \
                 onvalue = "--essid-regex", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var19)
        self.C19.grid(row = 21, column = 0, padx = 5, pady = 5)
        self.t19=Text(self.frame_content3,height=1,width = 20)
        self.t19.grid(row = 21, column = 1, padx = 5, pady = 5)
        l19=Label(self.frame_content3, text = ': Filter APs by ESSID using \n  a regular expression',font=self.myfont, bg="white", justify=LEFT).grid(row = 21, column = 2, padx = 5, pady = 5)
        
        self.C20 = Checkbutton(self.frame_content3, text = "-a", \
                 onvalue = "-a", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var20)
        self.C20.grid(row = 22, column = 0, padx = 5, pady = 5)
        self.t20=Text(self.frame_content3,height=1,width = 20)
        self.t20.grid(row = 22, column = 1, padx = 5, pady = 5)
        l20=Label(self.frame_content3, text = ': Filter unassociated clients',font=self.myfont, bg="white", justify=LEFT).grid(row = 22, column = 2, padx = 5, pady = 5)
        
        Label(self.frame_content4, text = 'Airodump-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        
        self.C21 = Checkbutton(self.frame_content4, text = "--channel", \
                 onvalue = "--channel", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var21)
        self.C21.grid(row = 23, column = 0, padx = 5, pady = 5)
        self.t21=Text(self.frame_content4,height=1,width = 20)
        self.t21.grid(row = 23, column = 1, padx = 5, pady = 5)
        l21=Label(self.frame_content4, text = ': Capture on specific channels',font=self.myfont, bg="white", justify=LEFT).grid(row = 23, column = 2, padx = 5, pady = 5)
        
        self.C22 = Checkbutton(self.frame_content4, text = "--band", \
                 onvalue = "--band", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var22)
        self.C22.grid(row = 24, column = 0, padx = 5, pady = 5)
        self.t22=Text(self.frame_content4,height=1,width = 20)
        self.t22.grid(row = 24, column = 1, padx = 5, pady = 5)
        l22=Label(self.frame_content4, text = ':  Band on which airodump-ng should hop',font=self.myfont, bg="white", justify=LEFT).grid(row = 24, column = 2, padx = 5, pady = 5)
        
        self.C23 = Checkbutton(self.frame_content4, text = "-C", \
                 onvalue = "-C", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var23)
        self.C23.grid(row = 25, column = 0, padx = 5, pady = 5)
        self.t23=Text(self.frame_content4,height=1,width = 20)
        self.t23.grid(row = 25, column = 1, padx = 5, pady = 5)
        l23=Label(self.frame_content4, text = ':  Uses these frequencies in MHz to hop',font=self.myfont, bg="white", justify=LEFT).grid(row = 25, column = 2, padx = 5, pady = 5)
        
        self.C24 = Checkbutton(self.frame_content4, text = "-s", \
                 onvalue = "-s", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var24)
        self.C24.grid(row = 26, column = 0, padx = 5, pady = 5)
        self.t24=Text(self.frame_content4,height=1,width = 20)
        self.t24.grid(row = 26, column = 1, padx = 5, pady = 5)
        l24=Label(self.frame_content4, text = ':  same as --cswitch',font=self.myfont, bg="white", justify=LEFT).grid(row = 26, column = 2, padx = 5, pady = 5)
        
        self.C25 = Checkbutton(self.frame_content3, text = "--cswitch", \
                 onvalue = "--cswitch", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var25)
        self.C25.grid(row = 27, column = 0, padx = 5, pady = 5)
        self.t25=Text(self.frame_content3,height=1,width = 20)
        self.t25.grid(row = 27, column = 1, padx = 5, pady = 5)
        l25=Label(self.frame_content3, text = ':  Set channel switching method',font=self.myfont, bg="white", justify=LEFT).grid(row = 27, column = 2, padx = 5, pady = 5)
        
        self.C26 = Checkbutton(self.frame_content4, text = "--help", \
                 onvalue = "--help", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var26)
        self.C26.grid(row = 28, column = 0, padx = 5, pady = 5)
        self.t26=Text(self.frame_content4,height=1,width = 20)
        self.t26.grid(row = 28, column = 1, padx = 5, pady = 5)
        l26=Label(self.frame_content4, text = ':  Displays this usage screen',font=self.myfont, bg="white", justify=LEFT).grid(row = 28, column = 2, padx = 5, pady = 5)
예제 #24
0
    def build_credits(self):

        if getattr(self, "home", False): self.home.pack_forget()
        if getattr(self, "license", False): self.license.pack_forget()

        self.credits = Frame(self.parent)
        self.credits.pack(expand=True, fill=BOTH)

        Label(self.credits, text="Credits",
              **self.style_text).pack(side=TOP, expand=True, fill=X)

        style = Style()
        style.configure("BW.TNotebook",
                        background=self.parent.cget("bg"),
                        borderwidth=1,
                        relief=SUNKEN,
                        highlightthickness=1)

        notebook = Notebook(self.credits, style="BW.TNotebook")

        write = (
            "Jean-Pierre Mandon",
            "Régis Blanchot",
            "Marcus Fazzi",
            "Jesus Carmona Esteban",
            "Alfred Broda",
            "Yeison Cardona",
            "Henk Van Beek",
            "Björn Pfeiffer",
            "Alexis Sánchez",
        )

        label_write = Label(self.credits, text="\n\n".join(write))
        label_write.pack(side=TOP, expand=True, fill=BOTH)
        notebook.add(label_write, text="Write by")

        doc = (
            "Benoit Espinola",
            "Sebastien Koechlin",
            "Ivan Ricondo",
            "Jesus Carmona Esteban",
            "Marcus Fazzi",
            "Régis Blanchot",
        )

        label_doc = Label(self.credits, text="\n\n".join(doc))
        label_doc.pack(side=TOP, expand=True, fill=BOTH)
        notebook.add(label_doc, text="Documented by")

        trans = (
            "Joan Espinoza",
            "Alexis Sánchez",
            "Régis Blanchot",
            "Moreno Manzini",
            "Yeison Cardona",
            "\"Avrin\"",
        )

        label_trans = Label(self.credits, text="\n\n".join(trans))
        label_trans.pack(side=TOP, expand=True, fill=BOTH)
        notebook.add(label_trans, text="Translated by")

        art = (
            "France Cadet",
            "Laurent Cos--tes",
            "Daniel Rodri­guez",
        )

        label_art = Label(self.credits, text="\n\n".join(art))
        label_art.pack(side=TOP, expand=True, fill=BOTH)
        notebook.add(label_art, text="Art by")

        notebook.pack(side=TOP, fill=BOTH, expand=True)

        self.panel_buttons = Frame(self.credits)
        self.panel_buttons.pack(side=BOTTOM, fill=BOTH, expand=True)

        Button(self.panel_buttons, text="Close",
               command=self.quit).pack(side=RIGHT, fill=X, expand=True)
        Button(self.panel_buttons, text="License",
               command=self.build_license).pack(side=LEFT, fill=X, expand=True)
예제 #25
0
class ReciboCaja(Frame):
        def __init__(self, parent, controller):
                Frame.__init__(self, parent)

		lupa = PhotoImage(file='img/lupa.png')
		
		#VARIABLES
		tcontrato = ['Vivienda', 'Comercial']
		aplica = StringVar()
		
		#WIDGETS
		
		#========================= HEADER ===========================
		
		self.header = Label(self, text="RECIBO DE CAJA", font="bold")
		self.header.pack(pady=20, side=TOP)
		
		#========================== WRAPPER ==========================
		
		self.wrapper = Frame (self)
		self.wrapper.pack(side=TOP, fill=Y)
		#self.wrapper.pack(side=LEFT, fill=Y)#Este ubica el forma a la IZA
		
		#================ NOTEBOOK =============>
		
		self.nb = Notebook(self.wrapper)
		
		#-----------------------> TAB 1
		
		self.tab1 = Frame (self.nb)
		self.tab1.pack()
		
		self.f0 = Frame(self.tab1)#-------------------------------------
		self.f0.pack(pady=5,fill=X)

		self.R1 = Radiobutton(self.f0, text="Arrendatario", variable=aplica, value='Arrendatario')
		self.R1.pack(padx=20,side=LEFT)
		self.R2 = Radiobutton (self.f0, text="Propietario", variable=aplica, value='Propietario')
		self.R2.pack(padx=20,side=LEFT)
		self.R3 = Radiobutton (self.f0, text="Tercero", variable=aplica, value='Tercero')
		self.R3.pack(padx=20,side=LEFT)
		
		self.f1 = Frame(self.tab1)#-------------------------------------
		self.f1.pack(pady=5,fill=X)
		
		self.cc = Label(self.f1, text='CC/Nit: ')
		self.cc.pack(side=LEFT)
		self.ccE = Entry(self.f1)
		self.ccE.pack(side=LEFT)
		
		self.b1 = Button(self.f1, text='Buscar', image=lupa)
		self.b1.image=lupa
		self.b1.pack(side=LEFT)

		self.f2 = Frame(self.tab1)
		self.f2.pack(pady=5,fill=X)#------------------------------------
		
		self.nombre = Label(self.f2, text='Nombre:')
		self.nombre.pack(side=LEFT)
		self.nombrE = Entry(self.f2, width=5, state=DISABLED)
		self.nombrE.pack(side=LEFT, fill=X, expand=1)
		
		self.f3 = Frame(self.tab1)
		self.f3.pack(pady=5,fill=X)#------------------------------------
		
		self.inmueble = Label(self.f3, text='Inmueble:')
		self.inmueble.pack(side=LEFT)
		
		self.inmuebleCbx = Combobox(self.f3, values=NONE, width=10)
		self.inmuebleCbx.set('')
		self.inmuebleCbx.pack(side=LEFT, fill=X, expand=1)
		
		self.b2 = Button(self.f3, text='Agregar', image=lupa)
		self.b2.image=lupa
		self.b2.pack(side=LEFT)
		
		self.f4 = Frame(self.tab1)
		self.f4.pack(pady=5,fill=X)#------------------------------------
		
		self.fpago = Label(self.f4, text='Forma de Pago:')
		self.fpago.pack(side=LEFT)
		
		self.fpagoCbx = Combobox(self.f4, values=NONE, width=10)
		self.fpagoCbx.set('')
		self.fpagoCbx.pack(side=LEFT)
		
		self.b3 = Button(self.f4, text='Crear novedad', state=DISABLED)
		self.b3.pack(side=LEFT)

		#========================== TREEVIEW ===========================
		
		self.f5 = Frame(self.tab1)
		self.f5.pack(pady=5,fill=X)#------------------------------------
		
		self.tree = Treeview(self.f5, height=4, show="headings", columns=('col1','col2','col3'))
		self.tree.pack(side=LEFT, fill=X, expand=1)
		self.tree.column('col1', width=20, anchor='center')
		self.tree.column('col2', width=200, anchor='center')
		self.tree.column('col3', width=10, anchor='center')
		
		self.tree.heading('col1', text='CC')
		self.tree.heading('col2', text='Descripción')
		self.tree.heading('col3', text='Valor')
		
		self.scroll = Scrollbar(self.f3,orient=VERTICAL,command=self.tree.yview)
		self.tree.configure(yscrollcommand=self.scroll.set)

		self.f6 = Frame(self.tab1)
		self.f6.pack(pady=5,fill=X)#--------------------

		self.notesL = Label(self.f6, text='Observaciones:')
		self.notesL.pack(side=LEFT)

		self.f7 = Frame(self.tab1)
		self.f7.pack(pady=5,fill=X)#-------------------

		self.notesT = Text(self.f7, height=5)
		self.notesT.pack(fill=X, side=LEFT, expand=1)
		
		#-----------------------> TAB 2
		
		self.tab2 = Frame (self.nb)
		self.tab2.pack()
		
		#-----------------------> TAB 3
		
		self.tab3 = Frame (self.nb)
		self.tab3.pack()
	
		#---------------------------------------------------------------
		
		self.nb.add (self.tab1, text="Datos Generales")
		self.nb.add(self.tab2, text="Referencia de Pago", state=DISABLED)
		self.nb.add(self.tab3, text="Referencias Bancarias", state=DISABLED)
		
		self.nb.pack()
		
		#---------------------------------------------------------------
		
		self.fBtn = Frame(self.wrapper)
		self.fBtn.pack()#-------------------------------
	
		self.queryB = Button(self.fBtn, text='Consultar')
		self.queryB.pack(side=RIGHT)
		self.deleteB = Button(self.fBtn, text='Borrar')
		self.deleteB.pack(side=RIGHT)
		self.updateB = Button(self.fBtn, text='Actualizar')
		self.updateB.pack(side=RIGHT)
		self.addB = Button(self.fBtn, text='Agregar')
		self.addB.pack(side=RIGHT)
		
		#========================= ASIDE ===========================
		"""
예제 #26
0
    def __init__(self, master):
        
	self.fname=""
        #global variables
        self.t1=StringVar()
        self.t2=StringVar()
        self.t3=StringVar()
        self.t4=StringVar()
        self.t5=StringVar()
        self.t6=StringVar()
        self.t7=StringVar()
        self.t8=StringVar()
        self.t9=StringVar()
        self.t10=StringVar()
        self.t11=StringVar()
        self.t12=StringVar()
        self.t13=StringVar()
        self.t14=StringVar()
        self.t15=StringVar()
        self.t16=StringVar()
        self.t17=StringVar()
        self.t18=StringVar()
        self.t19=StringVar()
        self.t20=StringVar()
        self.t21=StringVar()
        self.t22=StringVar()
        self.t23=StringVar()
        self.t24=StringVar()
        self.t25=StringVar()
        self.t26=StringVar()
        
        self.var1=StringVar()
        self.var2=StringVar()
        self.var3=StringVar()
        self.var4=StringVar()
        self.var5=StringVar()
        self.var6=StringVar()
        self.var7=StringVar()
        self.var8=StringVar()
        self.var9=StringVar()
        self.var10=StringVar()
        self.var11=StringVar()
        self.var12=StringVar()
        self.var13=StringVar()
        self.var14=StringVar()
        self.var15=StringVar()
        self.var16=StringVar()
        self.var17=StringVar()
        self.var18=StringVar()
        self.var19=StringVar()
        self.var20=StringVar()
        self.var21=StringVar()
        self.var22=StringVar()
        self.var23=StringVar()
        self.var24=StringVar()
        self.var25=StringVar()
        self.var26=StringVar()
        #end
        
        mymaster = Frame(master, name='mymaster') # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window    
        #master.minsize(width=900, height=900)
        #master.maxsize(width=650, height=410)
        #end
        
        #title of window
        master.title("Airodump-ng")
        #end
        
        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont=tkFont.Font(family="Helvetica", size=15,underline = True)
        self.myfontnew=tkFont.Font(family="Helvetica", size=11,underline = True)
        #end
        
        
       
        nb = Notebook(mymaster, name='nb') # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3) # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1") # add tab to Notebook
    
        # repeat for each tab
        self.frame_content2 = Frame(nb, name='frame_content2', bg="white")
        nb.add(self.frame_content2, text="Filter-2")
        self.frame_content3 = Frame(nb, name='frame_content3', bg="white")
        nb.add(self.frame_content3, text="Filter-3")
        self.frame_content4 = Frame(nb, name='frame_content4', bg="white")
        nb.add(self.frame_content4, text="Filter-4")
	self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")        
	self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")
        #End
        
	#frame content 7
	Label(self.frame_content7, text = 'Airodump-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        btndetect=Button(self.frame_content7, text = 'Detect', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 1, column = 0, padx = 5, pady = 5)
		
	btndbrowse=Button(self.frame_content7, text = 'Attach File', command =self.browse_file, height=2, width=15, font=self.customFont).grid(row = 3, column = 0, padx = 5, pady = 5)	
	self.lilnew1=Listbox(self.frame_content7,bg="black", fg="white", font=self.myfont, selectmode=SINGLE, width=30, height=15)
        self.lilnew1.grid(row = 1, column = 1, rowspan=3)
	#End

        Label(self.frame_content, text = 'Airodump-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content, text = 'Options :',font=self.myfontnew, bg="white").grid(row = 1, column = 1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5, text = 'Edit Command From Here',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 0, column = 0)
        TextCommandBox=Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output=Text(self.frame_content5,bg="black", fg="white", font=self.myfont, height=20, width=42)
        self.output.grid(row = 0, column = 1, padx=50, pady=5, rowspan=3)
        btnsubmit=Button(self.frame_content5, width=15, height=2, text="Get Result", command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear=Button(self.frame_content5, width=15, height=2, text="Clear Output", command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "--ivs", \
                 onvalue = "--ivs", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var1)
        self.C1.grid(row = 2, column = 0, padx = 5, pady = 5)
        self.t1=Text(self.frame_content,height=1,width = 20)
        self.t1.grid(row = 2, column = 1, padx = 5, pady = 5)
        l1=Label(self.frame_content, text = ': Save only captured IVs',font=self.myfont, bg="white", justify=LEFT).grid(row = 2, column = 2, padx = 5, pady = 5)
        
        self.C2 = Checkbutton(self.frame_content, text = "--gpsd", \
                 onvalue = "--gpsd", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var2)
        self.C2.grid(row = 3, column = 0, padx = 5, pady = 5)
        self.t2=Text(self.frame_content,height=1,width = 20)
        self.t2.grid(row = 3, column = 1, padx = 5, pady = 5)
        l2=Label(self.frame_content, text = ': Use GPSd',font=self.myfont, bg="white", justify=LEFT).grid(row = 3, column = 2, padx = 5, pady = 5)
        
        self.C3 = Checkbutton(self.frame_content, text = "--write", \
                 onvalue = "--write", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row = 4, column = 0, padx = 5, pady = 5)
        self.t3=Text(self.frame_content,height=1,width = 20)
        self.t3.grid(row = 4, column = 1, padx = 5, pady = 5)
        l3=Label(self.frame_content, text = ': Dump file prefix',font=self.myfont, bg="white", justify=LEFT).grid(row = 4, column = 2, padx = 5, pady = 5)
        
        self.C4 = Checkbutton(self.frame_content, text = "-w", \
                 onvalue = "-w", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var4)
        self.C4.grid(row = 5, column = 0, padx = 5, pady = 5)
        self.t4=Text(self.frame_content,height=1,width = 20)
        self.t4.grid(row = 5, column = 1, padx = 5, pady = 5)
        l4=Label(self.frame_content, text = ': same as --write',font=self.myfont, bg="white", justify=LEFT).grid(row = 5, column = 2, padx = 5, pady = 5)
        
        self.C5 = Checkbutton(self.frame_content, text = "--beacons", \
                 onvalue = "--beacon", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var5)
        self.C5.grid(row = 6, column = 0, padx = 5, pady = 5)
        self.t5=Text(self.frame_content,height=1,width = 20)
        self.t5.grid(row = 6, column = 1, padx = 5, pady = 5)
        l5=Label(self.frame_content, text = ': Record all beacons in dump file',font=self.myfont, bg="white", justify=LEFT).grid(row = 6, column = 2, padx = 5, pady = 5)
        
        self.C6 = Checkbutton(self.frame_content, text = "--update", \
                 onvalue = "--update", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var6)
        self.C6.grid(row = 7, column = 0, padx = 5, pady = 5)
        self.t6=Text(self.frame_content,height=1,width = 20)
        self.t6.grid(row = 7, column = 1, padx = 5, pady = 5)
        l6=Label(self.frame_content, text = ': Display update delay in seconds',font=self.myfont, bg="white", justify=LEFT).grid(row = 7, column = 2, padx = 5, pady = 5)
        
        self.C7 = Checkbutton(self.frame_content, text = "--showack", \
                 onvalue = "--showack", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var7)
        self.C7.grid(row = 8, column = 0, padx = 5, pady = 5)
        self.t7=Text(self.frame_content,height=1,width = 20)
        self.t7.grid(row = 8, column = 1, padx = 5, pady = 5)
        l7=Label(self.frame_content, text = ': Prints ack/cts/rts statistics',font=self.myfont, bg="white", justify=LEFT).grid(row = 8, column = 2, padx = 5, pady = 5)
        
        self.C8 = Checkbutton(self.frame_content2, text = "-h", \
                 onvalue = "-h", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var8)
        self.C8.grid(row = 9, column = 0, padx = 5, pady = 5)
        self.t8=Text(self.frame_content2,height=1,width = 20)
        self.t8.grid(row = 9, column = 1, padx = 5, pady = 5)
        l8=Label(self.frame_content2, text = ': Hides known stations for --showack',font=self.myfont, bg="white", justify=LEFT).grid(row = 9, column = 2, padx = 5, pady = 5)
        
        self.C9 = Checkbutton(self.frame_content2, text = "-f", \
                 onvalue = "-f", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var9)
        self.C9.grid(row = 10, column = 0, padx = 5, pady = 5)
        self.t9=Text(self.frame_content2,height=1,width = 20)
        self.t9.grid(row = 10, column = 1, padx = 5, pady = 5)
        l9=Label(self.frame_content2, text = ': Time in ms between hopping channels',font=self.myfont, bg="white", justify=LEFT).grid(row = 10, column = 2, padx = 5, pady = 5)
        
        Label(self.frame_content2, text = 'Airodump-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        
        self.C10 = Checkbutton(self.frame_content2, text = "--berlin", \
                 onvalue = "--berlin", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var10)
        self.C10.grid(row = 11, column = 0, padx = 5, pady = 5)
        self.t10=Text(self.frame_content2,height=1,width = 20)
        self.t10.grid(row = 11, column = 1, padx = 5, pady = 5)
        l10=Label(self.frame_content2, text = ': Time before removing the AP/client',font=self.myfont, bg="white", justify=LEFT).grid(row = 11, column = 2, padx = 5, pady = 5)
        
        self.C11 = Checkbutton(self.frame_content2, text = "-r", \
                 onvalue = "-r", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var11)
        self.C11.grid(row = 12, column = 0, padx = 5, pady = 5)
        self.t11=Text(self.frame_content2,height=1,width = 20)
        self.t11.grid(row = 12, column = 1, padx = 5, pady = 5)
        l11=Label(self.frame_content2, text = ': Read packets from that file',font=self.myfont, bg="white", justify=LEFT).grid(row = 12, column = 2, padx = 5, pady = 5)
        
        self.C12 = Checkbutton(self.frame_content2, text = "-x", \
                 onvalue = "-x", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var12)
        self.C12.grid(row = 13, column = 0, padx = 5, pady = 5)
        self.t12=Text(self.frame_content2,height=1,width = 20)
        self.t12.grid(row = 13, column = 1, padx = 5, pady = 5)
        l12=Label(self.frame_content2, text = ': Active Scanning Simulation',font=self.myfont, bg="white", justify=LEFT).grid(row = 13, column = 2, padx = 5, pady = 5)
        
        self.C13 = Checkbutton(self.frame_content2, text = " --output-format", \
                 onvalue = "--output-format", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var13)
        self.C13.grid(row = 14, column = 0, padx = 5, pady = 5)
        self.t13=Text(self.frame_content2,height=1,width = 20)
        self.t13.grid(row = 14, column = 1, padx = 5, pady = 5)
        l13=Label(self.frame_content2, text = ': Output format. Possible values',font=self.myfont, bg="white", justify=LEFT).grid(row = 14, column = 2, padx = 5, pady = 5)
        
        self.C14 = Checkbutton(self.frame_content2, text = " --ignore-negative-one", \
                 onvalue = "--ignore-negative-one", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var14)
        self.C14.grid(row = 15, column = 0, padx = 5, pady = 5)
        self.t14=Text(self.frame_content2,height=1,width = 20)
        self.t14.grid(row = 15, column = 1, padx = 5, pady = 5)
        l14=Label(self.frame_content2, text = ': Removes the message that says fixed channel',font=self.myfont, bg="white").grid(row = 15, column = 2, padx = 5, pady = 5)
        
        
        Label(self.frame_content3, text = 'Airodump-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content3, text = 'Filter Options :',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 16, column = 1)
        
        self.C15 = Checkbutton(self.frame_content3, text = "--encrypt", \
                 onvalue = "--encrypt", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var15)
        self.C15.grid(row = 17, column = 0, padx = 5, pady = 5)
        self.t15=Text(self.frame_content3,height=1,width = 20)
        self.t15.grid(row = 17, column = 1, padx = 5, pady = 5)
        l15=Label(self.frame_content3, text = ': Filter APs by cipher suite',font=self.myfont, bg="white", justify=LEFT).grid(row = 17, column = 2, padx = 5, pady = 5)
        
        self.C16 = Checkbutton(self.frame_content3, text = "--netmask", \
                 onvalue = "--netmask", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var16)
        self.C16.grid(row = 18, column = 0, padx = 5, pady = 5)
        self.t16=Text(self.frame_content3,height=1,width = 20)
        self.t16.grid(row = 18, column = 1, padx = 5, pady = 5)
        l16=Label(self.frame_content3, text = ': Filter APs by mask',font=self.myfont, bg="white", justify=LEFT).grid(row = 18, column = 2, padx = 5, pady = 5)
        
        self.C17 = Checkbutton(self.frame_content3, text = "--bssid", \
                 onvalue = "--bssid", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var17)
        self.C17.grid(row = 19, column = 0, padx = 5, pady = 5)
        self.t17=Text(self.frame_content3,height=1,width = 20)
        self.t17.grid(row = 19, column = 1, padx = 5, pady = 5)
        l17=Label(self.frame_content3, text = ': Filter APs by BSSID',font=self.myfont, bg="white", justify=LEFT).grid(row = 19, column = 2, padx = 5, pady = 5)
        
        self.C18 = Checkbutton(self.frame_content3, text = "--essid", \
                 onvalue = "--essid", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var18)
        self.C18.grid(row = 20, column = 0, padx = 5, pady = 5)
        self.t18=Text(self.frame_content3,height=1,width = 20)
        self.t18.grid(row = 20, column = 1, padx = 5, pady = 5)
        l18=Label(self.frame_content3, text = ': Filter APs by ESSID',font=self.myfont, bg="white", justify=LEFT).grid(row = 20, column = 2, padx = 5, pady = 5)
        
        self.C19 = Checkbutton(self.frame_content3, text = "--essid-regex", \
                 onvalue = "--essid-regex", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var19)
        self.C19.grid(row = 21, column = 0, padx = 5, pady = 5)
        self.t19=Text(self.frame_content3,height=1,width = 20)
        self.t19.grid(row = 21, column = 1, padx = 5, pady = 5)
        l19=Label(self.frame_content3, text = ': Filter APs by ESSID using \n  a regular expression',font=self.myfont, bg="white", justify=LEFT).grid(row = 21, column = 2, padx = 5, pady = 5)
        
        self.C20 = Checkbutton(self.frame_content3, text = "-a", \
                 onvalue = "-a", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var20)
        self.C20.grid(row = 22, column = 0, padx = 5, pady = 5)
        self.t20=Text(self.frame_content3,height=1,width = 20)
        self.t20.grid(row = 22, column = 1, padx = 5, pady = 5)
        l20=Label(self.frame_content3, text = ': Filter unassociated clients',font=self.myfont, bg="white", justify=LEFT).grid(row = 22, column = 2, padx = 5, pady = 5)
        
        Label(self.frame_content4, text = 'Airodump-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        
        self.C21 = Checkbutton(self.frame_content4, text = "--channel", \
                 onvalue = "--channel", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var21)
        self.C21.grid(row = 23, column = 0, padx = 5, pady = 5)
        self.t21=Text(self.frame_content4,height=1,width = 20)
        self.t21.grid(row = 23, column = 1, padx = 5, pady = 5)
        l21=Label(self.frame_content4, text = ': Capture on specific channels',font=self.myfont, bg="white", justify=LEFT).grid(row = 23, column = 2, padx = 5, pady = 5)
        
        self.C22 = Checkbutton(self.frame_content4, text = "--band", \
                 onvalue = "--band", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var22)
        self.C22.grid(row = 24, column = 0, padx = 5, pady = 5)
        self.t22=Text(self.frame_content4,height=1,width = 20)
        self.t22.grid(row = 24, column = 1, padx = 5, pady = 5)
        l22=Label(self.frame_content4, text = ':  Band on which airodump-ng should hop',font=self.myfont, bg="white", justify=LEFT).grid(row = 24, column = 2, padx = 5, pady = 5)
        
        self.C23 = Checkbutton(self.frame_content4, text = "-C", \
                 onvalue = "-C", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var23)
        self.C23.grid(row = 25, column = 0, padx = 5, pady = 5)
        self.t23=Text(self.frame_content4,height=1,width = 20)
        self.t23.grid(row = 25, column = 1, padx = 5, pady = 5)
        l23=Label(self.frame_content4, text = ':  Uses these frequencies in MHz to hop',font=self.myfont, bg="white", justify=LEFT).grid(row = 25, column = 2, padx = 5, pady = 5)
        
        self.C24 = Checkbutton(self.frame_content4, text = "-s", \
                 onvalue = "-s", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var24)
        self.C24.grid(row = 26, column = 0, padx = 5, pady = 5)
        self.t24=Text(self.frame_content4,height=1,width = 20)
        self.t24.grid(row = 26, column = 1, padx = 5, pady = 5)
        l24=Label(self.frame_content4, text = ':  same as --cswitch',font=self.myfont, bg="white", justify=LEFT).grid(row = 26, column = 2, padx = 5, pady = 5)
        
        self.C25 = Checkbutton(self.frame_content3, text = "--cswitch", \
                 onvalue = "--cswitch", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var25)
        self.C25.grid(row = 27, column = 0, padx = 5, pady = 5)
        self.t25=Text(self.frame_content3,height=1,width = 20)
        self.t25.grid(row = 27, column = 1, padx = 5, pady = 5)
        l25=Label(self.frame_content3, text = ':  Set channel switching method',font=self.myfont, bg="white", justify=LEFT).grid(row = 27, column = 2, padx = 5, pady = 5)
        
        self.C26 = Checkbutton(self.frame_content4, text = "--help", \
                 onvalue = "--help", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var26)
        self.C26.grid(row = 28, column = 0, padx = 5, pady = 5)
        self.t26=Text(self.frame_content4,height=1,width = 20)
        self.t26.grid(row = 28, column = 1, padx = 5, pady = 5)
        l26=Label(self.frame_content4, text = ':  Displays this usage screen',font=self.myfont, bg="white", justify=LEFT).grid(row = 28, column = 2, padx = 5, pady = 5)
예제 #27
0
    def __init__(self, master):
        
	self.fname="" 
        #global variables
        self.t1=StringVar()
        self.t2=StringVar()
        self.t3=StringVar()
        self.t4=StringVar()
        self.t5=StringVar()
        self.t6=StringVar()
        self.t7=StringVar()
        self.t8=StringVar()
        self.t9=StringVar()
        self.t10=StringVar()
        self.t11=StringVar()
        self.t12=StringVar()
        self.t13=StringVar()
        self.t14=StringVar()
        self.t15=StringVar()
        self.t16=StringVar()
        self.t17=StringVar()
        self.t18=StringVar()
        self.t19=StringVar()
        self.t20=StringVar()
        self.t21=StringVar()
        self.t22=StringVar()
        self.t23=StringVar()
        self.t24=StringVar()
        self.t25=StringVar()
        self.t26=StringVar()
        self.t27=StringVar()
        
        self.var1=StringVar()
        self.var2=StringVar()
        self.var3=StringVar()
        self.var4=StringVar()
        self.var5=StringVar()
        self.var6=StringVar()
        self.var7=StringVar()
        self.var8=StringVar()
        self.var9=StringVar()
        self.var10=StringVar()
        self.var11=StringVar()
        self.var12=StringVar()
        self.var13=StringVar()
        self.var14=StringVar()
        self.var15=StringVar()
        self.var16=StringVar()
        self.var17=StringVar()
        self.var18=StringVar()
        self.var19=StringVar()
        self.var20=StringVar()
        self.var21=StringVar()
        self.var22=StringVar()
        self.var23=StringVar()
        self.var24=StringVar()
        self.var25=StringVar()
        self.var26=StringVar()
        self.var27=StringVar()
        #end
        
        mymaster = Frame(master, name='mymaster') # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window    
        #master.minsize(width=900, height=900)
        #master.maxsize(width=650, height=500)
        #end
        
        #title of window
        master.title("Aireplay-ng")
        #end
        
        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont=tkFont.Font(family="Helvetica", size=15,underline = True)
        self.myfontnew=tkFont.Font(family="Helvetica", size=11,underline = True)
        #end
        
        
       
        nb = Notebook(mymaster, name='nb') # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3) # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1") # add tab to Notebook
    
        # repeat for each tab
        self.frame_content2 = Frame(nb, name='frame_content2', bg="white")
        nb.add(self.frame_content2, text="Filter-2")
        self.frame_content3 = Frame(nb, name='frame_content3', bg="white")
        nb.add(self.frame_content3, text="Filter-3")
        
        self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")
        
        #End
        
	#frame content 7
	Label(self.frame_content7, text = 'Aireplay-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        btndetect=Button(self.frame_content7, text = 'Detect', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 1, column = 0, padx = 5, pady = 5)
		
	btndbrowse=Button(self.frame_content7, text = 'Attach File', command =self.browse_file, height=2, width=15, font=self.customFont).grid(row = 3, column = 0, padx = 5, pady = 5)	
	self.lilnew1=Listbox(self.frame_content7,bg="black", fg="white", font=self.myfont, selectmode=SINGLE, width=30, height=15)
        self.lilnew1.grid(row = 1, column = 1, rowspan=3)
	#End
	
        Label(self.frame_content, text = 'Aireplay-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content, text = 'Filter Options :',font=self.myfontnew, bg="white").grid(row = 1, column = 1)
        
        Label(self.frame_content5, text = 'Edit Command From Here',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 0, column = 0)
        TextCommandBox=Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output=Text(self.frame_content5,bg="black", fg="white", font=self.myfont, height=20, width=42)
        self.output.grid(row = 0, column = 1, padx=50, pady=5, rowspan=3)
        btnsubmit=Button(self.frame_content5, width=15, height=2, text="Get Result", command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear=Button(self.frame_content5, width=15, height=2, text="Clear Output", command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-b", \
                 onvalue = "-b", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var1)
        self.C1.grid(row = 2, column = 0, padx = 5, pady = 5)
        self.t1=Text(self.frame_content,height=1,width = 20)
        self.t1.grid(row = 2, column = 1, padx = 5, pady = 5)
        l1=Label(self.frame_content, text = ': MAC address, Access Point',font=self.myfont, bg="white", justify=LEFT).grid(row = 2, column = 2, padx = 5, pady = 5)
        
        self.C2 = Checkbutton(self.frame_content, text = "-d", \
                 onvalue = "-d", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var2)
        self.C2.grid(row = 3, column = 0, padx = 5, pady = 5)
        self.t2=Text(self.frame_content,height=1,width = 20)
        self.t2.grid(row = 3, column = 1, padx = 5, pady = 5)
        l2=Label(self.frame_content, text = ': MAC address, Destination',font=self.myfont, bg="white", justify=LEFT).grid(row = 3, column = 2, padx = 5, pady = 5)
        
        self.C3 = Checkbutton(self.frame_content, text = "-s", \
                 onvalue = "-s", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row = 4, column = 0, padx = 5, pady = 5)
        self.t3=Text(self.frame_content,height=1,width = 20)
        self.t3.grid(row = 4, column = 1, padx = 5, pady = 5)
        l3=Label(self.frame_content, text = ': MAC address, Source',font=self.myfont, bg="white", justify=LEFT).grid(row = 4, column = 2, padx = 5, pady = 5)
        
        self.C4 = Checkbutton(self.frame_content, text = "-m", \
                 onvalue = "-m", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var4)
        self.C4.grid(row = 5, column = 0, padx = 5, pady = 5)
        self.t4=Text(self.frame_content,height=1,width = 20)
        self.t4.grid(row = 5, column = 1, padx = 5, pady = 5)
        l4=Label(self.frame_content, text = ': minimum packet length',font=self.myfont, bg="white", justify=LEFT).grid(row = 5, column = 2, padx = 5, pady = 5)
        
        self.C5 = Checkbutton(self.frame_content, text = "-n", \
                 onvalue = "-n", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var5)
        self.C5.grid(row = 6, column = 0, padx = 5, pady = 5)
        self.t5=Text(self.frame_content,height=1,width = 20)
        self.t5.grid(row = 6, column = 1, padx = 5, pady = 5)
        l5=Label(self.frame_content, text = ': maximum packet length',font=self.myfont, bg="white", justify=LEFT).grid(row = 6, column = 2, padx = 5, pady = 5)
        
        self.C6 = Checkbutton(self.frame_content, text = "-u", \
                 onvalue = "-u", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var6)
        self.C6.grid(row = 7, column = 0, padx = 5, pady = 5)
        self.t6=Text(self.frame_content,height=1,width = 20)
        self.t6.grid(row = 7, column = 1, padx = 5, pady = 5)
        l6=Label(self.frame_content, text = ': frame control, type field',font=self.myfont, bg="white", justify=LEFT).grid(row = 7, column = 2, padx = 5, pady = 5)
        
        self.C7 = Checkbutton(self.frame_content, text = "-v", \
                 onvalue = "-v", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var7)
        self.C7.grid(row = 8, column = 0, padx = 5, pady = 5)
        self.t7=Text(self.frame_content,height=1,width = 20)
        self.t7.grid(row = 8, column = 1, padx = 5, pady = 5)
        l7=Label(self.frame_content, text = ': frame control, subtype field',font=self.myfont, bg="white", justify=LEFT).grid(row = 8, column = 2, padx = 5, pady = 5)
        
        self.C8 = Checkbutton(self.frame_content, text = "-t", \
                 onvalue = "-t", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var8)
        self.C8.grid(row = 9, column = 0, padx = 5, pady = 5)
        self.t8=Text(self.frame_content,height=1,width = 20)
        self.t8.grid(row = 9, column = 1, padx = 5, pady = 5)
        l8=Label(self.frame_content, text = ':  frame control, To DS bit',font=self.myfont, bg="white", justify=LEFT).grid(row = 9, column = 2, padx = 5, pady = 5)
        
        self.C9 = Checkbutton(self.frame_content, text = "-r", \
                 onvalue = "-r", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var9)
        self.C9.grid(row = 10, column = 0, padx = 5, pady = 5)
        self.t9=Text(self.frame_content,height=1,width = 20)
        self.t9.grid(row = 10, column = 1, padx = 5, pady = 5)
        l9=Label(self.frame_content, text = ': frame control, From DS bit',font=self.myfont, bg="white", justify=LEFT).grid(row = 10, column = 2, padx = 5, pady = 5)
        
        self.C10 = Checkbutton(self.frame_content, text = "-w", \
                 onvalue = "-w", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var10)
        self.C10.grid(row = 11, column = 0, padx = 5, pady = 5)
        self.t10=Text(self.frame_content,height=1,width = 20)
        self.t10.grid(row = 11, column = 1, padx = 5, pady = 5)
        l10=Label(self.frame_content, text = ': frame control, WEP bit',font=self.myfont, bg="white", justify=LEFT).grid(row = 11, column = 2, padx = 5, pady = 5)
        
        Label(self.frame_content2, text = 'Aireplay-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        
        #frame content 2
        self.C11 = Checkbutton(self.frame_content2, text = "-x", \
                 onvalue = "-x", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var11)
        self.C11.grid(row = 12, column = 0, padx = 5, pady = 5)
        self.t11=Text(self.frame_content2,height=1,width = 20)
        self.t11.grid(row = 12, column = 1, padx = 5, pady = 5)
        l11=Label(self.frame_content2, text = ': number of packets per second',font=self.myfont, bg="white", justify=LEFT).grid(row = 12, column = 2, padx = 5, pady = 5)
        
        self.C12 = Checkbutton(self.frame_content2, text = "-p", \
                 onvalue = "-p", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var12)
        self.C12.grid(row = 13, column = 0, padx = 5, pady = 5)
        self.t12=Text(self.frame_content2,height=1,width = 20)
        self.t12.grid(row = 13, column = 1, padx = 5, pady = 5)
        l12=Label(self.frame_content2, text = ': set frame control word (hex)',font=self.myfont, bg="white", justify=LEFT).grid(row = 13, column = 2, padx = 5, pady = 5)
        
        self.C13 = Checkbutton(self.frame_content2, text = "-a", \
                 onvalue = "-a", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var13)
        self.C13.grid(row = 14, column = 0, padx = 5, pady = 5)
        self.t13=Text(self.frame_content2,height=1,width = 20)
        self.t13.grid(row = 14, column = 1, padx = 5, pady = 5)
        l13=Label(self.frame_content2, text = ': set Access Point MAC address',font=self.myfont, bg="white", justify=LEFT).grid(row = 14, column = 2, padx = 5, pady = 5)
        
        self.C14 = Checkbutton(self.frame_content2, text = "-c", \
                 onvalue = "-c", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var14)
        self.C14.grid(row = 15, column = 0, padx = 5, pady = 5)
        self.t14=Text(self.frame_content2,height=1,width = 20)
        self.t14.grid(row = 15, column = 1, padx = 5, pady = 5)
        l14=Label(self.frame_content2, text = ':  set Destination MAC address',font=self.myfont, bg="white", justify=LEFT).grid(row = 15, column = 2, padx = 5, pady = 5)
        
        self.C15 = Checkbutton(self.frame_content2, text = "-h", \
                 onvalue = "-h", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var15)
        self.C15.grid(row = 16, column = 0, padx = 5, pady = 5)
        self.t15=Text(self.frame_content2,height=1,width = 20)
        self.t15.grid(row = 16, column = 1, padx = 5, pady = 5)
        l15=Label(self.frame_content2, text = ': set Source MAC address',font=self.myfont, bg="white").grid(row = 16, column = 2, padx = 5, pady = 5)
        
        self.C16 = Checkbutton(self.frame_content2, text = "-e", \
                 onvalue = "-e", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var16)
        self.C16.grid(row = 17, column = 0, padx = 5, pady = 5)
        self.t16=Text(self.frame_content2,height=1,width = 20)
        self.t16.grid(row = 17, column = 1, padx = 5, pady = 5)
        l16=Label(self.frame_content2, text = ':  For fakeauth attack or injection test,',font=self.myfont, bg="white").grid(row = 17, column = 2, padx = 5, pady = 5)
        
        self.C17 = Checkbutton(self.frame_content2, text = "-j", \
                 onvalue = "-j", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var17)
        self.C17.grid(row = 18, column = 0, padx = 5, pady = 5)
        self.t17=Text(self.frame_content2,height=1,width = 20)
        self.t17.grid(row = 18, column = 1, padx = 5, pady = 5)
        l17=Label(self.frame_content2, text = ': arpreplay attack : inject FromDS pkts',font=self.myfont, bg="white").grid(row = 18, column = 2, padx = 5, pady = 5)
        
        self.C18 = Checkbutton(self.frame_content2, text = "-g", \
                 onvalue = "-g", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var18)
        self.C18.grid(row = 19, column = 0, padx = 5, pady = 5)
        self.t18=Text(self.frame_content2,height=1,width = 20)
        self.t18.grid(row = 19, column = 1, padx = 5, pady = 5)
        l18=Label(self.frame_content2, text = ': change ring buffer size (default: 8)',font=self.myfont, bg="white").grid(row = 19, column = 2, padx = 5, pady = 5)
        
        self.C19 = Checkbutton(self.frame_content2, text = "-k", \
                 onvalue = "-k", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var19)
        self.C19.grid(row = 20, column = 0, padx = 5, pady = 5)
        self.t19=Text(self.frame_content2,height=1,width = 20)
        self.t19.grid(row = 20, column = 1, padx = 5, pady = 5)
        l19=Label(self.frame_content2, text = ': set destination IP in fragments',font=self.myfont, bg="white").grid(row = 20, column = 2, padx = 5, pady = 5)
        
        self.C20 = Checkbutton(self.frame_content2, text = "-I", \
                 onvalue = "-I", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var20)
        self.C20.grid(row = 21, column = 0, padx = 5, pady = 5)
        self.t20=Text(self.frame_content2,height=1,width = 20)
        self.t20.grid(row = 21, column = 1, padx = 5, pady = 5)
        l20=Label(self.frame_content2, text = ': set source IP in fragments',font=self.myfont, bg="white").grid(row = 21, column = 2, padx = 5, pady = 5)
        #frame content 3
        Label(self.frame_content3, text = 'Aireplay-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        
        
        self.C21 = Checkbutton(self.frame_content3, text = "-o", \
                 onvalue = "-o", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var21)
        self.C21.grid(row = 22, column = 0, padx = 5, pady = 5)
        self.t21=Text(self.frame_content3,height=1,width = 20)
        self.t21.grid(row = 22, column = 1, padx = 5, pady = 5)
        l21=Label(self.frame_content3, text = ': number of packets per burst (-1)',font=self.myfont, bg="white", justify=LEFT).grid(row = 22, column = 2, padx = 5, pady = 5)
        
        self.C22 = Checkbutton(self.frame_content3, text = "-q", \
                 onvalue = "-q", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var22)
        self.C22.grid(row = 24, column = 0, padx = 5, pady = 5)
        self.t22=Text(self.frame_content3,height=1,width = 20)
        self.t22.grid(row = 24, column = 1, padx = 5, pady = 5)
        l22=Label(self.frame_content3, text = ': seconds between keep-alives (-1)',font=self.myfont, bg="white", justify=LEFT).grid(row = 24, column = 2, padx = 5, pady = 5)
        
        self.C23 = Checkbutton(self.frame_content3, text = "-y", \
                 onvalue = "-y", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var23)
        self.C23.grid(row = 25, column = 0, padx = 5, pady = 5)
        self.t23=Text(self.frame_content3,height=1,width = 20)
        self.t23.grid(row = 25, column = 1, padx = 5, pady = 5)
        l23=Label(self.frame_content3, text = ':  keystream for shared key auth',font=self.myfont, bg="white", justify=LEFT).grid(row = 25, column = 2, padx = 5, pady = 5)
    
        
        self.C24 = Checkbutton(self.frame_content3, text = "-B", \
                 onvalue = "-B", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var24)
        self.C24.grid(row = 26, column = 0, padx = 5, pady = 5)
        self.t24=Text(self.frame_content3,height=1,width = 20)
        self.t24.grid(row = 26, column = 1, padx = 5, pady = 5)
        l14=Label(self.frame_content3, text = ': bit rate test (Applies only to test mode)',font=self.myfont, bg="white", justify=LEFT).grid(row = 26, column = 2, padx = 5, pady = 5)
        
        self.C25 = Checkbutton(self.frame_content3, text = "-D", \
                 onvalue = "-D", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var25)
        self.C25.grid(row = 27, column = 0, padx = 5, pady = 5)
        self.t25=Text(self.frame_content3,height=1,width = 20)
        self.t25.grid(row = 27, column = 1, padx = 5, pady = 5)
        l25=Label(self.frame_content3, text = ': disables AP detection.',font=self.myfont, bg="white", justify=LEFT).grid(row = 27, column = 2, padx = 5, pady = 5)
        
        self.C26 = Checkbutton(self.frame_content3, text = "-F", \
                 onvalue = "-F", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var26)
        self.C26.grid(row = 28, column = 0, padx = 5, pady = 5)
        self.t26=Text(self.frame_content3,height=1,width = 20)
        self.t26.grid(row = 28, column = 1, padx = 5, pady = 5)
        l26=Label(self.frame_content3, text = ': chooses first matching packet.',font=self.myfont, bg="white", justify=LEFT).grid(row = 28, column = 2, padx = 5, pady = 5)
        
        self.C27 = Checkbutton(self.frame_content3, text = "-R", \
                 onvalue = "-R", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var27)
        self.C27.grid(row = 29, column = 0, padx = 5, pady = 5)
        self.t27=Text(self.frame_content3,height=1,width = 20)
        self.t27.grid(row = 29, column = 1, padx = 5, pady = 5)
        l27=Label(self.frame_content3, text = ': disables /dev/rtc usage.',font=self.myfont, bg="white", justify=LEFT).grid(row = 29, column = 2, padx = 5, pady = 5)
예제 #28
0
    def build_credits(self):

        if getattr(self, "home", False): self.home.pack_forget()
        if getattr(self, "license", False): self.license.pack_forget()

        self.credits = Frame(self.parent)
        self.credits.pack(expand=True, fill=BOTH)

        Label(self.credits, text="Credits", **self.style_text).pack(side=TOP, expand=True, fill=X)

        style = Style()
        style.configure("BW.TNotebook", background=self.parent.cget("bg"), borderwidth=1, relief=SUNKEN, highlightthickness=1)


        notebook = Notebook(self.credits, style="BW.TNotebook")

        write = ("Jean-Pierre Mandon",
                 "Régis Blanchot",
                 "Marcus Fazzi",
                 "Jesus Carmona Esteban",
                 "Alfred Broda",
                 "Yeison Cardona",
                 "Henk Van Beek",
                 "Björn Pfeiffer",
                 "Alexis Sánchez",
                 )

        label_write = Label(self.credits, text="\n\n".join(write))
        label_write.pack(side=TOP, expand=True, fill=BOTH)
        notebook.add(label_write, text="Write by")

        doc = ("Benoit Espinola",
               "Sebastien Koechlin",
               "Ivan Ricondo",
               "Jesus Carmona Esteban",
               "Marcus Fazzi",
               "Régis Blanchot",
               )

        label_doc = Label(self.credits, text="\n\n".join(doc))
        label_doc.pack(side=TOP, expand=True, fill=BOTH)
        notebook.add(label_doc, text="Documented by")

        trans = ("Joan Espinoza",
                 "Alexis Sánchez",
                 "Régis Blanchot",
                 "Moreno Manzini",
                 "Yeison Cardona",
                 "\"Avrin\"",
                )

        label_trans = Label(self.credits, text="\n\n".join(trans))
        label_trans.pack(side=TOP, expand=True, fill=BOTH)
        notebook.add(label_trans, text="Translated by")

        art = ("France Cadet",
               "Laurent Cos--tes",
               "Daniel Rodri­guez",
               )

        label_art = Label(self.credits, text="\n\n".join(art))
        label_art.pack(side=TOP, expand=True, fill=BOTH)
        notebook.add(label_art, text="Art by")

        notebook.pack(side=TOP, fill=BOTH, expand=True)

        self.panel_buttons = Frame(self.credits)
        self.panel_buttons.pack(side=BOTTOM, fill=BOTH, expand=True)

        Button(self.panel_buttons, text="Close", command=self.quit).pack(side=RIGHT, fill=X, expand=True)
        Button(self.panel_buttons, text="License", command=self.build_license).pack(side=LEFT, fill=X, expand=True)
예제 #29
0
    def __init__(self, master):

        self.fname = ""
        #global variables
        self.t1 = StringVar()
        self.t2 = StringVar()
        self.t3 = StringVar()
        self.t4 = StringVar()
        self.t5 = StringVar()
        self.t6 = StringVar()
        self.t7 = StringVar()
        self.t8 = StringVar()
        self.t9 = StringVar()
        self.t10 = StringVar()
        self.t11 = StringVar()
        self.t12 = StringVar()
        self.t13 = StringVar()
        self.t14 = StringVar()
        self.t15 = StringVar()
        self.t16 = StringVar()
        self.t17 = StringVar()
        self.t18 = StringVar()
        self.t19 = StringVar()
        self.t20 = StringVar()
        self.t21 = StringVar()
        self.t22 = StringVar()
        self.t23 = StringVar()
        self.t24 = StringVar()
        self.t25 = StringVar()
        self.t26 = StringVar()
        self.t27 = StringVar()

        self.var1 = StringVar()
        self.var2 = StringVar()
        self.var3 = StringVar()
        self.var4 = StringVar()
        self.var5 = StringVar()
        self.var6 = StringVar()
        self.var7 = StringVar()
        self.var8 = StringVar()
        self.var9 = StringVar()
        self.var10 = StringVar()
        self.var11 = StringVar()
        self.var12 = StringVar()
        self.var13 = StringVar()
        self.var14 = StringVar()
        self.var15 = StringVar()
        self.var16 = StringVar()
        self.var17 = StringVar()
        self.var18 = StringVar()
        self.var19 = StringVar()
        self.var20 = StringVar()
        self.var21 = StringVar()
        self.var22 = StringVar()
        self.var23 = StringVar()
        self.var24 = StringVar()
        self.var25 = StringVar()
        self.var26 = StringVar()
        self.var27 = StringVar()
        #end

        mymaster = Frame(master, name='mymaster')  # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window
        #master.minsize(width=900, height=900)
        #master.maxsize(width=650, height=500)
        #end

        #title of window
        master.title("Aireplay-ng")
        #end

        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont = tkFont.Font(family="Helvetica",
                                      size=15,
                                      underline=True)
        self.myfontnew = tkFont.Font(family="Helvetica",
                                     size=11,
                                     underline=True)
        #end

        nb = Notebook(mymaster, name='nb')  # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3)  # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,
                                   name="frame_content",
                                   bg="lightsteelblue")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1")  # add tab to Notebook

        # repeat for each tab
        self.frame_content2 = Frame(nb,
                                    name='frame_content2',
                                    bg="lightsteelblue")
        nb.add(self.frame_content2, text="Filter-2")
        self.frame_content3 = Frame(nb,
                                    name='frame_content3',
                                    bg="lightsteelblue")
        nb.add(self.frame_content3, text="Filter-3")

        self.frame_content7 = Frame(nb,
                                    name='frame_content7',
                                    bg="lightsteelblue")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb,
                                    name='frame_content5',
                                    bg="lightsteelblue")
        nb.add(self.frame_content5, text="output")

        #End

        #frame content 7
        Label(self.frame_content7,
              text='Aireplay-ng',
              font=self.headerfont,
              bg="midnightblue",
              fg="firebrick",
              padx=10,
              pady=10).grid(row=0, column=0)
        btndetect = Button(self.frame_content7,
                           text='Detect',
                           fg="cornflowerblue",
                           command=self.canvas_detect,
                           height=2,
                           width=15,
                           font=self.customFont).grid(row=1,
                                                      column=0,
                                                      padx=5,
                                                      pady=5)

        btndbrowse = Button(self.frame_content7,
                            text='Attach File',
                            fg="cornflowerblue",
                            command=self.browse_file,
                            height=2,
                            width=15,
                            font=self.customFont).grid(row=3,
                                                       column=0,
                                                       padx=5,
                                                       pady=5)
        self.lilnew1 = Listbox(self.frame_content7,
                               bg="black",
                               fg="firebrick",
                               font=self.myfont,
                               selectmode=SINGLE,
                               width=30,
                               height=15)
        self.lilnew1.grid(row=1, column=1, rowspan=3)
        #End

        Label(self.frame_content,
              text='Aireplay-ng',
              font=self.headerfont,
              bg="midnightblue",
              fg="firebrick",
              padx=10,
              pady=10).grid(row=0, column=0)
        Label(self.frame_content,
              text='Filter Options :',
              font=self.myfontnew,
              bg="midnightblue",
              fg="deepskyblue").grid(row=1, column=1)

        Label(self.frame_content5,
              text='Edit Command From Here',
              font=self.myfontnew,
              bg="midnightblue",
              fg="deepskyblue",
              justify=LEFT).grid(row=0, column=0)
        TextCommandBox = Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output = Text(self.frame_content5,
                           bg="black",
                           fg="firebrick",
                           font=self.myfont,
                           height=20,
                           width=42)
        self.output.grid(row=0, column=1, padx=50, pady=5, rowspan=3)
        btnsubmit = Button(self.frame_content5,
                           width=15,
                           height=2,
                           text="Get Result",
                           fg="cornflowerblue",
                           command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear = Button(self.frame_content5,
                          width=15,
                          height=2,
                          text="Clear Output",
                          fg="cornflowerblue",
                          command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-b", fg="deepskyblue", \
                 onvalue = "-b", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var1)
        self.C1.grid(row=2, column=0, padx=5, pady=5)
        self.t1 = Text(self.frame_content, height=1, width=20)
        self.t1.grid(row=2, column=1, padx=5, pady=5)
        l1 = Label(self.frame_content,
                   text=': MAC address, Access Point',
                   font=self.myfont,
                   bg="midnightblue",
                   fg="deepskyblue",
                   justify=LEFT).grid(row=2, column=2, padx=5, pady=5)

        self.C2 = Checkbutton(self.frame_content, text = "-d", fg="deepskyblue", \
                 onvalue = "-d", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var2)
        self.C2.grid(row=3, column=0, padx=5, pady=5)
        self.t2 = Text(self.frame_content, height=1, width=20)
        self.t2.grid(row=3, column=1, padx=5, pady=5)
        l2 = Label(self.frame_content,
                   text=': MAC address, Destination',
                   font=self.myfont,
                   bg="midnightblue",
                   fg="deepskyblue",
                   justify=LEFT).grid(row=3, column=2, padx=5, pady=5)

        self.C3 = Checkbutton(self.frame_content, text = "-s", fg="deepskyblue", \
                 onvalue = "-s", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var3)
        self.C3.grid(row=4, column=0, padx=5, pady=5)
        self.t3 = Text(self.frame_content, height=1, width=20)
        self.t3.grid(row=4, column=1, padx=5, pady=5)
        l3 = Label(self.frame_content,
                   text=': MAC address, Source',
                   font=self.myfont,
                   bg="midnightblue",
                   fg="deepskyblue",
                   justify=LEFT).grid(row=4, column=2, padx=5, pady=5)

        self.C4 = Checkbutton(self.frame_content, text = "-m", fg="deepskyblue", \
                 onvalue = "-m", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var4)
        self.C4.grid(row=5, column=0, padx=5, pady=5)
        self.t4 = Text(self.frame_content, height=1, width=20)
        self.t4.grid(row=5, column=1, padx=5, pady=5)
        l4 = Label(self.frame_content,
                   text=': minimum packet length',
                   font=self.myfont,
                   bg="midnightblue",
                   fg="deepskyblue",
                   justify=LEFT).grid(row=5, column=2, padx=5, pady=5)

        self.C5 = Checkbutton(self.frame_content, text = "-n", fg="deepskyblue", \
                 onvalue = "-n", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var5)
        self.C5.grid(row=6, column=0, padx=5, pady=5)
        self.t5 = Text(self.frame_content, height=1, width=20)
        self.t5.grid(row=6, column=1, padx=5, pady=5)
        l5 = Label(self.frame_content,
                   text=': maximum packet length',
                   font=self.myfont,
                   bg="midnightblue",
                   fg="deepskyblue",
                   justify=LEFT).grid(row=6, column=2, padx=5, pady=5)

        self.C6 = Checkbutton(self.frame_content, text = "-u", fg="deepskyblue", \
                 onvalue = "-u", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var6)
        self.C6.grid(row=7, column=0, padx=5, pady=5)
        self.t6 = Text(self.frame_content, height=1, width=20)
        self.t6.grid(row=7, column=1, padx=5, pady=5)
        l6 = Label(self.frame_content,
                   text=': frame control, type field',
                   font=self.myfont,
                   bg="midnightblue",
                   fg="deepskyblue",
                   justify=LEFT).grid(row=7, column=2, padx=5, pady=5)

        self.C7 = Checkbutton(self.frame_content, text = "-v", fg="deepskyblue", \
                 onvalue = "-v", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var7)
        self.C7.grid(row=8, column=0, padx=5, pady=5)
        self.t7 = Text(self.frame_content, height=1, width=20)
        self.t7.grid(row=8, column=1, padx=5, pady=5)
        l7 = Label(self.frame_content,
                   text=': frame control, subtype field',
                   font=self.myfont,
                   bg="midnightblue",
                   fg="deepskyblue",
                   justify=LEFT).grid(row=8, column=2, padx=5, pady=5)

        self.C8 = Checkbutton(self.frame_content, text = "-t", fg="deepskyblue", \
                 onvalue = "-t", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var8)
        self.C8.grid(row=9, column=0, padx=5, pady=5)
        self.t8 = Text(self.frame_content, height=1, width=20)
        self.t8.grid(row=9, column=1, padx=5, pady=5)
        l8 = Label(self.frame_content,
                   text=':  frame control, To DS bit',
                   font=self.myfont,
                   bg="midnightblue",
                   fg="deepskyblue",
                   justify=LEFT).grid(row=9, column=2, padx=5, pady=5)

        self.C9 = Checkbutton(self.frame_content, text = "-r", fg="deepskyblue", \
                 onvalue = "-r", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var9)
        self.C9.grid(row=10, column=0, padx=5, pady=5)
        self.t9 = Text(self.frame_content, height=1, width=20)
        self.t9.grid(row=10, column=1, padx=5, pady=5)
        l9 = Label(self.frame_content,
                   text=': frame control, From DS bit',
                   font=self.myfont,
                   bg="midnightblue",
                   fg="deepskyblue",
                   justify=LEFT).grid(row=10, column=2, padx=5, pady=5)

        self.C10 = Checkbutton(self.frame_content, text = "-w", fg="deepskyblue", \
                 onvalue = "-w", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var10)
        self.C10.grid(row=11, column=0, padx=5, pady=5)
        self.t10 = Text(self.frame_content, height=1, width=20)
        self.t10.grid(row=11, column=1, padx=5, pady=5)
        l10 = Label(self.frame_content,
                    text=': frame control, WEP bit',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=11, column=2, padx=5, pady=5)

        Label(self.frame_content2,
              text='Aireplay-ng',
              font=self.headerfont,
              bg="midnightblue",
              fg="firebrick",
              padx=10,
              pady=10).grid(row=0, column=0)

        #frame content 2
        self.C11 = Checkbutton(self.frame_content2, text = "-x", fg="deepskyblue", \
                 onvalue = "-x", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var11)
        self.C11.grid(row=12, column=0, padx=5, pady=5)
        self.t11 = Text(self.frame_content2, height=1, width=20)
        self.t11.grid(row=12, column=1, padx=5, pady=5)
        l11 = Label(self.frame_content2,
                    text=': number of packets per second',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=12, column=2, padx=5, pady=5)

        self.C12 = Checkbutton(self.frame_content2, text = "-p", fg="deepskyblue", \
                 onvalue = "-p", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var12)
        self.C12.grid(row=13, column=0, padx=5, pady=5)
        self.t12 = Text(self.frame_content2, height=1, width=20)
        self.t12.grid(row=13, column=1, padx=5, pady=5)
        l12 = Label(self.frame_content2,
                    text=': set frame control word (hex)',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=13, column=2, padx=5, pady=5)

        self.C13 = Checkbutton(self.frame_content2, text = "-a", fg="deepskyblue", \
                 onvalue = "-a", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var13)
        self.C13.grid(row=14, column=0, padx=5, pady=5)
        self.t13 = Text(self.frame_content2, height=1, width=20)
        self.t13.grid(row=14, column=1, padx=5, pady=5)
        l13 = Label(self.frame_content2,
                    text=': set Access Point MAC address',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=14, column=2, padx=5, pady=5)

        self.C14 = Checkbutton(self.frame_content2, text = "-c", fg="deepskyblue", \
                 onvalue = "-c", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var14)
        self.C14.grid(row=15, column=0, padx=5, pady=5)
        self.t14 = Text(self.frame_content2, height=1, width=20)
        self.t14.grid(row=15, column=1, padx=5, pady=5)
        l14 = Label(self.frame_content2,
                    text=':  set Destination MAC address',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=15, column=2, padx=5, pady=5)

        self.C15 = Checkbutton(self.frame_content2, text = "-h", fg="deepskyblue", \
                 onvalue = "-h", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var15)
        self.C15.grid(row=16, column=0, padx=5, pady=5)
        self.t15 = Text(self.frame_content2, height=1, width=20)
        self.t15.grid(row=16, column=1, padx=5, pady=5)
        l15 = Label(self.frame_content2,
                    text=': set Source MAC address',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue").grid(row=16, column=2, padx=5, pady=5)

        self.C16 = Checkbutton(self.frame_content2, text = "-e", fg="deepskyblue", \
                 onvalue = "-e", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var16)
        self.C16.grid(row=17, column=0, padx=5, pady=5)
        self.t16 = Text(self.frame_content2, height=1, width=20)
        self.t16.grid(row=17, column=1, padx=5, pady=5)
        l16 = Label(self.frame_content2,
                    text=':  For fakeauth attack or injection test,',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue").grid(row=17, column=2, padx=5, pady=5)

        self.C17 = Checkbutton(self.frame_content2, text = "-j", fg="deepskyblue", \
                 onvalue = "-j", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var17)
        self.C17.grid(row=18, column=0, padx=5, pady=5)
        self.t17 = Text(self.frame_content2, height=1, width=20)
        self.t17.grid(row=18, column=1, padx=5, pady=5)
        l17 = Label(self.frame_content2,
                    text=': arpreplay attack : inject FromDS pkts',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue").grid(row=18, column=2, padx=5, pady=5)

        self.C18 = Checkbutton(self.frame_content2, text = "-g", fg="deepskyblue", \
                 onvalue = "-g", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var18)
        self.C18.grid(row=19, column=0, padx=5, pady=5)
        self.t18 = Text(self.frame_content2, height=1, width=20)
        self.t18.grid(row=19, column=1, padx=5, pady=5)
        l18 = Label(self.frame_content2,
                    text=': change ring buffer size (default: 8)',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue").grid(row=19, column=2, padx=5, pady=5)

        self.C19 = Checkbutton(self.frame_content2, text = "-k", fg="deepskyblue", \
                 onvalue = "-k", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var19)
        self.C19.grid(row=20, column=0, padx=5, pady=5)
        self.t19 = Text(self.frame_content2, height=1, width=20)
        self.t19.grid(row=20, column=1, padx=5, pady=5)
        l19 = Label(self.frame_content2,
                    text=': set destination IP in fragments',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue").grid(row=20, column=2, padx=5, pady=5)

        self.C20 = Checkbutton(self.frame_content2, text = "-I", fg="deepskyblue", \
                 onvalue = "-I", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var20)
        self.C20.grid(row=21, column=0, padx=5, pady=5)
        self.t20 = Text(self.frame_content2, height=1, width=20)
        self.t20.grid(row=21, column=1, padx=5, pady=5)
        l20 = Label(self.frame_content2,
                    text=': set source IP in fragments',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue").grid(row=21, column=2, padx=5, pady=5)
        #frame content 3
        Label(self.frame_content3,
              text='Aireplay-ng',
              font=self.headerfont,
              bg="midnightblue",
              fg="firebrick",
              padx=10,
              pady=10).grid(row=0, column=0)


        self.C21 = Checkbutton(self.frame_content3, text = "-o", fg="deepskyblue", \
                 onvalue = "-o", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var21)
        self.C21.grid(row=22, column=0, padx=5, pady=5)
        self.t21 = Text(self.frame_content3, height=1, width=20)
        self.t21.grid(row=22, column=1, padx=5, pady=5)
        l21 = Label(self.frame_content3,
                    text=': number of packets per burst (-1)',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=22, column=2, padx=5, pady=5)

        self.C22 = Checkbutton(self.frame_content3, text = "-q", fg="deepskyblue", \
                 onvalue = "-q", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var22)
        self.C22.grid(row=24, column=0, padx=5, pady=5)
        self.t22 = Text(self.frame_content3, height=1, width=20)
        self.t22.grid(row=24, column=1, padx=5, pady=5)
        l22 = Label(self.frame_content3,
                    text=': seconds between keep-alives (-1)',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=24, column=2, padx=5, pady=5)

        self.C23 = Checkbutton(self.frame_content3, text = "-y", fg="deepskyblue", \
                 onvalue = "-y", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var23)
        self.C23.grid(row=25, column=0, padx=5, pady=5)
        self.t23 = Text(self.frame_content3, height=1, width=20)
        self.t23.grid(row=25, column=1, padx=5, pady=5)
        l23 = Label(self.frame_content3,
                    text=':  keystream for shared key auth',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=25, column=2, padx=5, pady=5)


        self.C24 = Checkbutton(self.frame_content3, text = "-B", fg="deepskyblue", \
                 onvalue = "-B", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var24)
        self.C24.grid(row=26, column=0, padx=5, pady=5)
        self.t24 = Text(self.frame_content3, height=1, width=20)
        self.t24.grid(row=26, column=1, padx=5, pady=5)
        l14 = Label(self.frame_content3,
                    text=': bit rate test (Applies only to test mode)',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=26, column=2, padx=5, pady=5)

        self.C25 = Checkbutton(self.frame_content3, text = "-D", fg="deepskyblue", \
                 onvalue = "-D", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var25)
        self.C25.grid(row=27, column=0, padx=5, pady=5)
        self.t25 = Text(self.frame_content3, height=1, width=20)
        self.t25.grid(row=27, column=1, padx=5, pady=5)
        l25 = Label(self.frame_content3,
                    text=': disables AP detection.',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=27, column=2, padx=5, pady=5)

        self.C26 = Checkbutton(self.frame_content3, text = "-F", fg="deepskyblue", \
                 onvalue = "-F", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var26)
        self.C26.grid(row=28, column=0, padx=5, pady=5)
        self.t26 = Text(self.frame_content3, height=1, width=20)
        self.t26.grid(row=28, column=1, padx=5, pady=5)
        l26 = Label(self.frame_content3,
                    text=': chooses first matching packet.',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=28, column=2, padx=5, pady=5)

        self.C27 = Checkbutton(self.frame_content3, text = "-R", fg="deepskyblue", \
                 onvalue = "-R", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var27)
        self.C27.grid(row=29, column=0, padx=5, pady=5)
        self.t27 = Text(self.frame_content3, height=1, width=20)
        self.t27.grid(row=29, column=1, padx=5, pady=5)
        l27 = Label(self.frame_content3,
                    text=': disables /dev/rtc usage.',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=29, column=2, padx=5, pady=5)
예제 #30
0
    file_menu.add_separator()
    file_menu.add_command(label="Change Port", command=do_nothing)
    file_menu.add_separator()
    file_menu.add_command(label="Exit", command=master.quit)

    help_menu = Menu(menubar, tearoff=0)
    help_menu.add_command(label="About", command=do_nothing)
    help_menu.add_command(label="GitHub", command=do_nothing)

    menubar.add_cascade(label="File", menu=file_menu)
    menubar.add_cascade(label="Help", menu=help_menu)

    master.config(menu=menubar)

    notebook = Notebook(master)
    notebook.pack(fill=BOTH, expand=1)

    # ================ Plugin Setup ====================
    out_queue = multiprocessing.Queue()

    telemetry_plugin = TelemetryPlugin(baudrate=9600, out_queue=out_queue)
    telemetry_plugin.load_gui(notebook)

    plotting_plugin = PlottingPlugin(baudrate=9600, in_queue=out_queue)
    plotting_plugin.load_gui(notebook)

    # ==================================================

    master.mainloop()

    telemetry_plugin.close(master)
예제 #31
0
    def __init__(self, master):
        
	self.fname="" 
        #global variables
        self.t1=StringVar()
        self.t2=StringVar()
        self.t3=StringVar()
        self.t4=StringVar()
        self.t5=StringVar()
        self.t6=StringVar()
        self.t7=StringVar()
        self.t8=StringVar()
        self.t9=StringVar()
        self.t10=StringVar()
        self.t11=StringVar()
        self.t12=StringVar()
        self.t13=StringVar()
        self.t14=StringVar()
        self.t15=StringVar()
        self.t16=StringVar()
        self.t17=StringVar()
        self.t18=StringVar()
        self.t19=StringVar()
        self.t20=StringVar()
        self.t21=StringVar()
        self.t22=StringVar()
        self.t23=StringVar()
        self.t24=StringVar()
        self.t25=StringVar()
        self.t26=StringVar()
        self.t27=StringVar()
        self.t28=StringVar()
        self.t29=StringVar()
        self.t30=StringVar()
        self.t31=StringVar()
        self.t32=StringVar()
        self.t33=StringVar()
        self.t34=StringVar()
        
        self.var1=StringVar()
        self.var2=StringVar()
        self.var3=StringVar()
        self.var4=StringVar()
        self.var5=StringVar()
        self.var6=StringVar()
        self.var7=StringVar()
        self.var8=StringVar()
        self.var9=StringVar()
        self.var10=StringVar()
        self.var11=StringVar()
        self.var12=StringVar()
        self.var13=StringVar()
        self.var14=StringVar()
        self.var15=StringVar()
        self.var16=StringVar()
        self.var17=StringVar()
        self.var18=StringVar()
        self.var19=StringVar()
        self.var20=StringVar()
        self.var21=StringVar()
        self.var22=StringVar()
        self.var23=StringVar()
        self.var24=StringVar()
        self.var25=StringVar()
        self.var26=StringVar()
        self.var27=StringVar()
        self.var28=StringVar()
        self.var29=StringVar()
        self.var30=StringVar()
        self.var31=StringVar()
        self.var32=StringVar()
        self.var33=StringVar()
        self.var34=StringVar()
        #end
        
        mymaster = Frame(master, name='mymaster') # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window    
        #master.minsize(width=900, height=900)
        #master.maxsize(width=750, height=470)
        #end
        
        #title of window
        master.title("Aircrack-ng")
        #end
        
        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont=tkFont.Font(family="Helvetica", size=15,underline = True)
        self.myfontnew=tkFont.Font(family="Helvetica", size=11,underline = True)
        #end
        
        
       
        nb = Notebook(mymaster, name='nb') # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3) # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1") # add tab to Notebook
    
        # repeat for each tab
        self.frame_content2 = Frame(nb, name='frame_content2', bg="white")
        nb.add(self.frame_content2, text="Filter-2")
        self.frame_content3 = Frame(nb, name='frame_content3', bg="white")
        nb.add(self.frame_content3, text="Filter-3")
        self.frame_content4 = Frame(nb, name='frame_content4', bg="white")
        nb.add(self.frame_content4, text="Filter-4")
        self.frame_content6 = Frame(nb, name='frame_content6', bg="white")
        nb.add(self.frame_content6, text="Filter-5")
	self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")
        
        #End
        
	#frame content 7
	Label(self.frame_content7, text = 'Aircrack-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        btndetect=Button(self.frame_content7, text = 'Detect', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 1, column = 0, padx = 5, pady = 5)
		
	btndbrowse=Button(self.frame_content7, text = 'Attach File', command =self.browse_file, height=2, width=15, font=self.customFont).grid(row = 3, column = 0, padx = 5, pady = 5)	
	self.lilnew1=Listbox(self.frame_content7,bg="black", fg="white", font=self.myfont, selectmode=SINGLE, width=30, height=15)
        self.lilnew1.grid(row = 1, column = 1, rowspan=3)
	#End

        Label(self.frame_content, text = 'Aircrack-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content, text = 'Options :',font=self.myfontnew, bg="white").grid(row = 1, column = 1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5, text = 'Edit Command From Here',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 0, column = 0)
        TextCommandBox=Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output=Text(self.frame_content5,bg="black", fg="white", font=self.myfont, height=20, width=42)
        self.output.grid(row = 0, column = 1, padx=50, pady=5, rowspan=3)
        btnsubmit=Button(self.frame_content5, width=15, height=2, text="Get Result", command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear=Button(self.frame_content5, width=15, height=2, text="Clear Output", command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-a", \
                 onvalue = "-a", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var1)
        self.C1.grid(row = 2, column = 0, padx = 5, pady = 5)
        self.t1=Text(self.frame_content,height=1,width = 20)
        self.t1.grid(row = 2, column = 1, padx = 5, pady = 5)
        l1=Label(self.frame_content, text = ': Force attack mode (1 = static WEP, 2 = WPA/WPA2-PSK).',font=self.myfont, bg="white", justify=LEFT).grid(row = 2, column = 2, padx = 5, pady = 5)
        
        self.C2 = Checkbutton(self.frame_content, text = "-b", \
                 onvalue = "-b", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var2)
        self.C2.grid(row = 3, column = 0, padx = 5, pady = 5)
        self.t2=Text(self.frame_content,height=1,width = 20)
        self.t2.grid(row = 3, column = 1, padx = 5, pady = 5)
        l2=Label(self.frame_content, text = ': Long version bssid. Select the target network based on\n  the access point\'s MAC address.',font=self.myfont, bg="white", justify=LEFT).grid(row = 3, column = 2, padx = 5, pady = 5)
        
        self.C3 = Checkbutton(self.frame_content, text = "-e", \
                 onvalue = "-e", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row = 4, column = 0, padx = 5, pady = 5)
        self.t3=Text(self.frame_content,height=1,width = 20)
        self.t3.grid(row = 4, column = 1, padx = 5, pady = 5)
        l3=Label(self.frame_content, text = ': If set, all IVs from networks with the same ESSID will be used.\n  This option is also required for WPA/WPA2-PSK cracking if the\n  ESSID is not broadcasted (hidden).',font=self.myfont, bg="white", justify=LEFT).grid(row = 4, column = 2, padx = 5, pady = 5)
        
        self.C4 = Checkbutton(self.frame_content, text = "-p", \
                 onvalue = "-p", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var4)
        self.C4.grid(row = 5, column = 0, padx = 5, pady = 5)
        self.t4=Text(self.frame_content,height=1,width = 20)
        self.t4.grid(row = 5, column = 1, padx = 5, pady = 5)
        l4=Label(self.frame_content, text = ': On SMP systems: # of CPU to use. This option is invalid on\n  non-SMP systems.',font=self.myfont, bg="white", justify=LEFT).grid(row = 5, column = 2, padx = 5, pady = 5)
        
        self.C5 = Checkbutton(self.frame_content, text = "-q", \
                 onvalue = "-q", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var5)
        self.C5.grid(row = 6, column = 0, padx = 5, pady = 5)
        self.t5=Text(self.frame_content,height=1,width = 20)
        self.t5.grid(row = 6, column = 1, padx = 5, pady = 5)
        l5=Label(self.frame_content, text = ': Enable quiet mode (no status output until the key is found, or not).',font=self.myfont, bg="white", justify=LEFT).grid(row = 6, column = 2, padx = 5, pady = 5)
        
        self.C6 = Checkbutton(self.frame_content, text = "-c", \
                 onvalue = "-c", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var6)
        self.C6.grid(row = 7, column = 0, padx = 5, pady = 5)
        self.t6=Text(self.frame_content,height=1,width = 20)
        self.t6.grid(row = 7, column = 1, padx = 5, pady = 5)
        l6=Label(self.frame_content, text = ': (WEP cracking) Restrict the search space to alpha-numeric\n  characters only (0x20 - 0x7F).',font=self.myfont, bg="white", justify=LEFT).grid(row = 7, column = 2, padx = 5, pady = 5)
        
        self.C7 = Checkbutton(self.frame_content, text = "-t", \
                 onvalue = "-t", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var7)
        self.C7.grid(row = 8, column = 0, padx = 5, pady = 5)
        self.t7=Text(self.frame_content,height=1,width = 20)
        self.t7.grid(row = 8, column = 1, padx = 5, pady = 5)
        l7=Label(self.frame_content, text = ': (WEP cracking) Restrict the search space to binary coded decimal\n  hex characters.',font=self.myfont, bg="white", justify=LEFT).grid(row = 8, column = 2, padx = 5, pady = 5)
        
        Label(self.frame_content2, text = 'Aircrack-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        #frame2
        self.C8 = Checkbutton(self.frame_content2, text = "-h", \
                 onvalue = "-h", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var8)
        self.C8.grid(row = 9, column = 0, padx = 5, pady = 5)
        self.t8=Text(self.frame_content2,height=1,width = 20)
        self.t8.grid(row = 9, column = 1, padx = 5, pady = 5)
        l8=Label(self.frame_content2, text = ':  (WEP cracking) Restrict the search space to numeric\n   characters (0x30-0x39) These keys are used by default\n   in most Fritz!BOXes.',font=self.myfont, bg="white", justify=LEFT).grid(row = 9, column = 2, padx = 5, pady = 5)
        
        self.C9 = Checkbutton(self.frame_content2, text = "-d", \
                 onvalue = "-d", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var9)
        self.C9.grid(row = 10, column = 0, padx = 5, pady = 5)
        self.t9=Text(self.frame_content2,height=1,width = 20)
        self.t9.grid(row = 10, column = 1, padx = 5, pady = 5)
        l9=Label(self.frame_content2, text = ': (WEP cracking) Long version debug. Set the beginning\n  of the WEP key (in hex), for debugging purposes.',font=self.myfont, bg="white", justify=LEFT).grid(row = 10, column = 2, padx = 5, pady = 5)
        
        
        self.C10 = Checkbutton(self.frame_content2, text = "-m", \
                 onvalue = "-m", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var10)
        self.C10.grid(row = 11, column = 0, padx = 5, pady = 5)
        self.t10=Text(self.frame_content2,height=1,width = 20)
        self.t10.grid(row = 11, column = 1, padx = 5, pady = 5)
        l10=Label(self.frame_content2, text = ': (WEP cracking) MAC address to filter WEP data packets.\n  Alternatively, specify -m ff:ff:ff:ff:ff:ff to use all and every IVs,\n  regardless of the network.',font=self.myfont, bg="white", justify=LEFT).grid(row = 11, column = 2, padx = 5, pady = 5)
        
        self.C11 = Checkbutton(self.frame_content2, text = "-M", \
                 onvalue = "-M", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var11)
        self.C11.grid(row = 12, column = 0, padx = 5, pady = 5)
        self.t11=Text(self.frame_content2,height=1,width = 20)
        self.t11.grid(row = 12, column = 1, padx = 5, pady = 5)
        l11=Label(self.frame_content2, text = ': (WEP cracking) Sets the maximum number of ivs to use.',font=self.myfont, bg="white", justify=LEFT).grid(row = 12, column = 2, padx = 5, pady = 5)
        
        self.C12 = Checkbutton(self.frame_content2, text = "-n", \
                 onvalue = "-n", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var12)
        self.C12.grid(row = 13, column = 0, padx = 5, pady = 5)
        self.t12=Text(self.frame_content2,height=1,width = 20)
        self.t12.grid(row = 13, column = 1, padx = 5, pady = 5)
        l12=Label(self.frame_content2, text = ': (WEP cracking) Specify the length of the key: 64 for 40-bit\n  WEP, 128 for 104-bit WEP, etc. The default value is 128.',font=self.myfont, bg="white", justify=LEFT).grid(row = 13, column = 2, padx = 5, pady = 5)
        
        self.C13 = Checkbutton(self.frame_content2, text = "-i", \
                 onvalue = "-i", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var13)
        self.C13.grid(row = 14, column = 0, padx = 5, pady = 5)
        self.t13=Text(self.frame_content2,height=1,width = 20)
        self.t13.grid(row = 14, column = 1, padx = 5, pady = 5)
        l13=Label(self.frame_content2, text = ': (WEP cracking) Only keep the IVs that have this key index\n  (1 to 4). The default behaviour is to ignore the key index.',font=self.myfont, bg="white", justify=LEFT).grid(row = 14, column = 2, padx = 5, pady = 5)
        
        self.C14 = Checkbutton(self.frame_content2, text = "-f", \
                 onvalue = "-f", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var14)
        self.C14.grid(row = 15, column = 0, padx = 5, pady = 5)
        self.t14=Text(self.frame_content2,height=1,width = 20)
        self.t14.grid(row = 15, column = 1, padx = 5, pady = 5)
        l14=Label(self.frame_content2, text = ': (WEP cracking) By default, this parameter is set to 2 for\n  104-bit WEP and to 5 for 40-bit WEP. Specify a higher\n  value to increase the bruteforce level: cracking will take\n  more time, but with a higher likelyhood of success.',font=self.myfont, bg="white", justify=LEFT).grid(row = 15, column = 2, padx = 5, pady = 5)
        
        
        #frame3
        Label(self.frame_content3, text = 'Aircrack-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        
        self.C15 = Checkbutton(self.frame_content3, text = "-H", \
                 onvalue = "-H", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var15)
        self.C15.grid(row = 17, column = 0, padx = 5, pady = 5)
        self.t15=Text(self.frame_content3,height=1,width = 20)
        self.t15.grid(row = 17, column = 1, padx = 5, pady = 5)
        l15=Label(self.frame_content3, text = ': Long version help. Output help information.',font=self.myfont, bg="white", justify=LEFT).grid(row = 17, column = 2, padx = 5, pady = 5)
        
        self.C16 = Checkbutton(self.frame_content3, text = "-l", \
                 onvalue = "-l", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var16)
        self.C16.grid(row = 18, column = 0, padx = 5, pady = 5)
        self.t16=Text(self.frame_content3,height=1,width = 20)
        self.t16.grid(row = 18, column = 1, padx = 5, pady = 5)
        l16=Label(self.frame_content3, text = ': (Lowercase L, ell) logs the key to the file specified.',font=self.myfont, bg="white", justify=LEFT).grid(row = 18, column = 2, padx = 5, pady = 5)
        
        self.C17 = Checkbutton(self.frame_content3, text = "-K", \
                 onvalue = "-K", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var17)
        self.C17.grid(row = 19, column = 0, padx = 5, pady = 5)
        self.t17=Text(self.frame_content3,height=1,width = 20)
        self.t17.grid(row = 19, column = 1, padx = 5, pady = 5)
        l17=Label(self.frame_content3, text = ':  (WEP cracking) There are 17 korek statistical attacks.\n   Sometimes one attack creates a huge false positive that\n   prevents the key from being found, even with lots of IVs.\n   Try -k 1, -k 2, -k 17 to disable each attack selectively.',font=self.myfont, bg="white", justify=LEFT).grid(row = 19, column = 2, padx = 5, pady = 5)
    
        
        self.C18 = Checkbutton(self.frame_content3, text = "-k", \
                 onvalue = "-k", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var18)
        self.C18.grid(row = 21, column = 0, padx = 5, pady = 5)
        self.t18=Text(self.frame_content3,height=1,width = 20)
        self.t18.grid(row = 21, column = 1, padx = 5, pady = 5)
        l18=Label(self.frame_content3, text = ': number of packets per second (default: 100)',font=self.myfont, bg="white", justify=LEFT).grid(row = 21, column = 2, padx = 5, pady = 5)
        
        self.C19 = Checkbutton(self.frame_content3, text = "-p", \
                 onvalue = "-p", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var19)
        self.C19.grid(row = 22, column = 0, padx = 5, pady = 5)
        self.t19=Text(self.frame_content3,height=1,width = 20)
        self.t19.grid(row = 22, column = 1, padx = 5, pady = 5)
        l19=Label(self.frame_content3, text = ': Allow the number of threads for cracking even if you have\n   a non-SMP computer.',font=self.myfont, bg="white", justify=LEFT).grid(row = 22, column = 2, padx = 5, pady = 5)
        
        
        self.C20 = Checkbutton(self.frame_content3, text = "-r", \
                 onvalue = "-r", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var20)
        self.C20.grid(row = 23, column = 0, padx = 5, pady = 5)
        self.t20=Text(self.frame_content3,height=1,width = 20)
        self.t20.grid(row = 23, column = 1, padx = 5, pady = 5)
        l20=Label(self.frame_content3, text = ': Utilizes a database generated by airolib-ng as input to\n   determine the WPA key. Outputs an error message if\n   aircrack-ng has not been compiled with sqlite support.',font=self.myfont, bg="white", justify=LEFT).grid(row = 23, column = 2, padx = 5, pady = 5)
        
        self.C21 = Checkbutton(self.frame_content3, text = "-x/-x0", \
                 onvalue = "-x/-x0", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var21)
        self.C21.grid(row = 24, column = 0, padx = 5, pady = 5)
        self.t21=Text(self.frame_content3,height=1,width = 20)
        self.t21.grid(row = 24, column = 1, padx = 5, pady = 5)
        l21=Label(self.frame_content3, text = ':  (WEP cracking) Disable last keybytes brutforce.',font=self.myfont, bg="white", justify=LEFT).grid(row = 24, column = 2, padx = 5, pady = 5)
        
        
        #frame4
        Label(self.frame_content4, text = 'Aircrack-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        self.C22 = Checkbutton(self.frame_content4, text = "-x1", \
                 onvalue = "-x1", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var22)
        self.C22.grid(row = 25, column = 0, padx = 5, pady = 5)
        self.t22=Text(self.frame_content4,height=1,width = 20)
        self.t22.grid(row = 25, column = 1, padx = 5, pady = 5)
        l22=Label(self.frame_content4, text = ':  (WEP cracking) Enable last keybyte bruteforcing (default).',font=self.myfont, bg="white", justify=LEFT).grid(row = 25, column = 2, padx = 5, pady = 5)
        
        self.C23 = Checkbutton(self.frame_content4, text = "-x2", \
                 onvalue = "-x2", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var23)
        self.C23.grid(row = 26, column = 0, padx = 5, pady = 5)
        self.t23=Text(self.frame_content4,height=1,width = 20)
        self.t23.grid(row = 26, column = 1, padx = 5, pady = 5)
        l23=Label(self.frame_content4, text = ':  (WEP cracking) Enable last two keybytes bruteforcing.',font=self.myfont, bg="white", justify=LEFT).grid(row = 26, column = 2, padx = 5, pady = 5)
        
        self.C24 = Checkbutton(self.frame_content4, text = "-X", \
                 onvalue = "-X", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var24)
        self.C24.grid(row = 27, column = 0, padx = 5, pady = 5)
        self.t24=Text(self.frame_content4,height=1,width = 20)
        self.t24.grid(row = 27, column = 1, padx = 5, pady = 5)
        l24=Label(self.frame_content4, text = ':  (WEP cracking) Disable bruteforce multithreading (SMP only).',font=self.myfont, bg="white", justify=LEFT).grid(row = 27, column = 2, padx = 5, pady = 5)
        
        self.C25 = Checkbutton(self.frame_content4, text = "-y", \
                 onvalue = "-y", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var25)
        self.C25.grid(row = 28, column = 0, padx = 5, pady = 5)
        self.t25=Text(self.frame_content4,height=1,width = 20)
        self.t25.grid(row = 28, column = 1, padx = 5, pady = 5)
        l25=Label(self.frame_content4, text = ':  (WEP cracking) Experimental single bruteforce attack which\n   should only be used when the standard attack mode fails with\n   more than one million IVs',font=self.myfont, bg="white", justify=LEFT).grid(row = 28, column = 2, padx = 5, pady = 5)
        
        
        self.C26 = Checkbutton(self.frame_content4, text = "-u", \
                 onvalue = "-u", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var26)
        self.C26.grid(row = 29, column = 0, padx = 5, pady = 5)
        self.t26=Text(self.frame_content4,height=1,width = 20)
        self.t26.grid(row = 29, column = 1, padx = 5, pady = 5)
        l26=Label(self.frame_content4, text = ':  Long form -cpu-detect. Provide information on the number of\n   CPUs and MMX support. Example responses to "aircrack-ng \n   -cpu-detect" are "Nb CPU detected: 2" or Nb CPU detected: \n   1 (MMX available)".',font=self.myfont, bg="white", justify=LEFT).grid(row = 29, column = 2, padx = 5, pady = 5)
        
        self.C27 = Checkbutton(self.frame_content4, text = "-w", \
                 onvalue = "-w", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var27)
        self.C27.grid(row = 30, column = 0, padx = 5, pady = 5)
        self.t27=Text(self.frame_content4,height=1,width = 20)
        self.t27.grid(row = 30, column = 1, padx = 5, pady = 5)
        l27=Label(self.frame_content4, text = ':   (WPA cracking) Path to a wordlist or "-"without the quotes for \n    standard in (stdin).',font=self.myfont, bg="white", justify=LEFT).grid(row = 30, column = 2, padx = 5, pady = 5)
        
        self.C28 = Checkbutton(self.frame_content4, text = "-z", \
                 onvalue = "-z", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var28)
        self.C28.grid(row = 31, column = 0, padx = 5, pady = 5)
        self.t28=Text(self.frame_content4,height=1,width = 20)
        self.t28.grid(row = 31, column = 1, padx = 5, pady = 5)
        l28=Label(self.frame_content4, text = ':  Invokes the PTW WEP cracking method. (Default in v1.x)',font=self.myfont, bg="white", justify=LEFT).grid(row = 31, column = 2, padx = 5, pady = 5)
        
        #frame4
        Label(self.frame_content6, text = 'Aircrack-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        self.C29 = Checkbutton(self.frame_content6, text = "-P", \
                 onvalue = "-P", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var29)
        self.C29.grid(row = 32, column = 0, padx = 5, pady = 5)
        self.t29=Text(self.frame_content6,height=1,width = 20)
        self.t29.grid(row = 32, column = 1, padx = 5, pady = 5)
        l29=Label(self.frame_content6, text = ':  Long version -ptw-debug. Invokes the PTW debug mode.',font=self.myfont, bg="white", justify=LEFT).grid(row = 32, column = 2, padx = 5, pady = 5)
        
        self.C30 = Checkbutton(self.frame_content6, text = "-C", \
                 onvalue = "-C", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var30)
        self.C30.grid(row = 33, column = 0, padx = 5, pady = 5)
        self.t30=Text(self.frame_content6,height=1,width = 20)
        self.t30.grid(row = 33, column = 1, padx = 5, pady = 5)
        l30=Label(self.frame_content6, text = ':   Long version -combine. Merge the given APs to a virtual one.',font=self.myfont, bg="white", justify=LEFT).grid(row = 33, column = 2, padx = 5, pady = 5)
        
        self.C31 = Checkbutton(self.frame_content6, text = "-D", \
                 onvalue = "-D", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var31)
        self.C31.grid(row = 34, column = 0, padx = 5, pady = 5)
        self.t31=Text(self.frame_content6,height=1,width = 20)
        self.t31.grid(row = 34, column = 1, padx = 5, pady = 5)
        l31=Label(self.frame_content6, text = ':  Long version -wep-decloak. Run in WEP decloak mode.',font=self.myfont, bg="white", justify=LEFT).grid(row = 34, column = 2, padx = 5, pady = 5)
        
        self.C32 = Checkbutton(self.frame_content6, text = "-V", \
                 onvalue = "-V", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var32)
        self.C32.grid(row = 35, column = 0, padx = 5, pady = 5)
        self.t32=Text(self.frame_content6,height=1,width = 20)
        self.t32.grid(row = 35, column = 1, padx = 5, pady = 5)
        l32=Label(self.frame_content6, text = ':  Long version -visual-inspection. Run in visual inspection mode.',font=self.myfont, bg="white", justify=LEFT).grid(row = 35, column = 2, padx = 5, pady = 5)
        
        self.C33 = Checkbutton(self.frame_content6, text = "-1", \
                 onvalue = "-1", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var33)
        self.C33.grid(row = 36, column = 0, padx = 5, pady = 5)
        self.t33=Text(self.frame_content6,height=1,width = 20)
        self.t33.grid(row = 36, column = 1, padx = 5, pady = 5)
        l33=Label(self.frame_content6, text = ':  Long version -oneshot. Run in oneshot mode.',font=self.myfont, bg="white", justify=LEFT).grid(row = 36, column = 2, padx = 5, pady = 5)
        
        self.C34 = Checkbutton(self.frame_content6, text = "-S", \
                 onvalue = "-S", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var34)
        self.C34.grid(row = 37, column = 0, padx = 5, pady = 5)
        self.t34=Text(self.frame_content6,height=1,width = 20)
        self.t34.grid(row = 37, column = 1, padx = 5, pady = 5)
        l34=Label(self.frame_content6, text = ':  WPA cracking speed test.',font=self.myfont, bg="white", justify=LEFT).grid(row = 37, column = 2, padx = 5, pady = 5)
예제 #32
0
    def __init__(self, master):

        self.fname = ""
        #global variables
        self.t1 = StringVar()
        self.t2 = StringVar()
        self.t3 = StringVar()
        self.t4 = StringVar()
        self.t5 = StringVar()
        self.t6 = StringVar()
        self.t7 = StringVar()
        self.t8 = StringVar()
        self.t9 = StringVar()
        self.t10 = StringVar()
        self.t11 = StringVar()
        self.t12 = StringVar()

        self.var1 = StringVar()
        self.var2 = StringVar()
        self.var3 = StringVar()
        self.var4 = StringVar()
        self.var5 = StringVar()
        self.var6 = StringVar()
        self.var7 = StringVar()
        self.var8 = StringVar()
        self.var9 = StringVar()
        self.var10 = StringVar()
        self.var11 = StringVar()
        self.var12 = StringVar()
        #end

        mymaster = Frame(master, name='mymaster')  # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window
        #master.minsize(width=900, height=900)
        #master.maxsize(width=800, height=600)
        #end

        #title of window
        master.title("Airtun-ng")
        #end

        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont = tkFont.Font(family="Helvetica",
                                      size=15,
                                      underline=True)
        self.myfontnew = tkFont.Font(family="Helvetica",
                                     size=11,
                                     underline=True)
        #end

        nb = Notebook(mymaster, name='nb')  # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3)  # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb, name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1")  # add tab to Notebook

        # repeat for each tab
        self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")

        #End

        #frame content 7
        Label(self.frame_content7,
              text='Aigraph-ng',
              font=self.headerfont,
              bg="white",
              padx=10,
              pady=10).grid(row=0, column=0)
        btndetect = Button(self.frame_content7,
                           text='Detect',
                           command=self.canvas_detect,
                           height=2,
                           width=15,
                           font=self.customFont).grid(row=1,
                                                      column=0,
                                                      padx=5,
                                                      pady=5)

        btndbrowse = Button(self.frame_content7,
                            text='Attach File',
                            command=self.browse_file,
                            height=2,
                            width=15,
                            font=self.customFont).grid(row=3,
                                                       column=0,
                                                       padx=5,
                                                       pady=5)
        self.lilnew1 = Listbox(self.frame_content7,
                               bg="black",
                               fg="white",
                               font=self.myfont,
                               selectmode=SINGLE,
                               width=30,
                               height=15)
        self.lilnew1.grid(row=1, column=1, rowspan=3)
        #End

        Label(self.frame_content,
              text='Airtun-ng',
              font=self.headerfont,
              bg="white",
              padx=10,
              pady=10).grid(row=0, column=0)
        Label(self.frame_content,
              text='Options :',
              font=self.myfontnew,
              bg="white").grid(row=1, column=1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5,
              text='Edit Command From Here',
              font=self.myfontnew,
              bg="white",
              justify=LEFT).grid(row=0, column=0)
        TextCommandBox = Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output = Text(self.frame_content5,
                           bg="black",
                           fg="white",
                           font=self.myfont,
                           height=20,
                           width=42)
        self.output.grid(row=0, column=1, padx=50, pady=5, rowspan=3)
        btnsubmit = Button(self.frame_content5,
                           width=15,
                           height=2,
                           text="Get Result",
                           command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear = Button(self.frame_content5,
                          width=15,
                          height=2,
                          text="Clear Output",
                          command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-x", \
                 onvalue = "-x", offvalue ="", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var1)
        self.C1.grid(row=2, column=0, padx=5, pady=5)
        self.t1 = Text(self.frame_content, height=1, width=20)
        self.t1.grid(row=2, column=1, padx=5, pady=5)
        l1 = Label(self.frame_content,
                   text=': maximum number of packets per second (optional)',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=2, column=2, padx=5, pady=5)

        self.C2 = Checkbutton(self.frame_content, text = "-a", \
                 onvalue = "-a", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var2)
        self.C2.grid(row=3, column=0, padx=5, pady=5)
        self.t2 = Text(self.frame_content, height=1, width=20)
        self.t2.grid(row=3, column=1, padx=5, pady=5)
        l2 = Label(self.frame_content,
                   text=': set Access Point MAC address (mandatory)',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=3, column=2, padx=5, pady=5)

        self.C3 = Checkbutton(self.frame_content, text = "-i", \
                 onvalue = "-i", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row=4, column=0, padx=5, pady=5)
        self.t3 = Text(self.frame_content, height=1, width=20)
        self.t3.grid(row=4, column=1, padx=5, pady=5)
        l3 = Label(self.frame_content,
                   text=': capture packets from this interface (optional)',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=4, column=2, padx=5, pady=5)

        self.C4 = Checkbutton(self.frame_content, text = "-y", \
                 onvalue = "-y", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var5)
        self.C4.grid(row=5, column=0, padx=5, pady=5)
        self.t4 = Text(self.frame_content, height=1, width=20)
        self.t4.grid(row=5, column=1, padx=5, pady=5)
        l4 = Label(
            self.frame_content,
            text=
            ': read PRGA from this file (optional / one of -y or -w must be defined)',
            font=self.myfont,
            bg="white",
            justify=LEFT).grid(row=5, column=2, padx=5, pady=5)

        self.C5 = Checkbutton(self.frame_content, text = "-W", \
                 onvalue = "-W", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var6)
        self.C5.grid(row=6, column=0, padx=5, pady=5)
        self.t5 = Text(self.frame_content, height=1, width=20)
        self.t5.grid(row=6, column=1, padx=5, pady=5)
        l5 = Label(
            self.frame_content,
            text=
            ': use this WEP-KEY to encrypt packets (optional / one of -y or -w must be defined)',
            font=self.myfont,
            bg="white",
            justify=LEFT).grid(row=6, column=2, padx=5, pady=5)

        self.C6 = Checkbutton(self.frame_content, text = "-t", \
                 onvalue = "-t", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var7)
        self.C6.grid(row=8, column=0, padx=5, pady=5)
        self.t6 = Text(self.frame_content, height=1, width=20)
        self.t6.grid(row=8, column=1, padx=5, pady=5)
        l6 = Label(
            self.frame_content,
            text=
            ': send frames to AP (1) or to client (0) (optional / defaults to 0)',
            font=self.myfont,
            bg="white",
            justify=LEFT).grid(row=8, column=2, padx=5, pady=5)

        self.C7 = Checkbutton(self.frame_content, text = "-r", \
                 onvalue = "-r", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var8)
        self.C7.grid(row=9, column=0, padx=5, pady=5)
        self.t7 = Text(self.frame_content, height=1, width=20)
        self.t7.grid(row=9, column=1, padx=5, pady=5)
        l7 = Label(self.frame_content,
                   text=': read frames out of pcap file (optional)',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=9, column=2, padx=5, pady=5)

        self.C8 = Checkbutton(self.frame_content, text = "-h", \
                 onvalue = "-h", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var9)
        self.C8.grid(row=10, column=0, padx=5, pady=5)
        self.t8 = Text(self.frame_content, height=1, width=20)
        self.t8.grid(row=10, column=1, padx=5, pady=5)
        l8 = Label(self.frame_content,
                   text=': source MAC address',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=10, column=2, padx=5, pady=5)

        self.C9 = Checkbutton(self.frame_content, text = "-H", \
                 onvalue = "-H", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var10)
        self.C9.grid(row=11, column=0, padx=5, pady=5)
        self.t9 = Text(self.frame_content, height=1, width=20)
        self.t9.grid(row=11, column=1, padx=5, pady=5)
        l9 = Label(self.frame_content,
                   text=': Display help. Long form help',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=11, column=2, padx=5, pady=5)

        Label(self.frame_content,
              text='Repeater Options :',
              font=self.myfontnew,
              bg="white").grid(row=12, column=1)

        self.C10 = Checkbutton(self.frame_content, text = "--repeat", \
                 onvalue = "--repeat", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var11)
        self.C10.grid(row=13, column=0, padx=5, pady=5)
        self.t10 = Text(self.frame_content, height=1, width=20)
        self.t10.grid(row=13, column=1, padx=5, pady=5)
        l10 = Label(self.frame_content,
                    text=': activates repeat mode. Short form -f.',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=13, column=2, padx=5, pady=5)

        self.C11 = Checkbutton(self.frame_content, text = "--bssid", \
                 onvalue = "--bssid", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var12)
        self.C11.grid(row=14, column=0, padx=5, pady=5)
        self.t11 = Text(self.frame_content, height=1, width=20)
        self.t11.grid(row=14, column=1, padx=5, pady=5)
        l11 = Label(self.frame_content,
                    text=': BSSID to repeat. Short form -d.',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=14, column=2, padx=5, pady=5)

        self.C12 = Checkbutton(self.frame_content, text = "--netmask", \
                 onvalue = "--netmask", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont)
        self.C12.grid(row=15, column=0, padx=5, pady=5)
        self.t12 = Text(self.frame_content, height=1, width=20)
        self.t12.grid(row=15, column=1, padx=5, pady=5)
        l12 = Label(self.frame_content,
                    text=': netmask for BSSID filter. Short form -m.',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=15, column=2, padx=5, pady=5)
예제 #33
0
class Inmuebles(Frame):
    def __init__(self, parent, controller):
        Frame.__init__(self, parent)

        #VARIABLES GLOBALES
        global codigo, direccion, piso, telefono, ciudad, zona, barrio, estrato, llaves, preguntarx, fin, vlrenta, vladmon, incluida, vlventa, vlavaluo, comiventa, pagoprop, fpagoprop, fpagoadmin, tpropiedad, area, lineas, habitaciones, closets, lamparas, duchas, lavamanos, tsala, tcocina, tpiso, tgarage, rutabus, aservicio, ascensor, citofono, aguacaliente, biblioteca, zverdes, terraza, trifilar, parqueadero, observaciones, lb, Cbx1, Cbx2, zona1, zona2, zona3, zona4, zona5, busqueda, dato, E
        #INSTANCIAS DE LOS WIDGETS
        global codE, adressE, comisionE, phoneE, cityCbx, Cbx1, Cbx2, estratoE, keysE, askforE, rent, arriendoE, admonE, include, sale, ventaE, avaluadoE, comiE, pagopropietarioE, diapagopropietarioE, diapagoadmonE, propertyCbx, areaE, lineasE, roomE, closetE, lampE, bathE, sinkE, salasCbx, cocinaCbx, pisoCbx, garageCbx, rutaE, chkb0, chkb1, chkb2, chkb3, chkb4, chkb5, chkb6, chkb7, chkb8, observaciones, add, delete, edit, clean, update

        #Variables
        codigo = IntVar()
        direccion = StringVar()
        piso = IntVar()
        telefono = StringVar()
        ciudad = StringVar()
        zona = StringVar()
        barrio = StringVar()
        estrato = StringVar()
        llaves = StringVar()
        preguntarx = StringVar()
        fin = IntVar()
        vlrenta = IntVar()
        vladmon = IntVar()
        incluida = IntVar()
        vlventa = IntVar()
        vlavaluo = IntVar()
        comiventa = DoubleVar()
        pagoprop = IntVar()
        fpagoprop = IntVar()
        fpagoadmin = IntVar()

        tpropiedad = StringVar()
        area = IntVar()
        lineas = IntVar()
        habitaciones = IntVar()
        closets = IntVar()
        lamparas = IntVar()
        duchas = IntVar()
        lavamanos = IntVar()
        tsala = StringVar()
        tcocina = StringVar()
        tpiso = StringVar()
        tgarage = StringVar()
        rutabus = StringVar()

        aservicio = IntVar()
        ascensor = IntVar()
        citofono = IntVar()
        aguacaliente = IntVar()
        biblioteca = IntVar()
        zverdes = IntVar()
        terraza = IntVar()
        trifilar = IntVar()
        parqueadero = IntVar()

        ciudades = [
            'Medellín', 'Envigado', 'Caldas', 'El Retiro', 'Guatapé',
            'Bogotá D.C', 'Bello', 'Copacabana', 'Rionegro', 'Sabaneta',
            "Girardot", "Itaguí"
        ]
        zonas = ["Zona 1", "Zona 2", "Zona 3", "Zona 4", "Zona 5"]
        zona1 = [
            'Centro', 'Manrique', 'Aranjuez', 'Prado', 'Buenos Aires',
            'Loreto', 'Milagrosa', 'Villa Hermosa', 'Boston', 'Campo Valdés'
        ]
        zona2 = [
            'Poblado', 'Patio  Bonito', 'Provenza', 'Castropol', 'Manila',
            'San Lucas', 'Envigado', 'El Dorado', 'Loma de Escobero',
            'Sabaneta', 'San Diego', 'Las Palmas', 'La Sebastiana'
        ]
        zona3 = [
            'Laureles', 'La América', 'Estadio', 'Santa Mónica', 'Floresta',
            'Conquistadores', 'Florida Nueva', 'Robledo', 'Los Colores',
            'San Joaquín', 'Castilla', 'Pedregal', 'Tricentenario', 'Bello',
            'Florencia', 'Boyacá las Brisas', 'Barrio Nuevo', 'La Mota',
            'Calazans', 'Simón Bolivar', 'El Portal', 'Envigado'
        ]
        zona4 = [
            'Rosales', 'Guayabal', 'Belén', 'Itaguí', 'La Estrella',
            'Manzanares', 'El Carmelo', 'Mayorca'
        ]
        zona5 = ['El Retiro']

        negociacion = StringVar()
        propiedades = [
            'Casa', 'Apartamento', 'Local', 'Local comercial',
            'Local industrial', 'Oficina', 'Bodega', 'Finca', 'Casa finca',
            'Cabaña', 'Apartaestudio', 'Apartalock', 'Lote', 'Consultorio',
            'Parqueadero'
        ]
        comodidades = [
            "ALCOBA DE SERVICIO", "ASCENDOR", "CITÓFONO", "AGUA CALIENTE",
            "BIBLIOTECA", "ZONAS VERDES", "PARQUEADERO VISITANES", "TRIFILAR",
            "TERRAZA"
        ]
        salas = ['Salón', 'Salón comedor', 'Sala garage']
        cocina = [
            'Integral', 'Semintegral', 'Sencilla', 'Mixta', 'Cocineta',
            'Integral a gas'
        ]
        pisos = [
            'Baldosa', 'Mármol', 'Cerámica', 'Alfombra', 'Mármol y Cerámica',
            'Alfombra y Cerámica', 'Reforzado', 'Porcelanato', 'Madera'
        ]
        garage = ['Cubierto', 'Eléctrico', 'Descubierto', 'Paralelo']

        #busqueda = ["Código","Dirección"]
        busqueda = StringVar()
        busqueda.trace("w", lambda name, index, mode: buscar())
        dato = IntVar()

        #WIDGETS

        #========================= HEADER ===========================

        self.header = Label(self, text="GESTIÓN DE IMNUEBLES", font="bold")
        self.header.pack(pady=20, side=TOP)

        #========================== WRAPPER ==========================

        self.wrapper = Frame(self)
        self.wrapper.pack(side=LEFT, fill=Y)
        #Esto centro el wrapper
        #self.wrapper.pack(side=LEFT, fill=BOTH, expand=True)

        #================ NOTEBOOK =============>

        self.nb = Notebook(self.wrapper)

        #-----------------------> TAB 1

        self.tab1 = Frame(self.nb)

        self.f0 = Frame(
            self.tab1)  #Es para dejar un espacio entre el Tab y el Label
        self.f0.pack(fill=X, pady=10)  #-------------------------------

        self.f1 = Frame(self.tab1)  #-------------------------------
        self.f1.pack(pady=5, fill=X)

        self.codL = Label(self.f1, text='Código:')
        self.codL.pack(side=LEFT)
        codE = Entry(self.f1, textvariable=codigo, width=5)
        codE.pack(side=LEFT)
        codE.focus_set()

        self.adressL = Label(self.f1, text='Dir. Casa:')
        self.adressL.pack(side=LEFT)
        adressE = Entry(self.f1, textvariable=direccion)
        adressE.pack(side=LEFT, fill=X, expand=1)
        adressE.bind("<KeyRelease>", caps)

        self.comisionL = Label(self.f1, text='Piso:')
        self.comisionL.pack(side=LEFT)
        comisionE = Entry(self.f1, textvariable=piso, width=5)
        comisionE.pack(side=LEFT)

        self.phoneL = Label(self.f1, text='Tel:')
        self.phoneL.pack(side=LEFT)
        phoneE = Entry(self.f1, textvariable=telefono, width=20)
        phoneE.pack(side=LEFT)

        self.f2 = Frame(self.tab1)
        self.f2.pack(pady=5, fill=X)  #------------------------------------

        self.cityL = Label(self.f2, text='Ciudad:')
        self.cityL.pack(side=LEFT)

        cityCbx = Combobox(self.f2,
                           textvariable=ciudad,
                           values=ciudades,
                           width=10)
        cityCbx.set('')
        cityCbx.pack(side=LEFT, fill=X, expand=1)

        self.zoneL = Label(self.f2, text='Zona:')
        self.zoneL.pack(side=LEFT)

        Cbx1 = Combobox(self.f2, textvariable=zona, values=zonas, width=10)
        Cbx1.set('')
        Cbx1.bind("<<ComboboxSelected>>", zone)
        Cbx1.pack(side=LEFT, fill=X, expand=1)

        self.neighborL = Label(self.f2, text='Barrio:')
        self.neighborL.pack(side=LEFT)

        Cbx2 = Combobox(self.f2, textvariable=barrio, width=10)
        Cbx2.set('')
        Cbx2.pack(side=LEFT, fill=X, expand=1)

        self.estratoL = Label(self.f2, text='Estrato:')
        self.estratoL.pack(side=LEFT)
        estratoE = Entry(self.f2, textvariable=estrato, width=5)
        estratoE.pack(side=LEFT)

        self.f3 = Frame(self.tab1)
        self.f3.pack(pady=5, fill=X)  #------------------------------------

        self.keysL = Label(self.f3, text='Llaves en:')
        self.keysL.pack(side=LEFT)
        keysE = Entry(self.f3, textvariable=llaves, width=24)
        keysE.pack(side=LEFT, fill=X, expand=1)
        keysE.bind("<KeyRelease>", caps)

        self.askforL = Label(self.f3, text='Preguntar por:')
        self.askforL.pack(side=LEFT)
        askforE = Entry(self.f3, textvariable=preguntarx, width=24)
        askforE.pack(side=LEFT, fill=X, expand=1)
        askforE.bind("<KeyRelease>", caps)

        self.negociacionLF = LabelFrame(self.tab1, text="Valores Negociación")
        self.negociacionLF.pack(anchor=W, pady=5,
                                fill=X)  #----------------------

        self.f5a = Frame(self.negociacionLF)
        self.f5a.pack(pady=5, fill=X)  #---------------------------

        rent = Radiobutton(self.f5a,
                           text="Se Arrienda: ",
                           variable=fin,
                           value=1)

        rent.pack(side=LEFT)

        self.arriendoL = Label(self.f5a, text='Valor $')
        self.arriendoL.pack(side=LEFT)
        arriendoE = Entry(self.f5a, textvariable=vlrenta, width=15)
        arriendoE.pack(side=LEFT)

        self.admonL = Label(self.f5a, text='Administración $')
        self.admonL.pack(side=LEFT)
        admonE = Entry(self.f5a, textvariable=vladmon, width=15)
        admonE.pack(side=LEFT)

        include = Checkbutton(self.f5a,
                              text="Admin. incluida",
                              variable=incluida)
        include.pack(side=LEFT)

        self.f5b = Frame(self.negociacionLF)
        self.f5b.pack(pady=5, fill=X)  #---------------------------

        sale = Radiobutton(self.f5b, text="Se Vende: ", variable=fin, value=2)

        sale.pack(side=LEFT)

        self.ventaL = Label(self.f5b, text='Valor $')
        self.ventaL.pack(side=LEFT)
        ventaE = Entry(self.f5b, textvariable=vlventa, width=15)
        ventaE.pack(side=LEFT)

        self.avaluadoL = Label(self.f5b, text='Avaluado $')
        self.avaluadoL.pack(side=LEFT)
        avaluadoE = Entry(self.f5b, textvariable=vlavaluo, width=15)
        avaluadoE.pack(side=LEFT)

        self.comiL = Label(self.f5b, text='Comisión Venta')
        self.comiL.pack(side=LEFT)
        comiE = Entry(self.f5b, textvariable=comiventa, width=5)
        comiE.pack(side=LEFT)
        self.porcentL = Label(self.f5b, text='%')
        self.porcentL.pack(side=LEFT)

        self.pagoLF = LabelFrame(self.tab1, text="Detalles de pago")
        self.pagoLF.pack(anchor=W, pady=5, fill=X)  #-----------

        self.f6 = Frame(self.pagoLF)
        self.f6.pack(pady=5, fill=X)  #---------------------------

        self.pagopropietarioL = Label(self.f6, text='$ Pago Propietario:')
        self.pagopropietarioL.pack(side=LEFT)
        pagopropietarioE = Entry(self.f6, textvariable=pagoprop, width=10)
        pagopropietarioE.pack(side=LEFT, fill=X, expand=1)

        self.diapagopropietarioL = Label(self.f6, text='Día Pago Propietario:')
        self.diapagopropietarioL.pack(side=LEFT)
        diapagopropietarioE = Entry(self.f6, textvariable=fpagoprop, width=5)
        diapagopropietarioE.pack(side=LEFT)

        self.diapagoadmonL = Label(self.f6, text='Día Pago Admon:')
        self.diapagoadmonL.pack(side=LEFT)
        diapagoadmonE = Entry(self.f6, textvariable=fpagoadmin, width=5)
        diapagoadmonE.pack(side=LEFT)

        self.tab1.pack()

        #-----------------------> TAB 2

        self.tab2 = Frame(self.nb)
        self.tab2.pack()

        self.f0 = Frame(self.tab2)
        self.f0.pack(fill=X, pady=10)  #-------------------------------

        self.f1 = Frame(self.tab2)
        self.f1.pack(fill=X)  #-------------------------------

        self.propertyL = Label(self.f1, text='Tipo Propiedad:')
        self.propertyL.pack(side=LEFT)

        propertyCbx = Combobox(self.f1,
                               textvariable=tpropiedad,
                               values=propiedades,
                               width=15)
        propertyCbx.set('')
        propertyCbx.pack(side=LEFT)

        self.areaL = Label(self.f1, text='Área:')
        self.areaL.pack(side=LEFT)
        areaE = Entry(self.f1, textvariable=area, width=5)
        areaE.pack(side=LEFT)
        self.m2L = Label(self.f1, text='m2')
        self.m2L.pack(side=LEFT)

        self.emptyL = Label(self.f1)  ###VACIO###
        self.emptyL.pack(padx=5, side=LEFT)

        self.lineasL = Label(self.f1, text='# Líneas:')
        self.lineasL.pack(side=LEFT)
        lineasE = Entry(self.f1, textvariable=lineas, width=5)
        lineasE.pack(side=LEFT)

        self.roomL = Label(self.f1, text='# Habitaciones:')
        self.roomL.pack(side=LEFT)
        roomE = Entry(self.f1, textvariable=habitaciones, width=5)
        roomE.pack(side=LEFT)

        self.f2 = Frame(self.tab2)  #-------------------------------
        self.f2.pack(pady=5, fill=X)

        self.closetL = Label(self.f2, text='# Closets:')
        self.closetL.pack(side=LEFT)
        closetE = Entry(self.f2, textvariable=closets, width=5)
        closetE.pack(side=LEFT)

        self.lampL = Label(self.f2, text='# Lámparas:')
        self.lampL.pack(side=LEFT)
        lampE = Entry(self.f2, textvariable=lamparas, width=5)
        lampE.pack(side=LEFT)

        self.bathL = Label(self.f2, text='# Baños:')
        self.bathL.pack(side=LEFT)
        bathE = Entry(self.f2, textvariable=duchas, width=5)
        bathE.pack(side=LEFT)

        self.sinkL = Label(self.f2, text='# Lavamanos:')
        self.sinkL.pack(side=LEFT)
        sinkE = Entry(self.f2, textvariable=lavamanos, width=5)
        sinkE.pack(side=LEFT)

        self.f4 = Frame(self.tab2)
        self.f4.pack(pady=5, fill=X)  #-------------------------------

        self.salaL = Label(self.f4, text='Tipo Sala:')
        self.salaL.pack(side=LEFT)

        salasCbx = Combobox(self.f4, textvariable=tsala, values=salas)
        salasCbx.set('')
        salasCbx.pack(side=LEFT)

        self.cocinaL = Label(self.f4, text='Tipo Cocina:')
        self.cocinaL.pack(side=LEFT)

        cocinaCbx = Combobox(self.f4, textvariable=tcocina, values=cocina)
        cocinaCbx.set('')
        cocinaCbx.pack(side=LEFT)

        self.f5 = Frame(self.tab2)
        self.f5.pack(pady=5, fill=X)  #-------------------------------

        self.pisoL = Label(self.f5, text='Tipo Piso:')
        self.pisoL.pack(side=LEFT)

        pisoCbx = Combobox(self.f5, textvariable=tpiso, values=pisos)
        pisoCbx.set('')
        pisoCbx.pack(side=LEFT)

        self.garageL = Label(self.f5, text='Tipo garage:')
        self.garageL.pack(side=LEFT)

        garageCbx = Combobox(self.f5, textvariable=tgarage, values=garage)
        garageCbx.set('')
        garageCbx.pack(side=LEFT)

        self.f6 = Frame(self.tab2)  #-------------------------------
        self.f6.pack(pady=5, fill=X)

        self.rutaL = Label(self.f6, text='Ruta de Buses:')
        self.rutaL.pack(side=LEFT)
        rutaE = Entry(self.f6, textvariable=rutabus, width=30)
        rutaE.pack(side=LEFT)

        self.f7 = Frame(self.tab2)
        self.f7.pack(pady=5, fill=X)  #-------------------------------

        self.comodidades = LabelFrame(self.f7, text="Comodidades:")
        self.comodidades.pack(anchor=W, pady=5, fill=X,
                              expand=1)  #----------------------

        chkb0 = Checkbutton(self.comodidades,
                            text="ALCOBA DE SERVICIO",
                            variable=aservicio)
        chkb0.grid(row=0, column=0, sticky=W)
        chkb1 = Checkbutton(self.comodidades,
                            text="ASCENSOR",
                            variable=ascensor)
        chkb1.grid(row=0, column=1, sticky=W)
        chkb2 = Checkbutton(self.comodidades,
                            text="CITÓFONO",
                            variable=citofono)
        chkb2.grid(row=0, column=2, sticky=W)
        chkb3 = Checkbutton(self.comodidades,
                            text="AGUA CALIENTE",
                            variable=aguacaliente)
        chkb3.grid(row=0, column=3, sticky=W)

        chkb4 = Checkbutton(self.comodidades,
                            text="BIBLIOTECA",
                            variable=biblioteca)
        chkb4.grid(row=1, column=0, sticky=W)
        chkb5 = Checkbutton(self.comodidades,
                            text="ZONAS VERDES",
                            variable=zverdes)
        chkb5.grid(row=1, column=1, sticky=W)
        chkb6 = Checkbutton(self.comodidades, text="TERRAZA", variable=terraza)
        chkb6.grid(row=1, column=2, sticky=W)
        chkb7 = Checkbutton(self.comodidades,
                            text="TRIFILAR",
                            variable=trifilar)
        chkb7.grid(row=1, column=3, sticky=W)

        chkb8 = Checkbutton(self.comodidades,
                            text="PARQUEADERO VISITANTES",
                            variable=parqueadero)
        chkb8.grid(row=2, column=0, sticky=W)

        self.f9 = Frame(self.tab2)
        self.f9.pack(pady=5, fill=X)  #------------------------------------

        self.notesL = Label(self.f9, text='Observaciones:')
        self.notesL.pack(side=LEFT)

        self.f10 = Frame(self.tab2)
        self.f10.pack(pady=5, fill=X)  #-----------------------------------

        observaciones = Text(self.f10, height=5)
        observaciones.pack(side=LEFT, fill=X, expand=1)

        #---------------------------------------------------------------

        self.nb.add(self.tab1, text="Datos Generales")
        self.nb.add(self.tab2, text="Inventario y Comodidades")

        self.nb.pack()

        #=========================== BOTONES ===========================

        self.fBtn = Frame(self.wrapper)
        self.fBtn.pack()  #-------------------------------

        clean = Button(self.fBtn,
                       text='Limpiar',
                       bg='navy',
                       foreground='white',
                       activebackground='red3',
                       activeforeground='white',
                       command=limpiar)
        clean.pack(side=RIGHT)

        update = Button(self.fBtn,
                        text='Actualizar',
                        bg='navy',
                        foreground='white',
                        activebackground='red3',
                        activeforeground='white',
                        command=actualizar,
                        state=DISABLED)
        update.pack(side=RIGHT)

        add = Button(self.fBtn,
                     text='Agregar',
                     bg='navy',
                     foreground='white',
                     activebackground='red3',
                     activeforeground='white',
                     command=Agregar)
        add.pack(side=RIGHT)

        #========================= ASIDE ===========================

        self.aside = Frame(self)
        self.aside.pack(side=TOP, fill=BOTH)

        self.wrap1 = Frame(self.aside)
        self.wrap1.pack()

        self.viewer = Label(self.wrap1, text="LISTA DE INMUEBLES")
        self.viewer.pack()

        scroll = Scrollbar(self.wrap1, orient=VERTICAL)
        scroll.pack(side=RIGHT, fill=Y)
        lb = Listbox(self.wrap1,
                     yscrollcommand=scroll.set,
                     height=20,
                     width=30,
                     bg='#d8ecf3')
        scroll.config(command=lb.yview)
        lb.pack(fill=BOTH)
        lb.bind("<Double-Button-1>", callback)

        self.wrap2 = Frame(self.aside)
        self.wrap2.pack()

        self.updateBP = Button(self.wrap2,
                               text='Cargar lista',
                               bg='navy',
                               foreground='white',
                               activebackground='red3',
                               activeforeground='white',
                               command=cargar_lista)
        self.updateBP.pack(fill=X)

        delete = Button(self.wrap2,
                        text='Borrar',
                        bg='navy',
                        foreground='white',
                        activebackground='red3',
                        activeforeground='white',
                        command=borrar)
        delete.pack(fill=X)

        edit = Button(self.wrap2,
                      text='Modificar',
                      bg='navy',
                      foreground='white',
                      activebackground='red3',
                      activeforeground='white',
                      command=modificar)
        edit.pack(fill=X)

        buscador = Label(self.wrap2, text="Buscar por Código:")
        buscador.pack()
        E = Entry(self.wrap2, textvariable=busqueda, width=24)
        E.pack()
        E.bind("<KeyRelease>", caps)
예제 #34
0
    def __init__(self, master):

        self.fname = ""
        #global variables
        self.t1 = StringVar()
        self.t2 = StringVar()
        self.t3 = StringVar()
        self.t4 = StringVar()
        self.t5 = StringVar()
        self.t6 = StringVar()
        self.t7 = StringVar()
        self.t8 = StringVar()
        self.t9 = StringVar()
        self.t10 = StringVar()

        self.var1 = StringVar()
        self.var2 = StringVar()
        self.var3 = StringVar()
        self.var4 = StringVar()
        self.var5 = StringVar()
        self.var6 = StringVar()
        self.var7 = StringVar()
        self.var8 = StringVar()
        self.var9 = StringVar()
        self.var10 = StringVar()
        #end

        mymaster = Frame(master, name='mymaster')  # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window
        #master.minsize(width=900, height=900)
        #master.maxsize(width=650, height=500)
        #end

        #title of window
        master.title("Airdrop-ng")
        #end

        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont = tkFont.Font(family="Helvetica",
                                      size=15,
                                      underline=True)
        self.myfontnew = tkFont.Font(family="Helvetica",
                                     size=11,
                                     underline=True)
        #end

        nb = Notebook(mymaster, name='nb')  # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3)  # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb, name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1")  # add tab to Notebook
        self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")

        # repeat for each tab

        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")

        #End

        #frame content 7
        Label(self.frame_content7,
              text='Airdrop-ng',
              font=self.headerfont,
              bg="white",
              padx=10,
              pady=10).grid(row=0, column=0)
        btndetect = Button(self.frame_content7,
                           text='Detect',
                           command=self.canvas_detect,
                           height=2,
                           width=15,
                           font=self.customFont).grid(row=1,
                                                      column=0,
                                                      padx=5,
                                                      pady=5)

        btndbrowse = Button(self.frame_content7,
                            text='Attach File',
                            command=self.browse_file,
                            height=2,
                            width=15,
                            font=self.customFont).grid(row=3,
                                                       column=0,
                                                       padx=5,
                                                       pady=5)
        self.lilnew1 = Listbox(self.frame_content7,
                               bg="black",
                               fg="white",
                               font=self.myfont,
                               selectmode=SINGLE,
                               width=30,
                               height=15)
        self.lilnew1.grid(row=1, column=1, rowspan=3)
        #End

        Label(self.frame_content,
              text='Airdrop-ng',
              font=self.headerfont,
              bg="white",
              padx=10,
              pady=10).grid(row=0, column=0)
        Label(self.frame_content,
              text='Options :',
              font=self.myfontnew,
              bg="white").grid(row=1, column=1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5,
              text='Edit Command From Here',
              font=self.myfontnew,
              bg="white",
              justify=LEFT).grid(row=0, column=0)
        TextCommandBox = Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output = Text(self.frame_content5,
                           bg="black",
                           fg="white",
                           font=self.myfont,
                           height=20,
                           width=42)
        self.output.grid(row=0, column=1, padx=50, pady=5, rowspan=3)
        btnsubmit = Button(self.frame_content5,
                           width=15,
                           height=2,
                           text="Get Result",
                           command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear = Button(self.frame_content5,
                          width=15,
                          height=2,
                          text="Clear Output",
                          command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-i", \
                 onvalue = "-i", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var1)
        self.C1.grid(row=2, column=0, padx=5, pady=5)
        self.t1 = Text(self.frame_content, height=1, width=20)
        self.t1.grid(row=2, column=1, padx=5, pady=5)
        l1 = Label(self.frame_content,
                   text=': Wireless card in monitor mode to inject from',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=2, column=2, padx=5, pady=5)

        self.C2 = Checkbutton(self.frame_content, text = "-t", \
                 onvalue = "-t", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var2)
        self.C2.grid(row=3, column=0, padx=5, pady=5)
        self.t2 = Text(self.frame_content, height=1, width=20)
        self.t2.grid(row=3, column=1, padx=5, pady=5)
        l2 = Label(self.frame_content,
                   text=': Airodump txt file in CSV format NOT the pcap',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=3, column=2, padx=5, pady=5)

        self.C3 = Checkbutton(self.frame_content, text = "-p", \
                 onvalue = "-p", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row=4, column=0, padx=5, pady=5)
        self.t3 = Text(self.frame_content, height=1, width=20)
        self.t3.grid(row=4, column=1, padx=5, pady=5)
        l3 = Label(self.frame_content,
                   text=': Disable the use of Psyco JIT',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=4, column=2, padx=5, pady=5)

        self.C4 = Checkbutton(self.frame_content, text = "-r", \
                 onvalue = "-r", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var4)
        self.C4.grid(row=5, column=0, padx=5, pady=5)
        self.t4 = Text(self.frame_content, height=1, width=20)
        self.t4.grid(row=5, column=1, padx=5, pady=5)
        l4 = Label(self.frame_content,
                   text=': Rule File for matched deauths)',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=5, column=2, padx=5, pady=5)

        self.C5 = Checkbutton(self.frame_content, text = "-u", \
                 onvalue = "-u", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var5)
        self.C5.grid(row=6, column=0, padx=5, pady=5)
        self.t5 = Text(self.frame_content, height=1, width=20)
        self.t5.grid(row=6, column=1, padx=5, pady=5)
        l5 = Label(self.frame_content,
                   text=': Updates OUI list.',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=6, column=2, padx=5, pady=5)

        self.C6 = Checkbutton(self.frame_content, text = "-d", \
                 onvalue = "-d", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var6)
        self.C6.grid(row=8, column=0, padx=5, pady=5)
        self.t6 = Text(self.frame_content, height=1, width=20)
        self.t6.grid(row=8, column=1, padx=5, pady=5)
        l6 = Label(self.frame_content,
                   text=': Injection driver. Default is mac80211.',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=8, column=2, padx=5, pady=5)

        self.C7 = Checkbutton(self.frame_content, text = "-s", \
                 onvalue = "-s", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var7)
        self.C7.grid(row=9, column=0, padx=5, pady=5)
        self.t7 = Text(self.frame_content, height=1, width=20)
        self.t7.grid(row=9, column=1, padx=5, pady=5)
        l7 = Label(self.frame_content,
                   text=': Time to sleep between sending each packet',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=9, column=2, padx=5, pady=5)

        self.C8 = Checkbutton(self.frame_content, text = "-b", \
                onvalue = "-b", offvalue = "", height=1, \
                width = 7, bg="white", font=self.customFont,variable=self.var8)
        self.C8.grid(row=10, column=0, padx=5, pady=5)
        self.t8 = Text(self.frame_content, height=1, width=20)
        self.t8.grid(row=10, column=1, padx=5, pady=5)
        l8 = Label(self.frame_content,
                   text=': Turn on Rule Debugging',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=10, column=2, padx=5, pady=5)

        self.C9 = Checkbutton(self.frame_content, text = "-l", \
                onvalue = "-l", offvalue = "", height=1, \
                width = 7, bg="white", font=self.customFont,variable=self.var9)
        self.C9.grid(row=11, column=0, padx=5, pady=5)
        self.t9 = Text(self.frame_content, height=1, width=20)
        self.t9.grid(row=11, column=1, padx=5, pady=5)
        l9 = Label(self.frame_content,
                   text=': Enable Logging to a file',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=11, column=2, padx=5, pady=5)

        self.C10 = Checkbutton(self.frame_content, text = "-n", \
                onvalue = "-n", offvalue = "", height=1, \
                width = 7, bg="white", font=self.customFont,variable=self.var10)
        self.C10.grid(row=12, column=0, padx=5, pady=5)
        self.t10 = Text(self.frame_content, height=1, width=20)
        self.t10.grid(row=12, column=1, padx=5, pady=5)
        l10 = Label(self.frame_content,
                    text=': Time to sleep between loops',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=12, column=2, padx=5, pady=5)
예제 #35
0
def report_cash(master, from_date=None, to_date=None, reason=None):
    """Создает и выводи на экран окно с отчетом по блокноту расходов"""


    def press(index):
        """функция, срабатывающая при нажатии кнопок переключения
        между видами сортировок. Переключает вкладки в блокноте"""

        window_names = tabs.tabs()
        tabs.select(window_names[index])


    def make_query_cash(from_date=None, to_date=None, reason=None):
        """Возвращает кортеж запросов для последующего использования при
        составлении отчета по расходам"""

        select = queries.report_cash_query()

        if reason:
            for q in range(len(select)):
                new_select = []
                for element in select[q]:
                    if element.reason == reason:
                        new_select.append(element)
                select[q] = new_select

        if from_date and to_date:
            for q in range(len(select)):
                new_select = []
                for element in select[q]:
                    if (element.date_time >= from_date) and \
                       (element.date_time <= to_date + timedelta(days=1)):
                        new_select.append(element)
                select[q] = new_select

        elif from_date:
            for q in range(len(select)):
                new_select = []
                for element in select[q]:
                    if element.date_time >= from_date:
                        new_select.append(element)
                select[q] = new_select

        elif to_date:
            for q in range(len(select)):
                new_select = []
                for element in select[q]:
                    if element.date_time <= to_date + timedelta(days=1):
                        new_select.append(element)
                select[q] = new_select

        return select


    def show(frame, iterator):
        """Выводит на экран выборку, заданную в iterator"""

        scrollbar = Scrollbar(frame)
        tree = Treeview(frame, selectmode='none', padding=3,
                                    style='Custom.Treeview', height=REPORT_HEIGHT,
                                    yscrollcommand=scrollbar.set)
        tree.pack(side=LEFT, fill=BOTH, expand=YES)
        scrollbar.config(command=tree.yview)
        scrollbar.pack(side=LEFT, fill=Y)

        tree.tag_configure('1', font=('Verdana', FONT_SIZE_REPORT))
        tree.tag_configure('2', font=('Verdana', FONT_SIZE_REPORT),
                                                           background='#f5f5ff')

        Style().configure('Custom.Treeview', rowheight=FONT_SIZE_REPORT*2)

        columns = ['#' + str(x + 1) for x in range(5)]
        tree.configure(columns=columns)

        for q in range(len(header)):
            tree.heading('#%d' % (q + 1), text=header[q], anchor='w')
            tree.column('#%d' % (q + 1), width=REPORT_SCALE * col_width[q + 1],
                                                                     anchor='w')
        tree.heading('#0', text='', anchor='w')
        tree.column('#0', width=0, anchor='w', minwidth=0)

        flag = True
        for item in iterator:
            col = []
            col.append(add_s(item.reason.text))
            col.append(add_s(item.summ))
            col.append(add_s(item.comment))
            col.append(add_s(item.date_time.strftime('%d.%m.%Y')))
            col.append(add_s(item.date_time.time())[:8])

            flag = not flag
            if flag:
                tree.insert('', 'end', text='', values=col, tag='2')
            else:
                tree.insert('', 'end', text='', values=col, tag='1')

    # --------------------------------------------#

    tl = Toplevel(master)
    tl.title(u'Отчет по расходам')

    bottom = Frame(tl, relief=SUNKEN)
    bottom.pack(side=BOTTOM, fill=X)

    showArea = []
    tabs = Notebook(tl, style='Hidden.TNotebook')
    for q in range (2):
        frame = Frame(tabs,  height=REPORT_HEIGHT)
        tabs.add(frame, text='')
        showArea.append(frame)
    tabs.pack(side=TOP, fill=BOTH, expand=YES)
    Style().layout('Hidden.TNotebook.Tab', '')

    header = (u'Причина', u'Сумма', u'Комментарий', u'Дата', u'Время')

    col_width = (0, 30, 10, 50, 16, 16)

    query = make_query_cash(from_date, to_date, reason)
    for q in range(len(query)):
        summ = show(showArea[q], query[q])


    Button(bottom, text=u'Сортировка\nпо причине', command=lambda: press(0)
                             ).pack(side=LEFT, padx=REPORT_PAD, pady=REPORT_PAD)

    Button(bottom, text=u'Сортировка\nпо времени', command=lambda:press(1)
                             ).pack(side=LEFT, padx=REPORT_PAD, pady=REPORT_PAD)

    Button(bottom, text=u'Экспорт в\nMS Excel').pack(
                                   side=RIGHT, padx=REPORT_PAD, pady=REPORT_PAD)

    tl.focus_set()
예제 #36
0
    def __init__(self, master):
        self.fname = ""
        self.t1 = StringVar()
        self.t2 = StringVar()
        self.t3 = StringVar()
        self.t4 = StringVar()
        self.var1 = StringVar()
        self.var2 = StringVar()
        self.var3 = StringVar()
        self.var4 = StringVar()

        mymaster = Frame(master, name='mymaster')  # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window
        #master.minsize(width=900, height=900)
        #master.maxsize(width=550, height=350)
        #end

        #title of window
        master.title("Airserv-ng")
        #end

        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont = tkFont.Font(family="Helvetica",
                                      size=15,
                                      underline=True)
        self.myfontnew = tkFont.Font(family="Helvetica",
                                     size=11,
                                     underline=True)
        #end

        nb = Notebook(mymaster, name='nb')  # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3)  # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb, name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1")  # add tab to Notebook

        # repeat for each tab
        self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")
        #End
        #frame content 7
        Label(self.frame_content7,
              text='Aigraph-ng',
              font=self.headerfont,
              bg="white",
              padx=10,
              pady=10).grid(row=0, column=0)
        btndetect = Button(self.frame_content7,
                           text='Detect',
                           command=self.canvas_detect,
                           height=2,
                           width=15,
                           font=self.customFont).grid(row=1,
                                                      column=0,
                                                      padx=5,
                                                      pady=5)

        btndbrowse = Button(self.frame_content7,
                            text='Attach File',
                            command=self.browse_file,
                            height=2,
                            width=15,
                            font=self.customFont).grid(row=3,
                                                       column=0,
                                                       padx=5,
                                                       pady=5)
        self.lilnew1 = Listbox(self.frame_content7,
                               bg="black",
                               fg="white",
                               font=self.myfont,
                               selectmode=SINGLE,
                               width=30,
                               height=15)
        self.lilnew1.grid(row=1, column=1, rowspan=3)
        #End

        Label(self.frame_content,
              text='Airserv-ng',
              font=self.headerfont,
              bg="white",
              padx=10,
              pady=10).grid(row=0, column=0)
        Label(self.frame_content,
              text='Options :',
              font=self.myfontnew,
              bg="white").grid(row=1, column=1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5,
              text='Edit Command From Here',
              font=self.myfontnew,
              bg="white",
              justify=LEFT).grid(row=0, column=0)
        TextCommandBox = Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output = Text(self.frame_content5,
                           bg="black",
                           fg="white",
                           font=self.myfont,
                           height=15,
                           width=30)
        self.output.grid(row=0, column=1, padx=50, pady=5, rowspan=3)
        btnsubmit = Button(self.frame_content5,
                           width=15,
                           height=2,
                           text="Get Result",
                           command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear = Button(self.frame_content5,
                          width=15,
                          height=2,
                          text="Clear Output",
                          command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-p", \
                 onvalue="-p",offvalue="", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var1)
        self.C1.grid(row=2, column=0, padx=5, pady=5)
        self.t1 = Text(self.frame_content, height=1, width=20)
        self.t1.grid(row=2, column=1, padx=5, pady=5)
        l1 = Label(self.frame_content,
                   text=': TCP port to listen on. Defaults to 666.',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=2, column=2, padx=5, pady=5)

        self.C2 = Checkbutton(self.frame_content, text = "-d", \
                 onvalue = "-d", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var2)
        self.C2.grid(row=3, column=0, padx=5, pady=5)
        self.t2 = Text(self.frame_content, height=1, width=20)
        self.t2.grid(row=3, column=1, padx=5, pady=5)
        l2 = Label(self.frame_content,
                   text=': wifi device to serve.',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=3, column=2, padx=5, pady=5)

        self.C3 = Checkbutton(self.frame_content, text = "-c", \
                 onvalue = "-c", offvalue ="", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row=4, column=0, padx=5, pady=5)
        self.t3 = Text(self.frame_content, height=1, width=20)
        self.t3.grid(row=4, column=1, padx=5, pady=5)
        l3 = Label(self.frame_content,
                   text=':   Channel to start on.',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=4, column=2, padx=5, pady=5)

        self.C4 = Checkbutton(self.frame_content, text = "-v", \
                 onvalue = "-v", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var4)
        self.C4.grid(row=5, column=0, padx=5, pady=5)
        self.t4 = Text(self.frame_content, height=1, width=20)
        self.t4.grid(row=5, column=1, padx=5, pady=5)
        l4 = Label(self.frame_content,
                   text=': debug level.',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=5, column=2, padx=5, pady=5)
예제 #37
0
    def __init__(self, master):

        self.fname = ""
        #global variables
        self.t1 = StringVar()
        self.t2 = StringVar()
        self.t3 = StringVar()
        self.t4 = StringVar()
        self.t5 = StringVar()
        self.t6 = StringVar()
        self.t7 = StringVar()
        self.t8 = StringVar()
        self.t9 = StringVar()
        self.t10 = StringVar()
        self.t11 = StringVar()
        self.t12 = StringVar()
        self.t13 = StringVar()
        self.t14 = StringVar()
        self.t15 = StringVar()
        self.t16 = StringVar()
        self.t17 = StringVar()
        self.t18 = StringVar()
        self.t19 = StringVar()
        self.t20 = StringVar()
        self.t21 = StringVar()
        self.t22 = StringVar()
        self.t23 = StringVar()
        self.t24 = StringVar()
        self.t25 = StringVar()
        self.t26 = StringVar()
        self.t27 = StringVar()
        self.t28 = StringVar()
        self.t29 = StringVar()
        self.t30 = StringVar()
        self.t31 = StringVar()
        self.t32 = StringVar()
        self.t33 = StringVar()
        self.t34 = StringVar()

        self.var1 = StringVar()
        self.var2 = StringVar()
        self.var3 = StringVar()
        self.var4 = StringVar()
        self.var5 = StringVar()
        self.var6 = StringVar()
        self.var7 = StringVar()
        self.var8 = StringVar()
        self.var9 = StringVar()
        self.var10 = StringVar()
        self.var11 = StringVar()
        self.var12 = StringVar()
        self.var13 = StringVar()
        self.var14 = StringVar()
        self.var15 = StringVar()
        self.var16 = StringVar()
        self.var17 = StringVar()
        self.var18 = StringVar()
        self.var19 = StringVar()
        self.var20 = StringVar()
        self.var21 = StringVar()
        self.var22 = StringVar()
        self.var23 = StringVar()
        self.var24 = StringVar()
        self.var25 = StringVar()
        self.var26 = StringVar()
        self.var27 = StringVar()
        self.var28 = StringVar()
        self.var29 = StringVar()
        self.var30 = StringVar()
        self.var31 = StringVar()
        self.var32 = StringVar()
        self.var33 = StringVar()
        self.var34 = StringVar()
        #end

        mymaster = Frame(master, name='mymaster')  # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window
        #master.minsize(width=900, height=900)
        #master.maxsize(width=650, height=385)
        #end

        #title of window
        master.title("Airbase-ng")
        #end

        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont = tkFont.Font(family="Helvetica",
                                      size=15,
                                      underline=True)
        self.myfontnew = tkFont.Font(family="Helvetica",
                                     size=11,
                                     underline=True)
        #end

        nb = Notebook(mymaster, name='nb')  # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3)  # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb, name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1")  # add tab to Notebook

        # repeat for each tab
        self.frame_content2 = Frame(nb, name='frame_content2', bg="white")
        nb.add(self.frame_content2, text="Filter-2")
        self.frame_content3 = Frame(nb, name='frame_content3', bg="white")
        nb.add(self.frame_content3, text="Filter-3")
        self.frame_content4 = Frame(nb, name='frame_content4', bg="white")
        nb.add(self.frame_content4, text="Filter-4")
        self.frame_content6 = Frame(nb, name='frame_content6', bg="white")
        nb.add(self.frame_content6, text="Filter-5")
        self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")

        #End
        #frame content 7
        Label(self.frame_content7,
              text='Airbase-ng',
              font=self.headerfont,
              bg="white",
              padx=10,
              pady=10).grid(row=0, column=0)
        btndetect = Button(self.frame_content7,
                           text='Detect',
                           command=self.canvas_detect,
                           height=2,
                           width=15,
                           font=self.customFont).grid(row=1,
                                                      column=0,
                                                      padx=5,
                                                      pady=5)

        btndbrowse = Button(self.frame_content7,
                            text='Attach File',
                            command=self.browse_file,
                            height=2,
                            width=15,
                            font=self.customFont).grid(row=3,
                                                       column=0,
                                                       padx=5,
                                                       pady=5)
        self.lilnew1 = Listbox(self.frame_content7,
                               bg="black",
                               fg="white",
                               font=self.myfont,
                               selectmode=SINGLE,
                               width=30,
                               height=15)
        self.lilnew1.grid(row=1, column=1, rowspan=3)
        #End

        Label(self.frame_content,
              text='Airbase-ng',
              font=self.headerfont,
              bg="white",
              padx=10,
              pady=10).grid(row=0, column=0)
        Label(self.frame_content,
              text='Options :',
              font=self.myfontnew,
              bg="white").grid(row=1, column=1)
        #command Listbox
        Label(self.frame_content5,
              text='Edit Command From Here',
              font=self.myfontnew,
              bg="white",
              justify=LEFT).grid(row=0, column=0)
        TextCommandBox = Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output = Text(self.frame_content5,
                           bg="black",
                           fg="white",
                           font=self.myfont,
                           height=20,
                           width=42)
        self.output.grid(row=0, column=1, padx=50, pady=5, rowspan=3)
        btnsubmit = Button(self.frame_content5,
                           width=15,
                           height=2,
                           text="Get Result",
                           command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear = Button(self.frame_content5,
                          width=15,
                          height=2,
                          text="Clear Output",
                          command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-a", \
                 onvalue = "-a", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var1)
        self.C1.grid(row=2, column=0, padx=5, pady=5)
        self.t1 = Text(self.frame_content, height=1, width=20)
        self.t1.grid(row=2, column=1, padx=5, pady=5)
        l1 = Label(self.frame_content,
                   text=': set Access Point MAC address',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=2, column=2, padx=5, pady=5)

        self.C2 = Checkbutton(self.frame_content, text = "-i", \
                 onvalue = "-i", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var2)
        self.C2.grid(row=3, column=0, padx=5, pady=5)
        self.t2 = Text(self.frame_content, height=1, width=20)
        self.t2.grid(row=3, column=1, padx=5, pady=5)
        l2 = Label(self.frame_content,
                   text=': capture packets from this interface',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=3, column=2, padx=5, pady=5)

        self.C3 = Checkbutton(self.frame_content, text = "-w", \
                 onvalue = "-w", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row=4, column=0, padx=5, pady=5)
        self.t3 = Text(self.frame_content, height=1, width=20)
        self.t3.grid(row=4, column=1, padx=5, pady=5)
        l3 = Label(self.frame_content,
                   text=': use this WEP key to encrypt/decrypt packets',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=4, column=2, padx=5, pady=5)

        self.C4 = Checkbutton(self.frame_content, text = "-h", \
                 onvalue = "-h", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var4)
        self.C4.grid(row=5, column=0, padx=5, pady=5)
        self.t4 = Text(self.frame_content, height=1, width=20)
        self.t4.grid(row=5, column=1, padx=5, pady=5)
        l4 = Label(self.frame_content,
                   text=': source mac for MITM mode',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=5, column=2, padx=5, pady=5)

        self.C5 = Checkbutton(self.frame_content, text = "-f", \
                 onvalue = "-f", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var5)
        self.C5.grid(row=6, column=0, padx=5, pady=5)
        self.t5 = Text(self.frame_content, height=1, width=20)
        self.t5.grid(row=6, column=1, padx=5, pady=5)
        l5 = Label(self.frame_content,
                   text=': disallow specified client MACs (default: allow)',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=6, column=2, padx=5, pady=5)

        self.C6 = Checkbutton(self.frame_content, text = "-W", \
                 onvalue = "-W", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var6)
        self.C6.grid(row=7, column=0, padx=5, pady=5)
        self.t6 = Text(self.frame_content, height=1, width=20)
        self.t6.grid(row=7, column=1, padx=5, pady=5)
        l6 = Label(
            self.frame_content,
            text=': [don\'t] set WEP flag in beacons 0|1 (default: auto)',
            font=self.myfont,
            bg="white",
            justify=LEFT).grid(row=7, column=2, padx=5, pady=5)

        self.C7 = Checkbutton(self.frame_content, text = "-q", \
                 onvalue = "-q", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var7)
        self.C7.grid(row=8, column=0, padx=5, pady=5)
        self.t7 = Text(self.frame_content, height=1, width=20)
        self.t7.grid(row=8, column=1, padx=5, pady=5)
        l7 = Label(self.frame_content,
                   text=': quiet (do not print statistics)',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=8, column=2, padx=5, pady=5)

        self.C8 = Checkbutton(self.frame_content2, text = "-v", \
                 onvalue = "-v", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var8)
        self.C8.grid(row=9, column=0, padx=5, pady=5)
        self.t8 = Text(self.frame_content2, height=1, width=20)
        self.t8.grid(row=9, column=1, padx=5, pady=5)
        l8 = Label(self.frame_content2,
                   text=':  verbose (print more messages) (long --verbose)',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=9, column=2, padx=5, pady=5)

        self.C9 = Checkbutton(self.frame_content2, text = "-M", \
                 onvalue = "-M", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var9)
        self.C9.grid(row=10, column=0, padx=5, pady=5)
        self.t9 = Text(self.frame_content2, height=1, width=20)
        self.t9.grid(row=10, column=1, padx=5, pady=5)
        l9 = Label(self.frame_content2,
                   text=': M-I-T-M between [specified] clients and bssids',
                   font=self.myfont,
                   bg="white",
                   justify=LEFT).grid(row=10, column=2, padx=5, pady=5)

        Label(self.frame_content2,
              text='Airbase-ng',
              font=self.headerfont,
              bg="white",
              padx=10,
              pady=10).grid(row=0, column=0)

        self.C10 = Checkbutton(self.frame_content2, text = "-A", \
                 onvalue = "-A", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var10)
        self.C10.grid(row=11, column=0, padx=5, pady=5)
        self.t10 = Text(self.frame_content2, height=1, width=20)
        self.t10.grid(row=11, column=1, padx=5, pady=5)
        l10 = Label(
            self.frame_content2,
            text=': Ad-Hoc Mode (allows other clients to peer) (long --ad-hoc)',
            font=self.myfont,
            bg="white",
            justify=LEFT).grid(row=11, column=2, padx=5, pady=5)

        self.C11 = Checkbutton(self.frame_content2, text = "-Y", \
                 onvalue = "-Y", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var11)
        self.C11.grid(row=12, column=0, padx=5, pady=5)
        self.t11 = Text(self.frame_content2, height=1, width=20)
        self.t11.grid(row=12, column=1, padx=5, pady=5)
        l11 = Label(self.frame_content2,
                    text=': external packet processing',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=12, column=2, padx=5, pady=5)

        self.C12 = Checkbutton(self.frame_content2, text = "-c", \
                 onvalue = "-c", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var12)
        self.C12.grid(row=13, column=0, padx=5, pady=5)
        self.t12 = Text(self.frame_content2, height=1, width=20)
        self.t12.grid(row=13, column=1, padx=5, pady=5)
        l12 = Label(self.frame_content2,
                    text=': sets the channel the AP is running on',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=13, column=2, padx=5, pady=5)

        self.C13 = Checkbutton(self.frame_content2, text = "-X", \
                 onvalue = "-X", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var13)
        self.C13.grid(row=14, column=0, padx=5, pady=5)
        self.t13 = Text(self.frame_content2, height=1, width=20)
        self.t13.grid(row=14, column=1, padx=5, pady=5)
        l13 = Label(self.frame_content2,
                    text=': hidden ESSID (long --hidden)',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=14, column=2, padx=5, pady=5)

        self.C14 = Checkbutton(self.frame_content2, text = "-s", \
                 onvalue = "-s", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var14)
        self.C14.grid(row=15, column=0, padx=5, pady=5)
        self.t14 = Text(self.frame_content2, height=1, width=20)
        self.t14.grid(row=15, column=1, padx=5, pady=5)
        l14 = Label(self.frame_content2,
                    text=': force shared key authentication',
                    font=self.myfont,
                    bg="white").grid(row=15, column=2, padx=5, pady=5)

        Label(self.frame_content3,
              text='Airbase-ng',
              font=self.headerfont,
              bg="white",
              padx=10,
              pady=10).grid(row=0, column=0)
        Label(self.frame_content3,
              text='Filter Options :',
              font=self.myfontnew,
              bg="white",
              justify=LEFT).grid(row=16, column=1)

        self.C15 = Checkbutton(self.frame_content3, text = "-S", \
                 onvalue = "-S", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var15)
        self.C15.grid(row=17, column=0, padx=5, pady=5)
        self.t15 = Text(self.frame_content3, height=1, width=20)
        self.t15.grid(row=17, column=1, padx=5, pady=5)
        l15 = Label(self.frame_content3,
                    text=': set shared key challenge length (default: 128)',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=17, column=2, padx=5, pady=5)

        self.C16 = Checkbutton(self.frame_content3, text = "-L", \
                 onvalue = "-L", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var16)
        self.C16.grid(row=18, column=0, padx=5, pady=5)
        self.t16 = Text(self.frame_content3, height=1, width=20)
        self.t16.grid(row=18, column=1, padx=5, pady=5)
        l16 = Label(self.frame_content3,
                    text=': Caffe-Latte attack (long --caffe-latte)',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=18, column=2, padx=5, pady=5)

        self.C17 = Checkbutton(self.frame_content3, text = "-N", \
                 onvalue = "-N", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var17)
        self.C17.grid(row=19, column=0, padx=5, pady=5)
        self.t17 = Text(self.frame_content3, height=1, width=20)
        self.t17.grid(row=19, column=1, padx=5, pady=5)
        l17 = Label(
            self.frame_content3,
            text=':  creates arp request against wep client (long cfrag)',
            font=self.myfont,
            bg="white",
            justify=LEFT).grid(row=19, column=2, padx=5, pady=5)


        self.C18 = Checkbutton(self.frame_content3, text = "-x", \
                 onvalue = "-x", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var18)
        self.C18.grid(row=21, column=0, padx=5, pady=5)
        self.t18 = Text(self.frame_content3, height=1, width=20)
        self.t18.grid(row=21, column=1, padx=5, pady=5)
        l18 = Label(self.frame_content3,
                    text=': number of packets per second (default: 100)',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=21, column=2, padx=5, pady=5)

        self.C19 = Checkbutton(self.frame_content3, text = "-y", \
                 onvalue = "-y", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var19)
        self.C19.grid(row=22, column=0, padx=5, pady=5)
        self.t19 = Text(self.frame_content3, height=1, width=20)
        self.t19.grid(row=22, column=1, padx=5, pady=5)
        l19 = Label(self.frame_content3,
                    text=': disables responses to broadcast probes',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=22, column=2, padx=5, pady=5)

        Label(self.frame_content4,
              text='Airbase-ng',
              font=self.headerfont,
              bg="white",
              padx=10,
              pady=10).grid(row=0, column=0)

        self.C20 = Checkbutton(self.frame_content4, text = "--o", \
                 onvalue = "--o", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var20)
        self.C20.grid(row=23, column=0, padx=5, pady=5)
        self.t20 = Text(self.frame_content4, height=1, width=20)
        self.t20.grid(row=23, column=1, padx=5, pady=5)
        l20 = Label(
            self.frame_content4,
            text=': set all WPA,WEP,open tags. can\'t be used with -z & -Z',
            font=self.myfont,
            bg="white",
            justify=LEFT).grid(row=23, column=2, padx=5, pady=5)

        self.C21 = Checkbutton(self.frame_content4, text = "-z", \
                 onvalue = "-z", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var21)
        self.C21.grid(row=24, column=0, padx=5, pady=5)
        self.t21 = Text(self.frame_content4, height=1, width=20)
        self.t21.grid(row=24, column=1, padx=5, pady=5)
        l21 = Label(
            self.frame_content4,
            text=':  sets WPA1 tags. 1=WEP40 2=TKIP 3=WRAP 4=CCMP 5=WEP104',
            font=self.myfont,
            bg="white",
            justify=LEFT).grid(row=24, column=2, padx=5, pady=5)

        self.C22 = Checkbutton(self.frame_content4, text = "-Z", \
                 onvalue = "-Z", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var22)
        self.C22.grid(row=25, column=0, padx=5, pady=5)
        self.t22 = Text(self.frame_content4, height=1, width=20)
        self.t22.grid(row=25, column=1, padx=5, pady=5)
        l22 = Label(self.frame_content4,
                    text=':  same as -z, but for WPA2',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=25, column=2, padx=5, pady=5)

        self.C23 = Checkbutton(self.frame_content4, text = "-V", \
                 onvalue = "-V", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var23)
        self.C23.grid(row=26, column=0, padx=5, pady=5)
        self.t23 = Text(self.frame_content4, height=1, width=20)
        self.t23.grid(row=26, column=1, padx=5, pady=5)
        l23 = Label(self.frame_content4,
                    text=':  fake EAPOL 1=MD5 2=SHA1 3=auto',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=26, column=2, padx=5, pady=5)

        self.C24 = Checkbutton(self.frame_content4, text = "-F", \
                 onvalue = "-F", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var24)
        self.C24.grid(row=27, column=0, padx=5, pady=5)
        self.t24 = Text(self.frame_content4, height=1, width=20)
        self.t24.grid(row=27, column=1, padx=5, pady=5)
        l24 = Label(
            self.frame_content4,
            text=':  write all sent and received frames into pcap file',
            font=self.myfont,
            bg="white",
            justify=LEFT).grid(row=27, column=2, padx=5, pady=5)

        self.C25 = Checkbutton(self.frame_content4, text = "-P", \
                 onvalue = "-P", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var25)
        self.C25.grid(row=28, column=0, padx=5, pady=5)
        self.t25 = Text(self.frame_content4, height=1, width=20)
        self.t25.grid(row=28, column=1, padx=5, pady=5)
        l25 = Label(
            self.frame_content4,
            text=':  respond to all probes, even when specifying ESSIDs',
            font=self.myfont,
            bg="white",
            justify=LEFT).grid(row=28, column=2, padx=5, pady=5)


        self.C26 = Checkbutton(self.frame_content4, text = "-I", \
                 onvalue = "-I", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var26)
        self.C26.grid(row=29, column=0, padx=5, pady=5)
        self.t26 = Text(self.frame_content4, height=1, width=20)
        self.t26.grid(row=29, column=1, padx=5, pady=5)
        l26 = Label(self.frame_content4,
                    text=':  sets the beacon interval value in ms',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=29, column=2, padx=5, pady=5)

        self.C27 = Checkbutton(self.frame_content4, text = "-C", \
                 onvalue = "-C", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var27)
        self.C27.grid(row=30, column=0, padx=5, pady=5)
        self.t27 = Text(self.frame_content4, height=1, width=20)
        self.t27.grid(row=30, column=1, padx=5, pady=5)
        l27 = Label(
            self.frame_content4,
            text=':   enables beaconing of probed ESSID values (requires -P)',
            font=self.myfont,
            bg="white",
            justify=LEFT).grid(row=30, column=2, padx=5, pady=5)

        Label(self.frame_content6,
              text='Airbase-ng',
              font=self.headerfont,
              bg="white",
              padx=10,
              pady=10).grid(row=0, column=0)
        Label(self.frame_content6,
              text='Filter Options :',
              font=self.myfontnew,
              bg="white",
              justify=LEFT).grid(row=16, column=1)

        self.C28 = Checkbutton(self.frame_content6, text = "--bssid", \
                 onvalue = "--bssid", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var28)
        self.C28.grid(row=31, column=0, padx=5, pady=5)
        self.t28 = Text(self.frame_content6, height=1, width=20)
        self.t28.grid(row=31, column=1, padx=5, pady=5)
        l28 = Label(self.frame_content6,
                    text=':  BSSID to filter/use (short -b)',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=31, column=2, padx=5, pady=5)

        self.C29 = Checkbutton(self.frame_content6, text = "--bssids", \
                 onvalue = "--bssids", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var29)
        self.C29.grid(row=32, column=0, padx=5, pady=5)
        self.t29 = Text(self.frame_content6, height=1, width=20)
        self.t29.grid(row=32, column=1, padx=5, pady=5)
        l29 = Label(
            self.frame_content6,
            text=':  read a list of BSSIDs out of that file (short -B)',
            font=self.myfont,
            bg="white",
            justify=LEFT).grid(row=32, column=2, padx=5, pady=5)

        self.C30 = Checkbutton(self.frame_content6, text = "--client", \
                 onvalue = "--client", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var30)
        self.C30.grid(row=33, column=0, padx=5, pady=5)
        self.t30 = Text(self.frame_content6, height=1, width=20)
        self.t30.grid(row=33, column=1, padx=5, pady=5)
        l30 = Label(self.frame_content6,
                    text=':   MAC of client to accept (short -d)',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=33, column=2, padx=5, pady=5)

        self.C31 = Checkbutton(self.frame_content6, text = "--clients", \
                 onvalue = "--clients", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var31)
        self.C31.grid(row=34, column=0, padx=5, pady=5)
        self.t31 = Text(self.frame_content6, height=1, width=20)
        self.t31.grid(row=34, column=1, padx=5, pady=5)
        l31 = Label(self.frame_content6,
                    text=':  read a list of MACs out of that file (short -D)',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=34, column=2, padx=5, pady=5)

        self.C32 = Checkbutton(self.frame_content6, text = "--essid", \
                 onvalue = "--essid", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var32)
        self.C32.grid(row=35, column=0, padx=5, pady=5)
        self.t32 = Text(self.frame_content6, height=1, width=20)
        self.t32.grid(row=35, column=1, padx=5, pady=5)
        l32 = Label(self.frame_content6,
                    text=':  specify a single ESSID (short -e)',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=35, column=2, padx=5, pady=5)

        self.C33 = Checkbutton(self.frame_content6, text = "--essids", \
                 onvalue = "--essids", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var33)
        self.C33.grid(row=36, column=0, padx=5, pady=5)
        self.t33 = Text(self.frame_content6, height=1, width=20)
        self.t33.grid(row=36, column=1, padx=5, pady=5)
        l33 = Label(
            self.frame_content6,
            text=':  read a list of ESSIDs out of that file (short -E)',
            font=self.myfont,
            bg="white",
            justify=LEFT).grid(row=36, column=2, padx=5, pady=5)

        self.C34 = Checkbutton(self.frame_content6, text = "--help", \
                 onvalue = "--help", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var34)
        self.C34.grid(row=37, column=0, padx=5, pady=5)
        self.t34 = Text(self.frame_content6, height=1, width=20)
        self.t34.grid(row=37, column=1, padx=5, pady=5)
        l34 = Label(self.frame_content6,
                    text=':  Displays the usage screen (short -H)',
                    font=self.myfont,
                    bg="white",
                    justify=LEFT).grid(row=37, column=2, padx=5, pady=5)
예제 #38
0
    def initUI(self, students):

        note=Notebook(self.parent)



        #Tabs
        external_tab = Frame(note)
        records_tab = Frame(note)
        edit_tab = Frame(note)
        note.config()
        note.add(external_tab, text = "Attendance")
        note.add(records_tab, text="  Records  ")
        note.add(edit_tab, text="    Edit    ")


        #Create the scrollable list on the left side
        scrollbar = tk.Scrollbar(external_tab, orient="vertical")
        lb = tk.Listbox(external_tab, selectmode=MULTIPLE, width=30, height=20, yscrollcommand=scrollbar.set)
        scrollbar.config(command=lb.yview)
        scrollbar.pack(side="left", fill="y")
        lb.pack(side="left",fill="y")
        self.setList(students, lb)



        #Add dialogue box for new student
        frame1 = Frame(external_tab, relief=GROOVE, borderwidth=0)
        info_frame2 = Frame(records_tab, relief=GROOVE, borderwidth=3)
        name = tk.Entry(frame1)
        name.pack(anchor=CENTER, side=BOTTOM)
        frame1.pack(fill=BOTH, expand=1)
        self.pack(fill=BOTH, expand=1)

        #Add the buttons on the right to manipulate the list
        frame = Frame(external_tab, relief=RAISED, borderwidth=0)
        addButton = Button(frame, text="Add Student", command= lambda : self.addStudent(name.get(), lb, lb2, lb3))
        addButton.pack()
        deleteButton = Button(frame, text="Remove Student", command= lambda : self.deleteStudent(lb.curselection(), lb, lb2, lb3))
        deleteButton.pack(anchor=E, pady=20, side=RIGHT)
        frame.pack()

        markCalendarFrame = Frame(external_tab)
        self.markCalendar = Calendar.newCalendar(markCalendarFrame, True)
        markCalendarFrame.pack()

        #Add the reset button and the mark absent button
        frame2 = Frame(external_tab, relief=RAISED, borderwidth=0)
        absentButton = Button(frame2, text="Mark as Absent", command= lambda: self.markAbsent(lb.curselection()))
        absentButton.pack(side=TOP, pady=20)
        resetButton = Button(frame2, text="Reset Today's Attendance", command=self.resetDay)
        resetButton.pack(side=TOP, pady=20)
        frame2.pack(fill=BOTH, expand=1)
        self.pack(fill=BOTH, expand=1)

        #Create the Records Listbox
        scrollbar2 = tk.Scrollbar(records_tab, orient="vertical")
        lb2 = tk.Listbox(records_tab, selectmode=BROWSE, width=30, height=20, yscrollcommand=scrollbar2.set)
        scrollbar2.config(command=lb2.yview)
        scrollbar2.pack(side="left", fill="y")

        #Bind a click to finding attendance
        lb2.bind('<<ListboxSelect>>', self.getTotals)
        lb2.pack(side="left",fill="y")
        self.setList(students, lb2)

        #Create the text that updates in real time based on selection

        self.present_variable.set('')
        self.absent_variable.set('')
        info_frame = Frame(records_tab, relief=GROOVE, borderwidth=3)
        present_setup = tk.Message(records_tab, anchor=W, justify=CENTER, width=100, text="Days Present: ")
        present_setup.pack(fill=X, side=TOP)
        present_message = tk.Message(records_tab, anchor=E, justify=CENTER, width=100, textvariable= self.present_variable)
        present_message.pack(fill=X, side=TOP)
        info_frame.pack(side=TOP)




        absent_setup = tk.Message(records_tab, anchor=W, justify=CENTER, width=100, text="Days Absent: ")
        absent_setup.pack(fill=X, side=TOP)
        absent_variable = tk.Message(records_tab, anchor=E, justify=CENTER, width=100, textvariable= self.absent_variable)
        absent_variable.pack(fill=X, side=TOP)
        info_frame2.pack(side=TOP)



        #Create a see Calendar Button
        # calendarButton = Button(records_tab, text="See Specific Days", command= lambda : self.setStudentCalendar(lb2.curselection()))
        # calendarButton.pack(side=TOP)


        calendar_frame = Frame(records_tab, relief=GROOVE, borderwidth=3, width = 300)
        self.theCalendar = Calendar.newCalendar(calendar_frame, False)
        calendar_frame.pack(side=TOP, pady = 20)

        clearCalendarButton = Button(records_tab, text="Clear Calendar", command=self.clearStudentCalendar)
        clearCalendarButton.pack(side=TOP)

        # close and excel buttons
        bottomFrame = Frame(width=20)
        excelButton = Button(bottomFrame, text="Generate Excel", command=self.generateExcel)
        excelButton.pack(side=LEFT, padx=5, pady=5)

        closeButton = Button(bottomFrame, text="Close", command=self.closeButton)
        closeButton.pack(side=RIGHT, padx=10, pady=5)
        bottomFrame.pack(side=BOTTOM)


        scrollbar3 = tk.Scrollbar(edit_tab, orient="vertical")
        lb3 = tk.Listbox(edit_tab, selectmode=BROWSE, width=30, height=20, yscrollcommand=scrollbar3.set)
        scrollbar3.config(command=lb3.yview)
        scrollbar3.pack(side="left", fill="y")
        lb3.bind('<<ListboxSelect>>', self.get_dates)
        lb3.pack(side="left",fill="y")
        self.setList(students, lb3)

        addFrame = Frame(edit_tab)
        remove_date = Button(addFrame, text="Remove Date", command= lambda : self.remove_date(self.lbedit.curselection(), self.lbedit2.curselection(), True))
        remove_date.pack(side=TOP, pady=2)
        add_dates = Button(addFrame, text="Add Date", command= lambda : self.add_date(lb3.curselection()))
        add_dates.pack(side=LEFT, pady=2)
        edit_selection = Button(addFrame, text="Edit Date", command= lambda : self.edit_date(self.lbedit.curselection(), self.lbedit2.curselection()))
        edit_selection.pack(side=LEFT, pady=2)

        addFrame.pack(side=TOP)

        dateFrame = Frame(edit_tab)
        presentLabel = Label(dateFrame, text="Present")
        presentLabel.pack(side=TOP)
        scrollbar4 = tk.Scrollbar(dateFrame, orient="vertical")
        self.lbedit = tk.Listbox(dateFrame, selectmode=BROWSE, width=29, height=9, yscrollcommand=scrollbar4.set)
        self.lbedit.pack(side=TOP)

        absentLabel = Label(dateFrame, text="Absent")
        absentLabel.pack(side=TOP)
        scrollbar5 = tk.Scrollbar(dateFrame, orient="vertical")
        self.lbedit2 = tk.Listbox(dateFrame, selectmode=BROWSE, width=29, height=8, yscrollcommand=scrollbar5.set)
        self.lbedit2.pack(side=TOP, fill="y")

        dateFrame.pack(side=LEFT, fill="y")

        self.pack(fill=BOTH, expand=1)

        note.pack(fill=BOTH, expand=1)
예제 #39
0
class wm_seg:
    """
    Simple GUI application
    If the application inside a container, automatic updates are removed.

    The application uses two frames (tabs):
    - training
    - testing
    """
    def __init__(self, master, container):

        self.master = master
        master.title("nicMSlesions")

        # running on a container
        self.container = container

        # gui attributes
        self.path = os.getcwd()
        self.default_config = None
        self.user_config = None
        self.current_folder = os.getcwd()
        self.list_train_pretrained_nets = []
        self.list_test_nets = []
        self.version = __version__
        if self.container is False:
            # version_number
            self.commit_version = subprocess.check_output(
                ['git', 'rev-parse', 'HEAD'])

        # queue and thread parameters. All processes are embedded
        # inside threads to avoid freezing the application
        self.train_task = None
        self.test_task = None
        self.test_queue = Queue.Queue()
        self.train_queue = Queue.Queue()

        # --------------------------------------------------
        # parameters. Mostly from the config/*.cfg files
        # --------------------------------------------------

        # data parameters
        self.param_training_folder = StringVar()
        self.param_test_folder = StringVar()
        self.param_FLAIR_tag = StringVar()
        self.param_T1_tag = StringVar()
        self.param_MOD3_tag = StringVar()
        self.param_MOD4_tag = StringVar()
        self.param_mask_tag = StringVar()
        self.param_model_tag = StringVar()
        self.param_register_modalities = BooleanVar()
        self.param_skull_stripping = BooleanVar()
        self.param_denoise = BooleanVar()
        self.param_denoise_iter = IntVar()
        self.param_save_tmp = BooleanVar()
        self.param_debug = BooleanVar()

        # train parameters
        self.param_net_folder = os.path.join(self.current_folder, 'nets')
        self.param_use_pretrained_model = BooleanVar()
        self.param_pretrained_model = StringVar()
        self.param_inference_model = StringVar()
        self.param_num_layers = IntVar()
        self.param_net_name = StringVar()
        self.param_net_name.set('None')
        self.param_balanced_dataset = StringVar()
        self.param_fract_negatives = DoubleVar()

        # model parameters
        self.param_pretrained = None
        self.param_min_th = DoubleVar()
        self.param_patch_size = IntVar()
        self.param_weight_paths = StringVar()
        self.param_load_weights = BooleanVar()
        self.param_train_split = DoubleVar()
        self.param_max_epochs = IntVar()
        self.param_patience = IntVar()
        self.param_batch_size = IntVar()
        self.param_net_verbose = IntVar()
        self.param_t_bin = DoubleVar()
        self.param_l_min = IntVar()
        self.param_min_error = DoubleVar()
        self.param_mode = BooleanVar()
        self.param_gpu_number = IntVar()

        # load the default configuration from the conf file
        self.load_default_configuration()

        # self frame (tabbed notebook)
        self.note = Notebook(self.master)
        self.note.pack()

        os.system('cls' if platform.system() == 'Windows' else 'clear')
        print "##################################################"
        print "# ------------                                   #"
        print "# nicMSlesions                                   #"
        print "# ------------                                   #"
        print "# MS WM lesion segmentation                      #"
        print "#                                                #"
        print "# -------------------------------                #"
        print "# (c) Sergi Valverde 2018                        #"
        print "# Neuroimage Computing Group                     #"
        print "# -------------------------------                #"
        print "##################################################\n"
        print "Please select options for training or inference in the menu..."

        # --------------------------------------------------
        # training tab
        # --------------------------------------------------
        self.train_frame = Frame()
        self.note.add(self.train_frame, text="Training")
        self.test_frame = Frame()
        self.note.add(self.test_frame, text="Inference")

        # label frames
        cl_s = 5
        self.tr_frame = LabelFrame(self.train_frame, text="Training images:")
        self.tr_frame.grid(row=0,
                           columnspan=cl_s,
                           sticky='WE',
                           padx=5,
                           pady=5,
                           ipadx=5,
                           ipady=5)
        self.model_frame = LabelFrame(self.train_frame, text="CNN model:")
        self.model_frame.grid(row=5,
                              columnspan=cl_s,
                              sticky='WE',
                              padx=5,
                              pady=5,
                              ipadx=5,
                              ipady=5)

        # training options
        self.inFolderLbl = Label(self.tr_frame, text="Training folder:")
        self.inFolderLbl.grid(row=0, column=0, sticky='E', padx=5, pady=2)
        self.inFolderTxt = Entry(self.tr_frame)
        self.inFolderTxt.grid(row=0,
                              column=1,
                              columnspan=5,
                              sticky="W",
                              pady=3)
        self.inFileBtn = Button(self.tr_frame,
                                text="Browse ...",
                                command=self.load_training_path)
        self.inFileBtn.grid(row=0,
                            column=5,
                            columnspan=1,
                            sticky='W',
                            padx=5,
                            pady=1)

        self.optionsBtn = Button(self.tr_frame,
                                 text="Other options",
                                 command=self.parameter_window)
        self.optionsBtn.grid(row=0,
                             column=10,
                             columnspan=1,
                             sticky="W",
                             padx=(100, 1),
                             pady=1)

        # setting input modalities: FLAIR + T1 are mandatory
        # Mod 3 / 4 are optional
        self.flairTagLbl = Label(self.tr_frame, text="FLAIR tag:")
        self.flairTagLbl.grid(row=1, column=0, sticky='E', padx=5, pady=2)
        self.flairTxt = Entry(self.tr_frame, textvariable=self.param_FLAIR_tag)
        self.flairTxt.grid(row=1, column=1, columnspan=1, sticky="W", pady=1)

        self.t1TagLbl = Label(self.tr_frame, text="T1 tag:")
        self.t1TagLbl.grid(row=2, column=0, sticky='E', padx=5, pady=2)
        self.t1Txt = Entry(self.tr_frame, textvariable=self.param_T1_tag)
        self.t1Txt.grid(row=2, column=1, columnspan=1, sticky="W", pady=1)

        self.mod3TagLbl = Label(self.tr_frame, text="mod 3 tag:")
        self.mod3TagLbl.grid(row=3, column=0, sticky='E', padx=5, pady=2)
        self.mod3Txt = Entry(self.tr_frame, textvariable=self.param_MOD3_tag)
        self.mod3Txt.grid(row=3, column=1, columnspan=1, sticky="W", pady=1)

        self.mod4TagLbl = Label(self.tr_frame, text="mod 4 tag:")
        self.mod4TagLbl.grid(row=4, column=0, sticky='E', padx=5, pady=2)
        self.mod4Txt = Entry(self.tr_frame, textvariable=self.param_MOD4_tag)
        self.mod4Txt.grid(row=4, column=1, columnspan=1, sticky="W", pady=1)

        self.maskTagLbl = Label(self.tr_frame, text="MASK tag:")
        self.maskTagLbl.grid(row=5, column=0, sticky='E', padx=5, pady=2)
        self.maskTxt = Entry(self.tr_frame, textvariable=self.param_mask_tag)
        self.maskTxt.grid(row=5, column=1, columnspan=1, sticky="W", pady=1)

        # model options
        self.modelTagLbl = Label(self.model_frame, text="Model name:")
        self.modelTagLbl.grid(row=6, column=0, sticky='E', padx=5, pady=2)
        self.modelTxt = Entry(self.model_frame,
                              textvariable=self.param_net_name)
        self.modelTxt.grid(row=6, column=1, columnspan=1, sticky="W", pady=1)

        self.checkPretrain = Checkbutton(self.model_frame,
                                         text="use pretrained",
                                         var=self.param_use_pretrained_model)
        self.checkPretrain.grid(row=6, column=3, padx=5, pady=5)

        self.update_pretrained_nets()

        self.pretrainTxt = OptionMenu(self.model_frame,
                                      self.param_pretrained_model,
                                      *self.list_train_pretrained_nets)
        self.pretrainTxt.grid(row=6, column=5, sticky='E', padx=5, pady=5)

        # START button links
        self.trainingBtn = Button(self.train_frame,
                                  state='disabled',
                                  text="Start training",
                                  command=self.train_net)
        self.trainingBtn.grid(row=7, column=0, sticky='W', padx=1, pady=1)

        # --------------------------------------------------
        # inference tab
        # --------------------------------------------------
        self.tt_frame = LabelFrame(self.test_frame, text="Inference images:")
        self.tt_frame.grid(row=0,
                           columnspan=cl_s,
                           sticky='WE',
                           padx=5,
                           pady=5,
                           ipadx=5,
                           ipady=5)
        self.test_model_frame = LabelFrame(self.test_frame, text="CNN model:")
        self.test_model_frame.grid(row=5,
                                   columnspan=cl_s,
                                   sticky='WE',
                                   padx=5,
                                   pady=5,
                                   ipadx=5,
                                   ipady=5)

        # testing options
        self.test_inFolderLbl = Label(self.tt_frame, text="Testing folder:")
        self.test_inFolderLbl.grid(row=0, column=0, sticky='E', padx=5, pady=2)
        self.test_inFolderTxt = Entry(self.tt_frame)
        self.test_inFolderTxt.grid(row=0,
                                   column=1,
                                   columnspan=5,
                                   sticky="W",
                                   pady=3)
        self.test_inFileBtn = Button(self.tt_frame,
                                     text="Browse ...",
                                     command=self.load_testing_path)
        self.test_inFileBtn.grid(row=0,
                                 column=5,
                                 columnspan=1,
                                 sticky='W',
                                 padx=5,
                                 pady=1)

        self.test_optionsBtn = Button(self.tt_frame,
                                      text="Other options",
                                      command=self.parameter_window)
        self.test_optionsBtn.grid(row=0,
                                  column=10,
                                  columnspan=1,
                                  sticky="W",
                                  padx=(100, 1),
                                  pady=1)

        self.test_flairTagLbl = Label(self.tt_frame, text="FLAIR tag:")
        self.test_flairTagLbl.grid(row=1, column=0, sticky='E', padx=5, pady=2)
        self.test_flairTxt = Entry(self.tt_frame,
                                   textvariable=self.param_FLAIR_tag)
        self.test_flairTxt.grid(row=1,
                                column=1,
                                columnspan=1,
                                sticky="W",
                                pady=1)

        self.test_t1TagLbl = Label(self.tt_frame, text="T1 tag:")
        self.test_t1TagLbl.grid(row=2, column=0, sticky='E', padx=5, pady=2)
        self.test_t1Txt = Entry(self.tt_frame, textvariable=self.param_T1_tag)
        self.test_t1Txt.grid(row=2, column=1, columnspan=1, sticky="W", pady=1)

        self.test_mod3TagLbl = Label(self.tt_frame, text="mod 3 tag:")
        self.test_mod3TagLbl.grid(row=3, column=0, sticky='E', padx=5, pady=2)
        self.test_mod3Txt = Entry(self.tt_frame,
                                  textvariable=self.param_MOD3_tag)
        self.test_mod3Txt.grid(row=3,
                               column=1,
                               columnspan=1,
                               sticky="W",
                               pady=1)

        self.test_mod4TagLbl = Label(self.tt_frame, text="mod 4 tag:")
        self.test_mod4TagLbl.grid(row=4, column=0, sticky='E', padx=5, pady=2)
        self.test_mod4Txt = Entry(self.tt_frame,
                                  textvariable=self.param_MOD4_tag)
        self.test_mod4Txt.grid(row=4,
                               column=1,
                               columnspan=1,
                               sticky="W",
                               pady=1)

        self.test_pretrainTxt = OptionMenu(self.test_model_frame,
                                           self.param_inference_model,
                                           *self.list_test_nets)

        self.param_inference_model.set('None')
        self.test_pretrainTxt.grid(row=5, column=0, sticky='E', padx=5, pady=5)

        # START button links cto docker task
        self.inferenceBtn = Button(self.test_frame,
                                   state='disabled',
                                   text="Start inference",
                                   command=self.infer_segmentation)
        self.inferenceBtn.grid(row=7, column=0, sticky='W', padx=1, pady=1)

        # train / test ABOUT button
        self.train_aboutBtn = Button(self.train_frame,
                                     text="about",
                                     command=self.about_window)
        self.train_aboutBtn.grid(row=7,
                                 column=4,
                                 sticky='E',
                                 padx=(1, 1),
                                 pady=1)

        self.test_aboutBtn = Button(self.test_frame,
                                    text="about",
                                    command=self.about_window)
        self.test_aboutBtn.grid(row=7,
                                column=4,
                                sticky='E',
                                padx=(1, 1),
                                pady=1)

        # Processing state
        self.process_indicator = StringVar()
        self.process_indicator.set(' ')
        self.label_indicator = Label(master,
                                     textvariable=self.process_indicator)
        self.label_indicator.pack(side="left")

        # Closing processing events is implemented via
        # a master protocol
        self.master.protocol("WM_DELETE_WINDOW", self.close_event)

    def parameter_window(self):
        """
        Setting other parameters using an emerging window
        CNN parameters, CUDA device, post-processing....

        """
        t = Toplevel(self.master)
        t.wm_title("Other parameters")

        # data parameters
        t_data = LabelFrame(t, text="data options:")
        t_data.grid(row=0, sticky="WE")
        checkPretrain = Checkbutton(t_data,
                                    text="Register modalities",
                                    var=self.param_register_modalities)
        checkPretrain.grid(row=0, sticky='W')
        checkSkull = Checkbutton(t_data,
                                 text="Skull-strip modalities",
                                 var=self.param_skull_stripping)
        checkSkull.grid(row=1, sticky="W")
        checkDenoise = Checkbutton(t_data,
                                   text="Denoise masks",
                                   var=self.param_denoise)
        checkDenoise.grid(row=2, sticky="W")

        denoise_iter_label = Label(t_data,
                                   text=" Denoise iter:               ")
        denoise_iter_label.grid(row=3, sticky="W")
        denoise_iter_entry = Entry(t_data,
                                   textvariable=self.param_denoise_iter)
        denoise_iter_entry.grid(row=3, column=1, sticky="E")

        check_tmp = Checkbutton(t_data,
                                text="Save tmp files",
                                var=self.param_save_tmp)
        check_tmp.grid(row=4, sticky="W")
        checkdebug = Checkbutton(t_data,
                                 text="Debug mode",
                                 var=self.param_debug)
        checkdebug.grid(row=5, sticky="W")

        # model parameters
        t_model = LabelFrame(t, text="Model:")
        t_model.grid(row=5, sticky="EW")

        maxepochs_label = Label(t_model, text="Max epochs:                  ")
        maxepochs_label.grid(row=6, sticky="W")
        maxepochs_entry = Entry(t_model, textvariable=self.param_max_epochs)
        maxepochs_entry.grid(row=6, column=1, sticky="E")

        trainsplit_label = Label(t_model, text="Validation %:           ")
        trainsplit_label.grid(row=7, sticky="W")
        trainsplit_entry = Entry(t_model, textvariable=self.param_train_split)
        trainsplit_entry.grid(row=7, column=1, sticky="E")

        batchsize_label = Label(t_model, text="Test batch size:")
        batchsize_label.grid(row=8, sticky="W")
        batchsize_entry = Entry(t_model, textvariable=self.param_batch_size)
        batchsize_entry.grid(row=8, column=1, sticky="E")

        mode_label = Label(t_model, text="Verbosity:")
        mode_label.grid(row=9, sticky="W")
        mode_entry = Entry(t_model, textvariable=self.param_net_verbose)
        mode_entry.grid(row=9, column=1, sticky="E")

        #gpu_mode = Checkbutton(t_model,
        #                         text="GPU:",
        #                         var=self.param_mode)
        #gpu_mode.grid(row=10, sticky="W")

        gpu_number = Label(t_model, text="GPU number:")
        gpu_number.grid(row=10, sticky="W")
        gpu_entry = Entry(t_model, textvariable=self.param_gpu_number)
        gpu_entry.grid(row=10, column=1, sticky="W")

        # training parameters
        tr_model = LabelFrame(t, text="Training:")
        tr_model.grid(row=12, sticky="EW")

        balanced_label = Label(tr_model, text="Balanced dataset:    ")
        balanced_label.grid(row=13, sticky="W")
        balanced_entry = Entry(tr_model,
                               textvariable=self.param_balanced_dataset)
        balanced_entry.grid(row=13, column=1, sticky="E")

        fraction_label = Label(tr_model, text="Fraction negative/positives: ")
        fraction_label.grid(row=14, sticky="W")
        fraction_entry = Entry(tr_model,
                               textvariable=self.param_fract_negatives)
        fraction_entry.grid(row=14, column=1, sticky="E")

        # postprocessing parameters
        t_post = LabelFrame(t, text="Post-processing:  ")
        t_post.grid(row=15, sticky="EW")
        t_bin_label = Label(t_post, text="Out probability th:      ")
        t_bin_label.grid(row=16, sticky="W")
        t_bin_entry = Entry(t_post, textvariable=self.param_t_bin)
        t_bin_entry.grid(row=16, column=1, sticky="E")

        l_min_label = Label(t_post, text="Min out region size:         ")
        l_min_label.grid(row=17, sticky="W")
        l_min_entry = Entry(t_post, textvariable=self.param_l_min)
        l_min_entry.grid(row=17, column=1, sticky="E")

        vol_min_label = Label(t_post, text="Min vol error (ml):   ")
        vol_min_label.grid(row=18, sticky="W")
        vol_min_entry = Entry(t_post, textvariable=self.param_min_error)
        vol_min_entry.grid(row=18, column=1, sticky="E")

    def load_default_configuration(self):
        """
        load the default configuration from /config/default.cfg
        This method assign each of the configuration parameters to
        class attributes
        """

        default_config = ConfigParser.SafeConfigParser()
        default_config.read(os.path.join(self.path, 'config', 'default.cfg'))

        # dastaset parameters
        self.param_training_folder.set(
            default_config.get('database', 'train_folder'))
        self.param_test_folder.set(
            default_config.get('database', 'inference_folder'))
        self.param_FLAIR_tag.set(default_config.get('database', 'flair_tags'))
        self.param_T1_tag.set(default_config.get('database', 't1_tags'))
        self.param_MOD3_tag.set(default_config.get('database', 'mod3_tags'))
        self.param_MOD4_tag.set(default_config.get('database', 'mod4_tags'))
        self.param_mask_tag.set(default_config.get('database', 'roi_tags'))
        self.param_register_modalities.set(
            default_config.get('database', 'register_modalities'))
        self.param_denoise.set(default_config.get('database', 'denoise'))
        self.param_denoise_iter.set(
            default_config.getint('database', 'denoise_iter'))
        self.param_skull_stripping.set(
            default_config.get('database', 'skull_stripping'))
        self.param_save_tmp.set(default_config.get('database', 'save_tmp'))
        self.param_debug.set(default_config.get('database', 'debug'))

        # train parameters
        self.param_use_pretrained_model.set(
            default_config.get('train', 'full_train'))
        self.param_pretrained_model.set(
            default_config.get('train', 'pretrained_model'))
        self.param_inference_model.set("      ")
        self.param_balanced_dataset.set(
            default_config.get('train', 'balanced_training'))
        self.param_fract_negatives.set(
            default_config.getfloat('train', 'fraction_negatives'))

        # model parameters
        self.param_net_folder = os.path.join(self.current_folder, 'nets')
        self.param_net_name.set(default_config.get('model', 'name'))
        self.param_train_split.set(
            default_config.getfloat('model', 'train_split'))
        self.param_max_epochs.set(default_config.getint('model', 'max_epochs'))
        self.param_patience.set(default_config.getint('model', 'patience'))
        self.param_batch_size.set(default_config.getint('model', 'batch_size'))
        self.param_net_verbose.set(default_config.get('model', 'net_verbose'))
        self.param_gpu_number.set(default_config.getint('model', 'gpu_number'))
        # self.param_mode.set(default_config.get('model', 'gpu_mode'))

        # post-processing
        self.param_l_min.set(default_config.getint('postprocessing', 'l_min'))
        self.param_t_bin.set(default_config.getfloat('postprocessing',
                                                     't_bin'))
        self.param_min_error.set(
            default_config.getfloat('postprocessing', 'min_error'))

    def write_user_configuration(self):
        """
        write the configuration into config/configuration.cfg
        """
        user_config = ConfigParser.RawConfigParser()

        # dataset parameters
        user_config.add_section('database')
        user_config.set('database', 'train_folder',
                        self.param_training_folder.get())
        user_config.set('database', 'inference_folder',
                        self.param_test_folder.get())
        user_config.set('database', 'flair_tags', self.param_FLAIR_tag.get())
        user_config.set('database', 't1_tags', self.param_T1_tag.get())
        user_config.set('database', 'mod3_tags', self.param_MOD3_tag.get())
        user_config.set('database', 'mod4_tags', self.param_MOD4_tag.get())
        user_config.set('database', 'roi_tags', self.param_mask_tag.get())

        user_config.set('database', 'register_modalities',
                        self.param_register_modalities.get())
        user_config.set('database', 'denoise', self.param_denoise.get())
        user_config.set('database', 'denoise_iter',
                        self.param_denoise_iter.get())
        user_config.set('database', 'skull_stripping',
                        self.param_skull_stripping.get())
        user_config.set('database', 'save_tmp', self.param_save_tmp.get())
        user_config.set('database', 'debug', self.param_debug.get())

        # train parameters
        user_config.add_section('train')
        user_config.set('train', 'full_train',
                        not (self.param_use_pretrained_model.get()))
        user_config.set('train', 'pretrained_model',
                        self.param_pretrained_model.get())
        user_config.set('train', 'balanced_training',
                        self.param_balanced_dataset.get())
        user_config.set('train', 'fraction_negatives',
                        self.param_fract_negatives.get())
        # model parameters
        user_config.add_section('model')
        user_config.set('model', 'name', self.param_net_name.get())
        user_config.set('model', 'pretrained', self.param_pretrained)
        user_config.set('model', 'train_split', self.param_train_split.get())
        user_config.set('model', 'max_epochs', self.param_max_epochs.get())
        user_config.set('model', 'patience', self.param_patience.get())
        user_config.set('model', 'batch_size', self.param_batch_size.get())
        user_config.set('model', 'net_verbose', self.param_net_verbose.get())
        # user_config.set('model', 'gpu_mode', self.param_mode.get())
        user_config.set('model', 'gpu_number', self.param_gpu_number.get())

        # postprocessing parameters
        user_config.add_section('postprocessing')
        user_config.set('postprocessing', 't_bin', self.param_t_bin.get())
        user_config.set('postprocessing', 'l_min', self.param_l_min.get())
        user_config.set('postprocessing', 'min_error',
                        self.param_min_error.get())

        # Writing our configuration file to 'example.cfg'
        with open(os.path.join(self.path, 'config', 'configuration.cfg'),
                  'wb') as configfile:
            user_config.write(configfile)

    def load_training_path(self):
        """
        Select training path from disk and write it.
        If the app is run inside a container,
        link the iniitaldir with /data
        """
        initialdir = '/data' if self.container else os.getcwd()
        fname = askdirectory(initialdir=initialdir)
        if fname:
            try:
                self.param_training_folder.set(fname)
                self.inFolderTxt.delete(0, END)
                self.inFolderTxt.insert(0, self.param_training_folder.get())
                self.trainingBtn['state'] = 'normal'
            except:
                pass

    def load_testing_path(self):
        """
        Selecet the inference path from disk and write it
        If the app is run inside a container,
        link the iniitaldir with /data
        """
        initialdir = '/data' if self.container else os.getcwd()
        fname = askdirectory(initialdir=initialdir)
        if fname:
            try:
                self.param_test_folder.set(fname)
                self.test_inFolderTxt.delete(0, END)
                self.test_inFolderTxt.insert(0, self.param_test_folder.get())
                self.inferenceBtn['state'] = 'normal'
            except:
                pass

    def update_pretrained_nets(self):
        """
        get a list of the  different net configuration present in the system.
        Each model configuration is represented by a folder containing the network
        weights for each of the networks. The baseline net config is always
        included by default

        """
        folders = os.listdir(self.param_net_folder)
        self.list_train_pretrained_nets = folders
        self.list_test_nets = folders

    def write_to_console(self, txt):
        """
        to doc:
        important method
        """
        self.command_out.insert(END, str(txt))

    def write_to_test_console(self, txt):
        """
        to doc:
        important method
        """
        self.test_command_out.insert(END, str(txt))

    def infer_segmentation(self):
        """
        Method implementing the inference process:
        - Check network selection
        - write the configuration to disk
        - Run the process on a new thread
        """

        if self.param_inference_model.get() == 'None':
            print "ERROR: Please, select a network model before starting...\n"
            return
        if self.test_task is None:
            self.inferenceBtn.config(state='disabled')
            self.param_net_name.set(self.param_inference_model.get())
            self.param_use_pretrained_model.set(False)
            self.write_user_configuration()
            print "\n-----------------------"
            print "Running configuration:"
            print "-----------------------"
            print "Inference model:", self.param_model_tag.get()
            print "Inference folder:", self.param_test_folder.get(), "\n"

            print "Method info:"
            print "------------"
            self.test_task = ThreadedTask(self.write_to_test_console,
                                          self.test_queue,
                                          mode='testing')
            self.test_task.start()
            self.master.after(100, self.process_container_queue)

    def train_net(self):
        """
        Method implementing the training process:
        - write the configuration to disk
        - Run the process on a new thread
        """

        if self.param_net_name.get() == 'None':
            print "ERROR: Please, define network name before starting...\n"
            return

        self.trainingBtn['state'] = 'disable'

        if self.train_task is None:
            self.trainingBtn.update()
            self.write_user_configuration()
            print "\n-----------------------"
            print "Running configuration:"
            print "-----------------------"
            print "Train model:", self.param_net_name.get()
            print "Training folder:", self.param_training_folder.get(), "\n"

            print "Method info:"
            print "------------"

            self.train_task = ThreadedTask(self.write_to_console,
                                           self.test_queue,
                                           mode='training')
            self.train_task.start()
            self.master.after(100, self.process_container_queue)

    def check_update(self):
        """
            check update version and propose to download it if differnt
            So far, a rudimentary mode is used to check the last version.
            """

        # I have to discard possible local changes :(
        print "---------------------------------------"
        print "Updating software"
        print "current version:", self.commit_version

        remote_commit = subprocess.check_output(['git', 'stash'])
        remote_commit = subprocess.check_output(['git', 'fetch'])
        remote_commit = subprocess.check_output(
            ['git', 'rev-parse', 'origin/master'])

        if remote_commit != self.commit_version:
            proc = subprocess.check_output(['git', 'pull', 'origin', 'master'])
            self.check_link.config(text="Updated")
            self.commit_version = remote_commit
            print "updated version:", self.commit_version
        else:
            print "This software is already in the latest version"
        print "---------------------------------------"

    def about_window(self):
        """
        Window showing information about the software and
        version number, including auto-update. If the application
        is run from a container, then auto-update is disabled
        """
        def callback(event):
            """
            open webbrowser when clicking links
            """
            webbrowser.open_new(event.widget.cget("text"))

        # main window
        t = Toplevel(self.master, width=500, height=500)
        t.wm_title("About")

        # NIC logo + name
        title = Label(t,
                      text="nicMSlesions v" + self.version + "\n"
                      "Multiple Sclerosis White Matter Lesion Segmentation")
        title.grid(row=2, column=1, padx=20, pady=10)
        img = ImageTk.PhotoImage(Image.open('./logonic.png'))
        imglabel = Label(t, image=img)
        imglabel.image = img
        imglabel.grid(row=1, column=1, padx=10, pady=10)
        group_name = Label(t,
                           text="Copyright Sergi Valverde (2018-) \n " +
                           "NeuroImage Computing Group")
        group_name.grid(row=3, column=1)
        group_link = Label(t,
                           text=r"http://atc.udg.edu/nic",
                           fg="blue",
                           cursor="hand2")
        group_link.grid(row=4, column=1)
        group_link.bind("<Button-1>", callback)

        license_content = "Licensed under the BSD 2-Clause license. \n" + \
                          "A copy of the license is present in the root directory."

        license_label = Label(t, text=license_content)
        license_label.grid(row=5, column=1, padx=20, pady=20)

        # if self.container is False:
        #     # check version and updates
        #     version_number = Label(t, text="commit: " + self.commit_version)
        #     version_number.grid(row=6, column=1, padx=20, pady=(1, 1))
        #
        #     self.check_link = Button(t,
        #                         text="Check for updates",
        #                         command=self.check_update)
        #     self.check_link.grid(row=7, column=1)

    def process_container_queue(self):
        """
        Process the threading queue. When the threaded processes are
        finished, buttons are reset and a message is shown in the app.
        """
        self.process_indicator.set('Running... please wait')
        try:
            msg = self.test_queue.get(0)
            self.process_indicator.set('Done. See log for more details.')
            self.inferenceBtn['state'] = 'normal'
            self.trainingBtn['state'] = 'normal'
        except Queue.Empty:
            self.master.after(100, self.process_container_queue)

    def close_event(self):
        """
        Stop the thread processes using OS related calls.
        """
        if self.train_task is not None:
            self.train_task.stop_process()
        if self.test_task is not None:
            self.test_task.stop_process()
        os.system('cls' if platform.system == "Windows" else 'clear')
        root.destroy()
예제 #40
0
    def __init__(self, master):

        self.fname = ""
        #global variables
        self.t1 = StringVar()
        self.t2 = StringVar()
        self.t3 = StringVar()
        self.t4 = StringVar()
        self.t5 = StringVar()
        self.t6 = StringVar()
        self.t7 = StringVar()
        self.t8 = StringVar()

        self.var1 = StringVar()
        self.var2 = StringVar()
        self.var3 = StringVar()
        self.var4 = StringVar()
        self.var5 = StringVar()
        self.var6 = StringVar()
        self.var7 = StringVar()
        self.var8 = StringVar()
        #end

        mymaster = Frame(master, name='mymaster')  # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window
        #master.minsize(width=900, height=900)
        #master.maxsize(width=870, height=420)
        #end

        #title of window
        master.title("Airolib-ng")
        #end

        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont = tkFont.Font(family="Helvetica",
                                      size=15,
                                      underline=True)
        self.myfontnew = tkFont.Font(family="Helvetica",
                                     size=11,
                                     underline=True)
        #end

        nb = Notebook(mymaster, name='nb')  # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3)  # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,
                                   name="frame_content",
                                   bg="lightsteelblue")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1")  # add tab to Notebook

        # repeat for each tab
        self.frame_content7 = Frame(nb,
                                    name='frame_content7',
                                    bg="lightsteelblue")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb,
                                    name='frame_content5',
                                    bg="lightsteelblue")
        nb.add(self.frame_content5, text="output")

        #End

        #frame content 7
        Label(self.frame_content7,
              text='Airolib-ng',
              font=self.headerfont,
              bg="midnightblue",
              fg="firebrick",
              padx=10,
              pady=10).grid(row=0, column=0)
        btndetect = Button(self.frame_content7,
                           text='Detect',
                           fg="cornflowerblue",
                           command=self.canvas_detect,
                           height=2,
                           width=15,
                           font=self.customFont).grid(row=1,
                                                      column=0,
                                                      padx=5,
                                                      pady=5)

        btndbrowse = Button(self.frame_content7,
                            text='Attach File',
                            fg="cornflowerblue",
                            command=self.browse_file,
                            height=2,
                            width=15,
                            font=self.customFont).grid(row=3,
                                                       column=0,
                                                       padx=5,
                                                       pady=5)
        self.lilnew1 = Listbox(self.frame_content7,
                               bg="black",
                               fg="firebrick",
                               font=self.myfont,
                               selectmode=SINGLE,
                               width=30,
                               height=15)
        self.lilnew1.grid(row=1, column=1, rowspan=3)
        #End

        Label(self.frame_content,
              text='Airolib-ng',
              font=self.headerfont,
              bg="midnightblue",
              fg="firebrick",
              padx=10,
              pady=10).grid(row=0, column=0)
        Label(self.frame_content,
              text='Options :',
              font=self.myfontnew,
              bg="midnightblue",
              fg="deepskyblue").grid(row=1, column=1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5,
              text='Edit Command From Here',
              font=self.myfontnew,
              bg="midnightblue",
              fg="deepskyblue",
              justify=LEFT).grid(row=0, column=0)
        TextCommandBox = Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output = Text(self.frame_content5,
                           bg="black",
                           fg="firebrick",
                           font=self.myfont,
                           height=20,
                           width=42)
        self.output.grid(row=0, column=1, padx=50, pady=5, rowspan=3)
        btnsubmit = Button(self.frame_content5,
                           width=15,
                           height=2,
                           text="Get Result",
                           fg="cornflowerblue",
                           command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear = Button(self.frame_content5,
                          width=15,
                          height=2,
                          text="Clear Output",
                          fg="cornflowerblue",
                          command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "--stats", fg="deepskyblue", \
                 onvalue = "--stats", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var1)
        self.C1.grid(row=2, column=0, padx=5, pady=5)
        self.t1 = Text(self.frame_content, height=1, width=20)
        self.t1.grid(row=2, column=1, padx=5, pady=5)
        l1 = Label(self.frame_content,
                   text=': Output some information about the database.',
                   font=self.myfont,
                   bg="midnightblue",
                   fg="deepskyblue",
                   justify=LEFT).grid(row=2, column=2, padx=5, pady=5)

        self.C2 = Checkbutton(self.frame_content, text = "--sql", fg="deepskyblue", \
                 onvalue = "--sql", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var2)
        self.C2.grid(row=3, column=0, padx=5, pady=5)
        self.t2 = Text(self.frame_content, height=1, width=20)
        self.t2.grid(row=3, column=1, padx=5, pady=5)
        l2 = Label(self.frame_content,
                   text=': Execute the specified SQL statement.',
                   font=self.myfont,
                   bg="midnightblue",
                   fg="deepskyblue",
                   justify=LEFT).grid(row=3, column=2, padx=5, pady=5)

        self.C3 = Checkbutton(self.frame_content, text = "--clean", fg="deepskyblue", \
                 onvalue = "--clean", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var3)
        self.C3.grid(row=4, column=0, padx=5, pady=5)
        self.t3 = Text(self.frame_content, height=1, width=20)
        self.t3.grid(row=4, column=1, padx=5, pady=5)
        l3 = Label(
            self.frame_content,
            text=':   Perform steps to clean the database from old junk.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=4, column=2, padx=5, pady=5)

        self.C4 = Checkbutton(self.frame_content, text = "- -batch", fg="deepskyblue", \
                 onvalue = "--verify", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var4)
        self.C4.grid(row=5, column=0, padx=5, pady=5)
        self.t4 = Text(self.frame_content, height=1, width=20)
        self.t4.grid(row=5, column=1, padx=5, pady=5)
        l4 = Label(
            self.frame_content,
            text=
            ': Start batch-processing all combinations of ESSIDs and passwords.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=5, column=2, padx=5, pady=5)

        self.C5 = Checkbutton(self.frame_content, text = "--verify", fg="deepskyblue", \
                 onvalue = "--verify", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var5)
        self.C5.grid(row=6, column=0, padx=5, pady=5)
        self.t5 = Text(self.frame_content, height=1, width=20)
        self.t5.grid(row=6, column=1, padx=5, pady=5)
        l5 = Label(self.frame_content,
                   text=':  Verify a set of randomly chosen PMKs.',
                   font=self.myfont,
                   bg="midnightblue",
                   fg="deepskyblue",
                   justify=LEFT).grid(row=6, column=2, padx=5, pady=5)

        self.C6 = Checkbutton(self.frame_content, text = "--export", fg="deepskyblue", \
                 onvalue = "--export", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var6)
        self.C6.grid(row=7, column=0, padx=5, pady=5)
        self.t6 = Text(self.frame_content, height=1, width=20)
        self.t6.grid(row=7, column=1, padx=5, pady=5)
        l6 = Label(self.frame_content,
                   text=':  Export to a cowpatty file.',
                   font=self.myfont,
                   bg="midnightblue",
                   fg="deepskyblue",
                   justify=LEFT).grid(row=7, column=2, padx=5, pady=5)

        self.C7 = Checkbutton(self.frame_content, text = "--import cowpatty", fg="deepskyblue", \
                 onvalue = "--import cowpatty", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var7)
        self.C7.grid(row=8, column=0, padx=5, pady=5)
        self.t7 = Text(self.frame_content, height=1, width=20)
        self.t7.grid(row=8, column=1, padx=5, pady=5)
        l7 = Label(self.frame_content,
                   text=':  Import a cowpatty file and create the database.',
                   font=self.myfont,
                   bg="midnightblue",
                   fg="deepskyblue",
                   justify=LEFT).grid(row=8, column=2, padx=5, pady=5)

        self.C8 = Checkbutton(self.frame_content, text = "--import", fg="deepskyblue", \
                 onvalue = "--import", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var8)
        self.C8.grid(row=9, column=0, padx=5, pady=5)
        self.t8 = Text(self.frame_content, height=1, width=20)
        self.t8.grid(row=9, column=1, padx=5, pady=5)
        l8 = Label(
            self.frame_content,
            text=
            ':  Import a text flat file as a list of either ESSIDs or passwords and create the database.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=9, column=2, padx=5, pady=5)
예제 #41
0
class Propietarios(Frame):
	def __init__(self, parent, controller):
		Frame.__init__(self, parent)

		#VARIABLES GLOBALES
		global cedula, titulo, ingreso, rsocial, residencia, nombres, apellidos, direccion, telefono, oficina, tel, telfax, correo, cumpleanos, dia, mes, envio, celular, tipopersona, comision, retefuente, reteiva, gcontribuyente, gfactura, gcheque, reprecc, reprenombres, repredireccion, repretelefono, repreoficina, repretel, reprebanco, repretcuenta, reprenumcuenta, tit1cc, tit1nombres, tit1banco, tit1tcuenta, tit1numcuenta, tit2cc, tit2nombres, tit2banco, tit2tcuenta, tit2numcuenta, lb, note, popmenu, busqueda, dato, E
		#INSTANCIEAS DE LOS WIDGETS
		global ccE, refE, dateinE, socialE, cityE, nameE, lnameE, adressE, phoneE, officeE, officetelE, telfaxE, emailE, birthdayE, birthdayCbx, mailE, mobileE, personR1, personR2, comisionE, Ch1, Ch2, Ch3, Ch4, Ch5, note, cc0E, name0E, adress0E, phone0E, office0E, officetel0E, bank0Cbx, tbank0Cbx, tcuenta0E, cc1E, name1E, bank1Cbx, tbank1Cbx, tcuenta1E, cc2E, name2E, bank2Cbx, tbank2Cbx, tcuenta2E, add, update, delete, clean
		global info, lists, _propietarios
		
		_propietarios = dict()
		lists = []
			
		#Variables
		cedula = StringVar()
		titulo = StringVar()
		ingreso = StringVar()
		rsocial = StringVar()
		residencia = StringVar()
		nombres = StringVar()
		apellidos = StringVar()
		direccion = StringVar()
		telefono = StringVar()
		oficina = StringVar()
		tel = StringVar()
		telfax = StringVar()
		correo = StringVar()
		dia = IntVar()
		mes = StringVar()
		envio = StringVar()
		celular = StringVar()
		tipopersona = IntVar()
		comision = DoubleVar()
		retefuente = IntVar()
		reteiva = IntVar()
		gcontribuyente = IntVar()
		gfactura = IntVar()
		gcheque = IntVar()
		notas = StringVar()
		
		#----------------------------
		
		reprecc = StringVar()
		reprenombres = StringVar()
		repredireccion = StringVar()
		repretelefono = StringVar()
		repreoficina = StringVar()
		repretel = StringVar()
		reprebanco = StringVar()
		repretcuenta = StringVar()
		reprenumcuenta = StringVar()
		
		tit1cc = StringVar()
		tit1nombres = StringVar()
		tit1banco = StringVar()
		tit1tcuenta = StringVar()
		tit1numcuenta = StringVar()
		
		tit2cc = StringVar()
		tit2nombres = StringVar()
		tit2banco = StringVar()
		tit2tcuenta = StringVar()
		tit2numcuenta = StringVar()
		
		meses = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto","Septiembre", "Octubre", "Noviembre", "Diciembre"]
		tbancos = ['Bancolombia', "Banco Bogotá", "Banco Agrario", "Banco Occidente"]

		tbanktype = ['Corriente','Ahorro']
		
		#BUSQUEDA = ["Nombre","CC/Nit"]
		busqueda = StringVar()
		busqueda.trace("w", lambda name, index, mode: buscar())
		info = IntVar()
		#eleccion = IntVar()
		dato = StringVar()
		
		# MENU DEL MOUSE
		
		popmenu = Menu(self, tearoff=0)
		popmenu.add_command(label="Imprimir", command=hello)
		popmenu.add_command(label="Cargar", command=modificar)
		popmenu.add_command(label="Eliminar", command=borrar)
		#popmenu.add_separator()
		popmenu.bind('<Escape>', release)

		#WIDGETS
		
		#========================= HEADER ==============================
		
		self.header = Label(self, text="GESTIÓN DE PROPIETARIOS", font="bold")
		self.header.pack(pady=20, side=TOP)

		#========================== WRAPPER ============================
		#Contiene los Notebooks con los campos formulario

		self.wrapper = Frame (self)
		self.wrapper.pack(side=LEFT, fill=Y)
		#Esto centro el wrapper
		#self.wrapper.pack(side=LEFT, fill=BOTH, expand=True)
		
		#================ NOTEBOOK =============>
		
		self.nb = Notebook(self.wrapper)
		
		#-----------------------> TAB 1
		
		self.tab1 = Frame (self.nb)
		
		self.f0 = Frame(self.tab1)#Para dejar espacio entre Tab y Label
		self.f0.pack(fill=X, pady=10)#-------------------------------
		
		#========================= PERSONALES ==========================
		
		self.f1 = Frame(self.tab1)#-------------------------------
		self.f1.pack(pady=5,fill=X)
		
		self.ccL = Label(self.f1, text='CC/Nit:')
		self.ccL.pack(side=LEFT)
		ccE = Entry(self.f1, textvariable=cedula)
		ccE.pack(side=LEFT, fill=X, expand=1)
		ccE.focus_set()

		self.refL = Label(self.f1, text='Título:')
		self.refL.pack(side=LEFT)
		refE = Entry(self.f1, textvariable=titulo, width=10)
		refE.pack(side=LEFT)
		#refE.bind("<KeyRelease>", caps)

		self.dateinL = Label(self.f1, text='Fecha Ingreso:')
		self.dateinL.pack(side=LEFT)
		dateinE = Entry(self.f1, textvariable=ingreso, width=10, state=DISABLED)
		ingreso.set("0000-00-00")
		dateinE.pack(side=LEFT)

		self.f2 = Frame(self.tab1)#-------------------------------
		self.f2.pack(pady=5,fill=X)

		self.socialL = Label(self.f2, text='Razón Social:')
		self.socialL.pack(side=LEFT)
		socialE = Entry(self.f2, textvariable=rsocial)
		socialE.pack(side=LEFT, fill=X, expand=1)
		socialE.bind("<KeyRelease>", caps)

		self.cityL = Label(self.f2, text='Ciudad de residencia:')
		self.cityL.pack(side=LEFT)
		cityE = Entry(self.f2, textvariable=residencia, width=15)
		cityE.pack(side=LEFT)
		cityE.bind("<KeyRelease>", caps)

		self.f3 = Frame(self.tab1)
		self.f3.pack(pady=5,fill=X)#-----------------------------------------

		self.nameL = Label(self.f3, text='Nombres:')
		self.nameL.pack(side=LEFT)
		nameE = Entry(self.f3, textvariable=nombres)
		nameE.pack(side=LEFT, fill=X, expand=1)
		nameE.bind("<KeyRelease>", caps)

		self.lnameL = Label(self.f3, text='Apellidos:')
		self.lnameL.pack(side=LEFT)
		lnameE = Entry(self.f3, textvariable=apellidos)
		lnameE.pack(side=LEFT, fill=X, expand=1)
		lnameE.bind("<KeyRelease>", caps)

		self.f4 = Frame(self.tab1)
		self.f4.pack(pady=5,fill=X)#-----------------------------------------

		self.adressL = Label(self.f4, text='Dir. Casa:')
		self.adressL.pack(side=LEFT)
		adressE = Entry(self.f4, textvariable=direccion)
		adressE.pack(side=LEFT, fill=X, expand=1)
		adressE.bind("<KeyRelease>", caps)

		self.phoneL = Label(self.f4, text='Tel:')
		self.phoneL.pack(side=LEFT)
		phoneE = Entry(self.f4, textvariable=telefono, width=20)
		phoneE.pack(side=LEFT)

		self.f5 = Frame(self.tab1)
		self.f5.pack(pady=5,fill=X)#------------------------------------
		
		self.officeL = Label(self.f5, text='Dir. Oficina:')
		self.officeL.pack(side=LEFT)
		officeE = Entry(self.f5, textvariable=oficina, width=20)
		officeE.pack(side=LEFT, fill=X, expand=1)
		officeE.bind("<KeyRelease>", caps)

		self.officetelL = Label(self.f5, text='Tel:')
		self.officetelL.pack(side=LEFT)
		officetelE = Entry(self.f5, textvariable=tel, width=15)
		officetelE.pack(fill=X, side=LEFT)

		self.telfaxL = Label(self.f5, text='Tel. Fax:')
		self.telfaxL.pack(side=LEFT)
		telfaxE = Entry(self.f5, textvariable=telfax, width=10)
		telfaxE.pack(side=LEFT)

		self.f6 = Frame(self.tab1)
		self.f6.pack(pady=5,fill=X)#------------------------------------

		self.emailL = Label(self.f6, text='Email:')
		self.emailL.pack(side=LEFT)
		emailE = Entry(self.f6, textvariable=correo, width=30)
		emailE.pack(side=LEFT)

		self.birthdayL = Label(self.f6, text='Cumpleaños:')
		self.birthdayL.pack(side=LEFT)

		self.birthdayL2 = Label(self.f6, text='Día:')
		self.birthdayL2.pack(padx=5,side=LEFT)
		
		#s = Spinbox(self.f6, from_=1, to=31,textvariable=dia, width=3)
		#s.pack(side=LEFT)

		birthdayE = Entry(self.f6, textvariable=dia, width=3)
		birthdayE.pack(side=LEFT)

		self.birthdayL3 = Label(self.f6, text='Mes:')
		self.birthdayL3.pack(padx=5,side=LEFT)

		birthdayCbx = Combobox(self.f6, textvariable=mes, values=meses, width=10)
		birthdayCbx.set('Enero')
		birthdayCbx.pack(side=LEFT)
		
		self.f7 = Frame(self.tab1)
		self.f7.pack(pady=5,fill=X)#------------------------------------

		self.mailL = Label(self.f7, text='Dir. Correspondencia:')
		self.mailL.pack(side=LEFT)
		mailE = Entry(self.f7, textvariable=envio)
		mailE.pack(side=LEFT, fill=X, expand=1)
		mailE.bind("<KeyRelease>", caps)

		self.mobileL = Label(self.f7, text='Celular:')
		self.mobileL.pack(side=LEFT)
		mobileE = Entry(self.f7, textvariable=celular, width=10)
		mobileE.pack(side=LEFT, fill=X, expand=1)
		
		self.f8 = Frame(self.tab1)
		self.f8.pack(pady=5,fill=X)#------------------------------------

		self.personL = Label(self.f8, text='Tipo Persona:')
		self.personL.pack(side=LEFT)
		
		personR1 = Radiobutton(self.f8, text="Natural", variable=tipopersona, value=1)
		personR1.pack(padx=20,side=LEFT)
		
		personR2 = Radiobutton (self.f8, text="Jurídica", variable=tipopersona, value=2)
		personR2.pack(padx=20,side=LEFT)

		self.comisionL = Label(self.f8, text='$ Comisión:')
		self.comisionL.pack(side=LEFT)
		
		comisionE = Entry(self.f8, textvariable=comision, width=5)
		comisionE.pack(side=LEFT)
		
		self.f = Frame(self.tab1)
		self.f.pack(pady=5,fill=X)#------------------------------------

		Ch1 = Checkbutton(self.f, text="Retefuente", variable=retefuente)
		Ch1.pack(side=LEFT)
		
		Ch2 = Checkbutton(self.f, text="Rete IVA", variable=reteiva)
		Ch2.pack(side=LEFT)
		
		Ch3 = Checkbutton(self.f, text="Gran Contribuyente", variable=gcontribuyente)
		Ch3.pack(side=LEFT)
		
		Ch4 = Checkbutton(self.f, text="Genera Factura", variable=gfactura)
		Ch4.pack(side=LEFT)
		
		Ch5 = Checkbutton(self.f, text="Genera Cheque", variable=gcheque)
		Ch5.pack(side=LEFT)

		self.f9 = Frame(self.tab1)
		self.f9.pack(pady=5,fill=X)#------------------------------------

		self.notesL = Label(self.f9, text='Observaciones:')
		self.notesL.pack(side=LEFT)

		self.f10 = Frame(self.tab1)
		self.f10.pack(pady=5,fill=X)#------------------------------------

		note = Text(self.f10, height=5)
		note.pack(side=LEFT, fill=X, expand=1)
		
		self.tab1.pack()
		
		#-----------------------> TAB 2
		
		self.tab2 = Frame (self.nb)
		self.tab2.pack()
		
		self.f0 = Frame(self.tab2)#Para dejar espacio entre Tab y Label
		self.f0.pack(fill=X, pady=10)#----------------------------------
		
		#======================= COMPLEMENTARIOS =======================
		
		self.lf = LabelFrame(self.tab2, text="Datos Representante")
		
		self.f0 = Frame(self.lf)
		self.f0.pack(fill=X, pady=5)#-------------------------------
		
		self.ccRL = Label(self.f0, text='CC:')
		self.ccRL.pack(side=LEFT)
		cc0E = Entry(self.f0, textvariable=reprecc, width=10)
		cc0E.pack(side=LEFT, fill=X, expand=1)
		
		self.nameL = Label(self.f0, text='Nombres:')
		self.nameL.pack(side=LEFT)
		name0E = Entry(self.f0, textvariable=reprenombres)
		name0E.pack(side=LEFT, fill=X, expand=1)
		name0E.bind("<KeyRelease>", caps)
		
		self.f1 = Frame(self.lf)
		self.f1.pack(fill=X, pady=5)#-------------------------------
		
		self.adressL = Label(self.f1, text='Dir. Casa:')
		self.adressL.pack(side=LEFT)
		adress0E = Entry(self.f1, textvariable=repredireccion)
		adress0E.pack(side=LEFT, fill=X, expand=1)
		adress0E.bind("<KeyRelease>", caps)

		self.phoneL = Label(self.f1, text='Tel:')
		self.phoneL.pack(side=LEFT)
		phone0E = Entry(self.f1, textvariable=repretelefono, width=20)
		phone0E.pack(side=LEFT)
		
		self.f2 = Frame(self.lf)
		self.f2.pack(fill=X, pady=5)#-------------------------------
		
		self.officeL = Label(self.f2, text='Dir. Oficina:')
		self.officeL.pack(side=LEFT)
		office0E = Entry(self.f2, textvariable=repreoficina)
		office0E.pack(side=LEFT, fill=X, expand=1)
		office0E.bind("<KeyRelease>", caps)

		self.officetelL = Label(self.f2, text='Tel:')
		self.officetelL.pack(side=LEFT)
		officetel0E = Entry(self.f2, textvariable=repretel, width=20)
		officetel0E.pack(fill=X, side=LEFT)
		
		self.f3 = Frame (self.lf)
		self.f3.pack(fill=X)#-------------------------------------------
		
		self.tbancpL = Label(self.f3, text='Banco:')
		self.tbancpL.pack(side=LEFT)
		bank0Cbx = Combobox(self.f3, textvariable=reprebanco, values=tbancos, width=12)
		bank0Cbx.set('')
		bank0Cbx.pack(side=LEFT)

		self.tbancpL = Label(self.f3, text='Tipo Cuenta:')
		self.tbancpL.pack(side=LEFT)
		tbank0Cbx = Combobox(self.f3, textvariable=repretcuenta, values=tbanktype, width=8)
		tbank0Cbx.set('')
		tbank0Cbx.pack(side=LEFT)

		self.tcuentaL = Label(self.f3, text='# Cuenta:')
		self.tcuentaL.pack(side=LEFT)
		tcuenta0E = Entry(self.f3, textvariable=reprenumcuenta)
		tcuenta0E.pack(side=LEFT, fill=X, expand=1)
		
		self.lf.pack(fill=X, ipady=5)#==================================
		
		self.f0 = Frame(self.tab2)#Para dejar espacio entre Tab y Label
		self.f0.pack(fill=X, pady=10)#-------------------------------
		
		#---------------------------------------------------------------
		
		self.lf1 = LabelFrame(self.tab2, text="Datos Titular 1")
		
		self.f4 = Frame(self.lf1)
		self.f4.pack(fill=X, pady=5)#-------------------------------
		
		self.ccL = Label(self.f4, text='CC:')
		self.ccL.pack(side=LEFT)
		cc1E = Entry(self.f4, textvariable=tit1cc)
		cc1E.pack(side=LEFT, fill=X, expand=1)
		
		self.nameL = Label(self.f4, text='Nombres:')
		self.nameL.pack(side=LEFT)
		name1E = Entry(self.f4, textvariable=tit1nombres)
		name1E.pack(side=LEFT, fill=X, expand=1)
		name1E.bind("<KeyRelease>", caps)
		
		self.f5 = Frame (self.lf1)
		self.f5.pack(fill=X)#-------------------------------------------
		
		self.tbancpL = Label(self.f5, text='Banco:')
		self.tbancpL.pack(side=LEFT)
		bank1Cbx = Combobox(self.f5, textvariable=tit1banco, values=tbancos, width=12)
		bank1Cbx.set('')
		bank1Cbx.pack(side=LEFT)

		self.tbancpL = Label(self.f5, text='Tipo Cuenta:')
		self.tbancpL.pack(side=LEFT)
		tbank1Cbx = Combobox(self.f5, textvariable=tit1tcuenta, values=tbanktype, width=8)
		tbank1Cbx.set('')
		tbank1Cbx.pack(side=LEFT)

		self.tcuentaL = Label(self.f5, text='# Cuenta:')
		self.tcuentaL.pack(side=LEFT)
		tcuenta1E = Entry(self.f5, textvariable=tit1numcuenta)
		tcuenta1E.pack(side=LEFT, fill=X, expand=1)
		
		self.lf1.pack(fill=X, ipady=5)#================================
		
		self.f0 = Frame(self.tab2)#Para dejar espacio entre Tab y Label
		self.f0.pack(fill=X, pady=10)#-------------------------------
		
		#---------------------------------------------------------------
		
		self.lf2 = LabelFrame(self.tab2, text="Datos Titular 2")
		
		self.f5 = Frame(self.lf2)
		self.f5.pack(fill=X, pady=5)#-------------------------------
		
		self.ccL = Label(self.f5, text='CC:')
		self.ccL.pack(side=LEFT)
		cc2E = Entry(self.f5, textvariable=tit2cc)
		cc2E.pack(side=LEFT, fill=X, expand=1)
		
		self.nameL = Label(self.f5, text='Nombres:')
		self.nameL.pack(side=LEFT)
		name2E = Entry(self.f5, textvariable=tit2nombres)
		name2E.pack(side=LEFT, fill=X, expand=1)
		name2E.bind("<KeyRelease>", caps)
		
		self.f6 = Frame (self.lf2)
		self.f6.pack(fill=X)#-------------------------------------------
		
		self.tbancpL = Label(self.f6, text='Banco:')
		self.tbancpL.pack(side=LEFT)
		bank2Cbx = Combobox(self.f6, textvariable=tit2banco, values=tbancos, width=12)
		bank2Cbx.set('')
		bank2Cbx.pack(side=LEFT)

		self.tbancpL = Label(self.f6, text='Tipo Cuenta:')
		self.tbancpL.pack(side=LEFT)
		tbank2Cbx = Combobox(self.f6, textvariable=tit2tcuenta, values=tbanktype, width=8)
		tbank2Cbx.set('')
		tbank2Cbx.pack(side=LEFT)

		self.tcuentaL = Label(self.f6, text='# Cuenta:')
		self.tcuentaL.pack(side=LEFT)
		tcuenta2E = Entry(self.f6, textvariable=tit2numcuenta)
		tcuenta2E.pack(side=LEFT, fill=X, expand=1)
		
		self.lf2.pack(fill=X, ipady=5)#================================
		
		#---------------------------------------------------------------
		
		self.nb.add (self.tab1, text="Personales")
		self.nb.add(self.tab2, text="Complementarios")
		
		self.nb.pack()
		
		#=========================== BOTONES ===========================

		self.btns = Frame(self.wrapper)
		self.btns.pack()#-------------------------------
	
		clean = Button(self.btns, text='Limpiar', bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=limpiar)
		clean.pack(side=RIGHT)

		update = Button(self.btns, text='Actualizar', bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=actualizar, state=DISABLED)
		update.pack(side=RIGHT)
		
		add = Button(self.btns, text='Agregar', bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=Agregar)
		add.pack(side=RIGHT)
		
		#========================= ASIDE ===========================
		
		self.aside = Frame(self)
		self.aside.pack(side=LEFT, fill=BOTH, expand=True)
		
		self.wrap1 = Frame(self.aside)
		self.wrap1.pack()
		
		self.viewer = Label(self.wrap1, text="LISTA DE PROPIETARIOS")
		self.viewer.pack()

		scroll = Scrollbar(self.wrap1, orient=VERTICAL)
		scroll.pack(side=RIGHT, fill=Y)
		
		lb = Listbox(self.wrap1, yscrollcommand=scroll.set, height=20, width=30, bg='#d8ecf3')
		scroll.config (command=lb.yview)
		lb.pack(fill=BOTH)
		lb.bind("<Double-Button-1>", callback)
		lb.bind("<Button-3>", popup)
		#lb.bind('<Escape>', release)
		
		self.wrap2 = Frame(self.aside)
		self.wrap2.pack()
		
		self.updateBP = Button(self.wrap2, text='Cargar lista', width=20, bg='navy', foreground='white', activebackground='red3', activeforeground='white', command=cargar_lista)
		self.updateBP.pack()
		
		delete = Button(self.wrap2, text='Borrar', bg='navy', width=20, foreground='white', activebackground='red3', activeforeground='white', command=borrar)
		delete.pack()
		
		edit = Button(self.wrap2, text='Modificar', bg='navy', width=20, foreground='white', activebackground='red3', activeforeground='white', command=modificar)
		edit.pack()
		
		self.wrap3 = Frame(self.aside)
		self.wrap3.pack()
		
		buscador = Label(self.wrap3, text="Buscar por:")
		buscador.pack(side=LEFT)
		
		R1 = Radiobutton(self.wrap3, text="CC", variable=info, value=1)
		R1.pack(side=LEFT)
		R2 = Radiobutton (self.wrap3, text="Apellido", variable=info, value=2)
		R2.pack(side=LEFT)
		info.set(1)
		
		self.wrap4 = Frame(self.aside)
		self.wrap4.pack()
		
		E = Entry(self.wrap4, textvariable=busqueda, width=24)
		E.pack()
		E.bind("<KeyRelease>", caps)
예제 #42
0
    def __init__(self, master):
        
	self.fname=""
        #global variables
        self.t1=StringVar()
        self.t2=StringVar()
        self.t3=StringVar()
        self.t4=StringVar()
        self.t5=StringVar()
        self.t6=StringVar()
        self.t7=StringVar()
        self.t8=StringVar()
        
        self.var1=StringVar()
        self.var2=StringVar()
        self.var3=StringVar()
        self.var4=StringVar()
        self.var5=StringVar()
        self.var6=StringVar()
        self.var7=StringVar()
        self.var8=StringVar()
       
        #end
        
        mymaster = Frame(master, name='mymaster') # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window    
        #master.minsize(width=900, height=900)
        #master.maxsize(width=650, height=500)
        #end
        
        #title of window
        master.title("Airdecloak-ng")
        #end
        
        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont=tkFont.Font(family="Helvetica", size=15,underline = True)
        self.myfontnew=tkFont.Font(family="Helvetica", size=11,underline = True)
        #end
        
        
       
        nb = Notebook(mymaster, name='nb') # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3) # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Page1") # add tab to Notebook
    
        # repeat for each tab
        self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")
        
        #End
        
	#frame content 7
	Label(self.frame_content7, text = 'Airdecloak-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        btndetect=Button(self.frame_content7, text = 'Detect', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 1, column = 0, padx = 5, pady = 5)
		
	btndbrowse=Button(self.frame_content7, text = 'Attach File', command =self.browse_file, height=2, width=15, font=self.customFont).grid(row = 3, column = 0, padx = 5, pady = 5)	
	self.lilnew1=Listbox(self.frame_content7,bg="black", fg="white", font=self.myfont, selectmode=SINGLE, width=30, height=15)
        self.lilnew1.grid(row = 1, column = 1, rowspan=3)
	#End

        Label(self.frame_content, text = 'Airdecloak-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content, text = 'Options :',font=self.myfontnew, bg="white").grid(row = 1, column = 1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5, text = 'Edit Command From Here',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 0, column = 0)
        TextCommandBox=Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output=Text(self.frame_content5,bg="black", fg="white", font=self.myfont, height=20, width=42)
        self.output.grid(row = 0, column = 1, padx=50, pady=5, rowspan=3)
        btnsubmit=Button(self.frame_content5, width=15, height=2, text="Get Result", command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear=Button(self.frame_content5, width=15, height=2, text="Clear Output", command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-i", \
                 onvalue = "-i", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var1)
        self.C1.grid(row = 2, column = 0, padx = 5, pady = 5)
        self.t1=Text(self.frame_content,height=1,width = 20)
        self.t1.grid(row = 2, column = 1, padx = 5, pady = 5)
        l1=Label(self.frame_content, text = ': Input capture file',font=self.myfont, bg="white", justify=LEFT).grid(row = 2, column = 2, padx = 5, pady = 5)
        
        self.C2 = Checkbutton(self.frame_content, text = "--ssid", \
                 onvalue = "--ssid", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var2)
        self.C2.grid(row = 3, column = 0, padx = 5, pady = 5)
        self.t2=Text(self.frame_content,height=1,width = 20)
        self.t2.grid(row = 3, column = 1, padx = 5, pady = 5)
        l2=Label(self.frame_content, text = ': ESSID of the network to filter',font=self.myfont, bg="white", justify=LEFT).grid(row = 3, column = 2, padx = 5, pady = 5)
        
        self.C3 = Checkbutton(self.frame_content, text = "--bssid", \
                 onvalue = "--bssid", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row = 4, column = 0, padx = 5, pady = 5)
        self.t3=Text(self.frame_content,height=1,width = 20)
        self.t3.grid(row = 4, column = 1, padx = 5, pady = 5)
        l3=Label(self.frame_content, text = ': BSSID of the network to filter',font=self.myfont, bg="white", justify=LEFT).grid(row = 4, column = 2, padx = 5, pady = 5)
        
        self.C4 = Checkbutton(self.frame_content, text = "--filters", \
                 onvalue = "--filters", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var4)
        self.C4.grid(row = 5, column = 0, padx = 5, pady = 5)
        self.t4=Text(self.frame_content,height=1,width = 20)
        self.t4.grid(row = 5, column = 1, padx = 5, pady = 5)
        l4=Label(self.frame_content, text = ': Apply filters (separated by a comma)',font=self.myfont, bg="white", justify=LEFT).grid(row = 5, column = 2, padx = 5, pady = 5)
        
        self.C5 = Checkbutton(self.frame_content, text = "--null-packets", \
                 onvalue = "--null-packets", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var5)
        self.C5.grid(row = 6, column = 0, padx = 5, pady = 5)
        self.t5=Text(self.frame_content,height=1,width = 20)
        self.t5.grid(row = 6, column = 1, padx = 5, pady = 5)
        l5=Label(self.frame_content, text = ': Assume that null packets can be cloaked.',font=self.myfont, bg="white", justify=LEFT).grid(row = 6, column = 2, padx = 5, pady = 5)
        
        self.C6 = Checkbutton(self.frame_content, text = "--disable-base_filter", \
                 onvalue = "--disable-base_filter", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var6)
        self.C6.grid(row = 8, column = 0, padx = 5, pady = 5)
        self.t6=Text(self.frame_content,height=1,width = 20)
        self.t6.grid(row = 8, column = 1, padx = 5, pady = 5)
        l6=Label(self.frame_content, text = ': Do not apply base filter.',font=self.myfont, bg="white", justify=LEFT).grid(row = 8, column = 2, padx = 5, pady = 5)
        
        self.C7 = Checkbutton(self.frame_content, text = "--drop-frag", \
                 onvalue = "--drop-frag", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var7)
        self.C7.grid(row = 9, column = 0, padx = 5, pady = 5)
        self.t7=Text(self.frame_content,height=1,width = 20)
        self.t7.grid(row = 9, column = 1, padx = 5, pady = 5)
        l7=Label(self.frame_content, text = ': Drop fragmented packets',font=self.myfont, bg="white", justify=LEFT).grid(row = 9, column = 2, padx = 5, pady = 5)
        
        self.C8 = Checkbutton(self.frame_content, text = "--help", \
                onvalue = "--help", offvalue = "", height=1, \
                width = 7, bg="white", font=self.customFont,variable=self.var8)
        self.C8.grid(row = 10, column = 0, padx = 5, pady = 5)
        self.t8=Text(self.frame_content,height=1,width = 20)
        self.t8.grid(row = 10, column = 1, padx = 5, pady = 5)
        l8=Label(self.frame_content, text = ': Displays this usage screen',font=self.myfont, bg="white", justify=LEFT).grid(row = 10, column = 2, padx = 5, pady = 5)
예제 #43
0
    def __init__(self, master):
        
	self.fname=""
        #global variables
        self.t1=StringVar()
        self.t2=StringVar()
        self.t3=StringVar()
        self.t4=StringVar()
        self.t5=StringVar()
        self.t6=StringVar()
        self.t7=StringVar()
        self.t8=StringVar()
        self.t9=StringVar()
        self.t10=StringVar()
        self.t11=StringVar()
        self.t12=StringVar()
        self.t13=StringVar()
        self.t14=StringVar()
        self.t15=StringVar()
        self.t16=StringVar()
        self.t17=StringVar()
        self.t18=StringVar()
        self.t19=StringVar()
        self.t20=StringVar()
        self.t21=StringVar()
        self.t22=StringVar()
        self.t23=StringVar()
        self.t24=StringVar()
        self.t25=StringVar()
        self.t26=StringVar()
        self.t27=StringVar()
        self.t28=StringVar()
        self.t29=StringVar()
        self.t30=StringVar()
        self.t31=StringVar()
        self.t32=StringVar()
        self.t33=StringVar()
        self.t34=StringVar()
        
        self.var1=StringVar()
        self.var2=StringVar()
        self.var3=StringVar()
        self.var4=StringVar()
        self.var5=StringVar()
        self.var6=StringVar()
        self.var7=StringVar()
        self.var8=StringVar()
        self.var9=StringVar()
        self.var10=StringVar()
        self.var11=StringVar()
        self.var12=StringVar()
        self.var13=StringVar()
        self.var14=StringVar()
        self.var15=StringVar()
        self.var16=StringVar()
        self.var17=StringVar()
        self.var18=StringVar()
        self.var19=StringVar()
        self.var20=StringVar()
        self.var21=StringVar()
        self.var22=StringVar()
        self.var23=StringVar()
        self.var24=StringVar()
        self.var25=StringVar()
        self.var26=StringVar()
        self.var27=StringVar()
        self.var28=StringVar()
        self.var29=StringVar()
        self.var30=StringVar()
        self.var31=StringVar()
        self.var32=StringVar()
        self.var33=StringVar()
        self.var34=StringVar()
        #end
        
        mymaster = Frame(master, name='mymaster') # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window    
        #master.minsize(width=900, height=900)
        #master.maxsize(width=650, height=385)
        #end
        
        #title of window
        master.title("Airbase-ng")
        #end
        
        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont=tkFont.Font(family="Helvetica", size=15,underline = True)
        self.myfontnew=tkFont.Font(family="Helvetica", size=11,underline = True)
        #end
        
        
       
        nb = Notebook(mymaster, name='nb') # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3) # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1") # add tab to Notebook
    
        # repeat for each tab
        self.frame_content2 = Frame(nb, name='frame_content2', bg="white")
        nb.add(self.frame_content2, text="Filter-2")
        self.frame_content3 = Frame(nb, name='frame_content3', bg="white")
        nb.add(self.frame_content3, text="Filter-3")
        self.frame_content4 = Frame(nb, name='frame_content4', bg="white")
        nb.add(self.frame_content4, text="Filter-4")
        self.frame_content6 = Frame(nb, name='frame_content6', bg="white")
        nb.add(self.frame_content6, text="Filter-5")
	self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")
        
        #End
	#frame content 7
	Label(self.frame_content7, text = 'Airbase-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        btndetect=Button(self.frame_content7, text = 'Detect', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 1, column = 0, padx = 5, pady = 5)
		
	btndbrowse=Button(self.frame_content7, text = 'Attach File', command =self.browse_file, height=2, width=15, font=self.customFont).grid(row = 3, column = 0, padx = 5, pady = 5)	
	self.lilnew1=Listbox(self.frame_content7,bg="black", fg="white", font=self.myfont, selectmode=SINGLE, width=30, height=15)
        self.lilnew1.grid(row = 1, column = 1, rowspan=3)
	#End        
	
        Label(self.frame_content, text = 'Airbase-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content, text = 'Options :',font=self.myfontnew, bg="white").grid(row = 1, column = 1)
        #command Listbox
        Label(self.frame_content5, text = 'Edit Command From Here',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 0, column = 0)
        TextCommandBox=Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output=Text(self.frame_content5,bg="black", fg="white", font=self.myfont, height=20, width=42)
        self.output.grid(row = 0, column = 1, padx=50, pady=5, rowspan=3)
        btnsubmit=Button(self.frame_content5, width=15, height=2, text="Get Result", command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear=Button(self.frame_content5, width=15, height=2, text="Clear Output", command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-a", \
                 onvalue = "-a", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var1)
        self.C1.grid(row = 2, column = 0, padx = 5, pady = 5)
        self.t1=Text(self.frame_content,height=1,width = 20)
        self.t1.grid(row = 2, column = 1, padx = 5, pady = 5)
        l1=Label(self.frame_content, text = ': set Access Point MAC address',font=self.myfont, bg="white", justify=LEFT).grid(row = 2, column = 2, padx = 5, pady = 5)
        
        self.C2 = Checkbutton(self.frame_content, text = "-i", \
                 onvalue = "-i", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var2)
        self.C2.grid(row = 3, column = 0, padx = 5, pady = 5)
        self.t2=Text(self.frame_content,height=1,width = 20)
        self.t2.grid(row = 3, column = 1, padx = 5, pady = 5)
        l2=Label(self.frame_content, text = ': capture packets from this interface',font=self.myfont, bg="white", justify=LEFT).grid(row = 3, column = 2, padx = 5, pady = 5)
        
        self.C3 = Checkbutton(self.frame_content, text = "-w", \
                 onvalue = "-w", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row = 4, column = 0, padx = 5, pady = 5)
        self.t3=Text(self.frame_content,height=1,width = 20)
        self.t3.grid(row = 4, column = 1, padx = 5, pady = 5)
        l3=Label(self.frame_content, text = ': use this WEP key to encrypt/decrypt packets',font=self.myfont, bg="white", justify=LEFT).grid(row = 4, column = 2, padx = 5, pady = 5)
        
        self.C4 = Checkbutton(self.frame_content, text = "-h", \
                 onvalue = "-h", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var4)
        self.C4.grid(row = 5, column = 0, padx = 5, pady = 5)
        self.t4=Text(self.frame_content,height=1,width = 20)
        self.t4.grid(row = 5, column = 1, padx = 5, pady = 5)
        l4=Label(self.frame_content, text = ': source mac for MITM mode',font=self.myfont, bg="white", justify=LEFT).grid(row = 5, column = 2, padx = 5, pady = 5)
        
        self.C5 = Checkbutton(self.frame_content, text = "-f", \
                 onvalue = "-f", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var5)
        self.C5.grid(row = 6, column = 0, padx = 5, pady = 5)
        self.t5=Text(self.frame_content,height=1,width = 20)
        self.t5.grid(row = 6, column = 1, padx = 5, pady = 5)
        l5=Label(self.frame_content, text = ': disallow specified client MACs (default: allow)',font=self.myfont, bg="white", justify=LEFT).grid(row = 6, column = 2, padx = 5, pady = 5)
        
        self.C6 = Checkbutton(self.frame_content, text = "-W", \
                 onvalue = "-W", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var6)
        self.C6.grid(row = 7, column = 0, padx = 5, pady = 5)
        self.t6=Text(self.frame_content,height=1,width = 20)
        self.t6.grid(row = 7, column = 1, padx = 5, pady = 5)
        l6=Label(self.frame_content, text = ': [don\'t] set WEP flag in beacons 0|1 (default: auto)',font=self.myfont, bg="white", justify=LEFT).grid(row = 7, column = 2, padx = 5, pady = 5)
        
        self.C7 = Checkbutton(self.frame_content, text = "-q", \
                 onvalue = "-q", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var7)
        self.C7.grid(row = 8, column = 0, padx = 5, pady = 5)
        self.t7=Text(self.frame_content,height=1,width = 20)
        self.t7.grid(row = 8, column = 1, padx = 5, pady = 5)
        l7=Label(self.frame_content, text = ': quiet (do not print statistics)',font=self.myfont, bg="white", justify=LEFT).grid(row = 8, column = 2, padx = 5, pady = 5)
        
        self.C8 = Checkbutton(self.frame_content2, text = "-v", \
                 onvalue = "-v", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var8)
        self.C8.grid(row = 9, column = 0, padx = 5, pady = 5)
        self.t8=Text(self.frame_content2,height=1,width = 20)
        self.t8.grid(row = 9, column = 1, padx = 5, pady = 5)
        l8=Label(self.frame_content2, text = ':  verbose (print more messages) (long --verbose)',font=self.myfont, bg="white", justify=LEFT).grid(row = 9, column = 2, padx = 5, pady = 5)
        
        self.C9 = Checkbutton(self.frame_content2, text = "-M", \
                 onvalue = "-M", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var9)
        self.C9.grid(row = 10, column = 0, padx = 5, pady = 5)
        self.t9=Text(self.frame_content2,height=1,width = 20)
        self.t9.grid(row = 10, column = 1, padx = 5, pady = 5)
        l9=Label(self.frame_content2, text = ': M-I-T-M between [specified] clients and bssids',font=self.myfont, bg="white", justify=LEFT).grid(row = 10, column = 2, padx = 5, pady = 5)
        
        Label(self.frame_content2, text = 'Airbase-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        
        self.C10 = Checkbutton(self.frame_content2, text = "-A", \
                 onvalue = "-A", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var10)
        self.C10.grid(row = 11, column = 0, padx = 5, pady = 5)
        self.t10=Text(self.frame_content2,height=1,width = 20)
        self.t10.grid(row = 11, column = 1, padx = 5, pady = 5)
        l10=Label(self.frame_content2, text = ': Ad-Hoc Mode (allows other clients to peer) (long --ad-hoc)',font=self.myfont, bg="white", justify=LEFT).grid(row = 11, column = 2, padx = 5, pady = 5)
        
        self.C11 = Checkbutton(self.frame_content2, text = "-Y", \
                 onvalue = "-Y", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var11)
        self.C11.grid(row = 12, column = 0, padx = 5, pady = 5)
        self.t11=Text(self.frame_content2,height=1,width = 20)
        self.t11.grid(row = 12, column = 1, padx = 5, pady = 5)
        l11=Label(self.frame_content2, text = ': external packet processing',font=self.myfont, bg="white", justify=LEFT).grid(row = 12, column = 2, padx = 5, pady = 5)
        
        self.C12 = Checkbutton(self.frame_content2, text = "-c", \
                 onvalue = "-c", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var12)
        self.C12.grid(row = 13, column = 0, padx = 5, pady = 5)
        self.t12=Text(self.frame_content2,height=1,width = 20)
        self.t12.grid(row = 13, column = 1, padx = 5, pady = 5)
        l12=Label(self.frame_content2, text = ': sets the channel the AP is running on',font=self.myfont, bg="white", justify=LEFT).grid(row = 13, column = 2, padx = 5, pady = 5)
        
        self.C13 = Checkbutton(self.frame_content2, text = "-X", \
                 onvalue = "-X", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var13)
        self.C13.grid(row = 14, column = 0, padx = 5, pady = 5)
        self.t13=Text(self.frame_content2,height=1,width = 20)
        self.t13.grid(row = 14, column = 1, padx = 5, pady = 5)
        l13=Label(self.frame_content2, text = ': hidden ESSID (long --hidden)',font=self.myfont, bg="white", justify=LEFT).grid(row = 14, column = 2, padx = 5, pady = 5)
        
        self.C14 = Checkbutton(self.frame_content2, text = "-s", \
                 onvalue = "-s", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var14)
        self.C14.grid(row = 15, column = 0, padx = 5, pady = 5)
        self.t14=Text(self.frame_content2,height=1,width = 20)
        self.t14.grid(row = 15, column = 1, padx = 5, pady = 5)
        l14=Label(self.frame_content2, text = ': force shared key authentication',font=self.myfont, bg="white").grid(row = 15, column = 2, padx = 5, pady = 5)
        
        
        Label(self.frame_content3, text = 'Airbase-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content3, text = 'Filter Options :',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 16, column = 1)
        
        self.C15 = Checkbutton(self.frame_content3, text = "-S", \
                 onvalue = "-S", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var15)
        self.C15.grid(row = 17, column = 0, padx = 5, pady = 5)
        self.t15=Text(self.frame_content3,height=1,width = 20)
        self.t15.grid(row = 17, column = 1, padx = 5, pady = 5)
        l15=Label(self.frame_content3, text = ': set shared key challenge length (default: 128)',font=self.myfont, bg="white", justify=LEFT).grid(row = 17, column = 2, padx = 5, pady = 5)
        
        self.C16 = Checkbutton(self.frame_content3, text = "-L", \
                 onvalue = "-L", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var16)
        self.C16.grid(row = 18, column = 0, padx = 5, pady = 5)
        self.t16=Text(self.frame_content3,height=1,width = 20)
        self.t16.grid(row = 18, column = 1, padx = 5, pady = 5)
        l16=Label(self.frame_content3, text = ': Caffe-Latte attack (long --caffe-latte)',font=self.myfont, bg="white", justify=LEFT).grid(row = 18, column = 2, padx = 5, pady = 5)
        
        self.C17 = Checkbutton(self.frame_content3, text = "-N", \
                 onvalue = "-N", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var17)
        self.C17.grid(row = 19, column = 0, padx = 5, pady = 5)
        self.t17=Text(self.frame_content3,height=1,width = 20)
        self.t17.grid(row = 19, column = 1, padx = 5, pady = 5)
        l17=Label(self.frame_content3, text = ':  creates arp request against wep client (long cfrag)',font=self.myfont, bg="white", justify=LEFT).grid(row = 19, column = 2, padx = 5, pady = 5)
    
        
        self.C18 = Checkbutton(self.frame_content3, text = "-x", \
                 onvalue = "-x", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var18)
        self.C18.grid(row = 21, column = 0, padx = 5, pady = 5)
        self.t18=Text(self.frame_content3,height=1,width = 20)
        self.t18.grid(row = 21, column = 1, padx = 5, pady = 5)
        l18=Label(self.frame_content3, text = ': number of packets per second (default: 100)',font=self.myfont, bg="white", justify=LEFT).grid(row = 21, column = 2, padx = 5, pady = 5)
        
        self.C19 = Checkbutton(self.frame_content3, text = "-y", \
                 onvalue = "-y", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var19)
        self.C19.grid(row = 22, column = 0, padx = 5, pady = 5)
        self.t19=Text(self.frame_content3,height=1,width = 20)
        self.t19.grid(row = 22, column = 1, padx = 5, pady = 5)
        l19=Label(self.frame_content3, text = ': disables responses to broadcast probes',font=self.myfont, bg="white", justify=LEFT).grid(row = 22, column = 2, padx = 5, pady = 5)
        
        Label(self.frame_content4, text = 'Airbase-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        
        self.C20 = Checkbutton(self.frame_content4, text = "--o", \
                 onvalue = "--o", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var20)
        self.C20.grid(row = 23, column = 0, padx = 5, pady = 5)
        self.t20=Text(self.frame_content4,height=1,width = 20)
        self.t20.grid(row = 23, column = 1, padx = 5, pady = 5)
        l20=Label(self.frame_content4, text = ': set all WPA,WEP,open tags. can\'t be used with -z & -Z',font=self.myfont, bg="white", justify=LEFT).grid(row = 23, column = 2, padx = 5, pady = 5)
        
        self.C21 = Checkbutton(self.frame_content4, text = "-z", \
                 onvalue = "-z", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var21)
        self.C21.grid(row = 24, column = 0, padx = 5, pady = 5)
        self.t21=Text(self.frame_content4,height=1,width = 20)
        self.t21.grid(row = 24, column = 1, padx = 5, pady = 5)
        l21=Label(self.frame_content4, text = ':  sets WPA1 tags. 1=WEP40 2=TKIP 3=WRAP 4=CCMP 5=WEP104',font=self.myfont, bg="white", justify=LEFT).grid(row = 24, column = 2, padx = 5, pady = 5)
        
        self.C22 = Checkbutton(self.frame_content4, text = "-Z", \
                 onvalue = "-Z", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var22)
        self.C22.grid(row = 25, column = 0, padx = 5, pady = 5)
        self.t22=Text(self.frame_content4,height=1,width = 20)
        self.t22.grid(row = 25, column = 1, padx = 5, pady = 5)
        l22=Label(self.frame_content4, text = ':  same as -z, but for WPA2',font=self.myfont, bg="white", justify=LEFT).grid(row = 25, column = 2, padx = 5, pady = 5)
        
        self.C23 = Checkbutton(self.frame_content4, text = "-V", \
                 onvalue = "-V", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var23)
        self.C23.grid(row = 26, column = 0, padx = 5, pady = 5)
        self.t23=Text(self.frame_content4,height=1,width = 20)
        self.t23.grid(row = 26, column = 1, padx = 5, pady = 5)
        l23=Label(self.frame_content4, text = ':  fake EAPOL 1=MD5 2=SHA1 3=auto',font=self.myfont, bg="white", justify=LEFT).grid(row = 26, column = 2, padx = 5, pady = 5)
        
        self.C24 = Checkbutton(self.frame_content4, text = "-F", \
                 onvalue = "-F", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var24)
        self.C24.grid(row = 27, column = 0, padx = 5, pady = 5)
        self.t24=Text(self.frame_content4,height=1,width = 20)
        self.t24.grid(row = 27, column = 1, padx = 5, pady = 5)
        l24=Label(self.frame_content4, text = ':  write all sent and received frames into pcap file',font=self.myfont, bg="white", justify=LEFT).grid(row = 27, column = 2, padx = 5, pady = 5)
        
        self.C25 = Checkbutton(self.frame_content4, text = "-P", \
                 onvalue = "-P", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var25)
        self.C25.grid(row = 28, column = 0, padx = 5, pady = 5)
        self.t25=Text(self.frame_content4,height=1,width = 20)
        self.t25.grid(row = 28, column = 1, padx = 5, pady = 5)
        l25=Label(self.frame_content4, text = ':  respond to all probes, even when specifying ESSIDs',font=self.myfont, bg="white", justify=LEFT).grid(row = 28, column = 2, padx = 5, pady = 5)
        
        
        self.C26 = Checkbutton(self.frame_content4, text = "-I", \
                 onvalue = "-I", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var26)
        self.C26.grid(row = 29, column = 0, padx = 5, pady = 5)
        self.t26=Text(self.frame_content4,height=1,width = 20)
        self.t26.grid(row = 29, column = 1, padx = 5, pady = 5)
        l26=Label(self.frame_content4, text = ':  sets the beacon interval value in ms',font=self.myfont, bg="white", justify=LEFT).grid(row = 29, column = 2, padx = 5, pady = 5)
        
        self.C27 = Checkbutton(self.frame_content4, text = "-C", \
                 onvalue = "-C", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var27)
        self.C27.grid(row = 30, column = 0, padx = 5, pady = 5)
        self.t27=Text(self.frame_content4,height=1,width = 20)
        self.t27.grid(row = 30, column = 1, padx = 5, pady = 5)
        l27=Label(self.frame_content4, text = ':   enables beaconing of probed ESSID values (requires -P)',font=self.myfont, bg="white", justify=LEFT).grid(row = 30, column = 2, padx = 5, pady = 5)
        
        Label(self.frame_content6, text = 'Airbase-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content6, text = 'Filter Options :',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 16, column = 1)
        
        self.C28 = Checkbutton(self.frame_content6, text = "--bssid", \
                 onvalue = "--bssid", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var28)
        self.C28.grid(row = 31, column = 0, padx = 5, pady = 5)
        self.t28=Text(self.frame_content6,height=1,width = 20)
        self.t28.grid(row = 31, column = 1, padx = 5, pady = 5)
        l28=Label(self.frame_content6, text = ':  BSSID to filter/use (short -b)',font=self.myfont, bg="white", justify=LEFT).grid(row = 31, column = 2, padx = 5, pady = 5)
        
        self.C29 = Checkbutton(self.frame_content6, text = "--bssids", \
                 onvalue = "--bssids", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var29)
        self.C29.grid(row = 32, column = 0, padx = 5, pady = 5)
        self.t29=Text(self.frame_content6,height=1,width = 20)
        self.t29.grid(row = 32, column = 1, padx = 5, pady = 5)
        l29=Label(self.frame_content6, text = ':  read a list of BSSIDs out of that file (short -B)',font=self.myfont, bg="white", justify=LEFT).grid(row = 32, column = 2, padx = 5, pady = 5)
        
        self.C30 = Checkbutton(self.frame_content6, text = "--client", \
                 onvalue = "--client", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var30)
        self.C30.grid(row = 33, column = 0, padx = 5, pady = 5)
        self.t30=Text(self.frame_content6,height=1,width = 20)
        self.t30.grid(row = 33, column = 1, padx = 5, pady = 5)
        l30=Label(self.frame_content6, text = ':   MAC of client to accept (short -d)',font=self.myfont, bg="white", justify=LEFT).grid(row = 33, column = 2, padx = 5, pady = 5)
        
        self.C31 = Checkbutton(self.frame_content6, text = "--clients", \
                 onvalue = "--clients", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var31)
        self.C31.grid(row = 34, column = 0, padx = 5, pady = 5)
        self.t31=Text(self.frame_content6,height=1,width = 20)
        self.t31.grid(row = 34, column = 1, padx = 5, pady = 5)
        l31=Label(self.frame_content6, text = ':  read a list of MACs out of that file (short -D)',font=self.myfont, bg="white", justify=LEFT).grid(row = 34, column = 2, padx = 5, pady = 5)
        
        self.C32 = Checkbutton(self.frame_content6, text = "--essid", \
                 onvalue = "--essid", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var32)
        self.C32.grid(row = 35, column = 0, padx = 5, pady = 5)
        self.t32=Text(self.frame_content6,height=1,width = 20)
        self.t32.grid(row = 35, column = 1, padx = 5, pady = 5)
        l32=Label(self.frame_content6, text = ':  specify a single ESSID (short -e)',font=self.myfont, bg="white", justify=LEFT).grid(row = 35, column = 2, padx = 5, pady = 5)
        
        self.C33 = Checkbutton(self.frame_content6, text = "--essids", \
                 onvalue = "--essids", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var33)
        self.C33.grid(row = 36, column = 0, padx = 5, pady = 5)
        self.t33=Text(self.frame_content6,height=1,width = 20)
        self.t33.grid(row = 36, column = 1, padx = 5, pady = 5)
        l33=Label(self.frame_content6, text = ':  read a list of ESSIDs out of that file (short -E)',font=self.myfont, bg="white", justify=LEFT).grid(row = 36, column = 2, padx = 5, pady = 5)
        
        self.C34 = Checkbutton(self.frame_content6, text = "--help", \
                 onvalue = "--help", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var34)
        self.C34.grid(row = 37, column = 0, padx = 5, pady = 5)
        self.t34=Text(self.frame_content6,height=1,width = 20)
        self.t34.grid(row = 37, column = 1, padx = 5, pady = 5)
        l34=Label(self.frame_content6, text = ':  Displays the usage screen (short -H)',font=self.myfont, bg="white", justify=LEFT).grid(row = 37, column = 2, padx = 5, pady = 5)
예제 #44
0
    def __init__(self, master):
        
	self.fname=""
        #global variables
        self.t1=StringVar()
        self.t2=StringVar()
        self.t3=StringVar()
        self.t4=StringVar()
        self.t5=StringVar()
        self.t6=StringVar()
       
        
        self.var1=StringVar()
        self.var2=StringVar()
        self.var3=StringVar()
        self.var4=StringVar()
        self.var5=StringVar()
        self.var6=StringVar()
        
       
        #end
        
        mymaster = Frame(master, name='mymaster') # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window    
        #master.minsize(width=900, height=900)
        #master.maxsize(width=650, height=500)
        #end
        
        #title of window
        master.title("Airdecap-ng")
        #end
        
        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont=tkFont.Font(family="Helvetica", size=15,underline = True)
        self.myfontnew=tkFont.Font(family="Helvetica", size=11,underline = True)
        #end
        
        
       
        nb = Notebook(mymaster, name='nb') # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3) # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="FIlter-1") # add tab to Notebook
	self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")
    
        # repeat for each tab
        
        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")
        
        #End
        
	#frame content 7
	Label(self.frame_content7, text = 'Airdecap-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        btndetect=Button(self.frame_content7, text = 'Detect', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 1, column = 0, padx = 5, pady = 5)
		
	btndbrowse=Button(self.frame_content7, text = 'Attach File', command =self.browse_file, height=2, width=15, font=self.customFont).grid(row = 3, column = 0, padx = 5, pady = 5)	
	self.lilnew1=Listbox(self.frame_content7,bg="black", fg="white", font=self.myfont, selectmode=SINGLE, width=30, height=15)
        self.lilnew1.grid(row = 1, column = 1, rowspan=3)
	#End
	
        Label(self.frame_content, text = 'Airdecap-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content, text = 'Options :',font=self.myfontnew, bg="white").grid(row = 1, column = 1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5, text = 'Edit Command From Here',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 0, column = 0)
        TextCommandBox=Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output=Text(self.frame_content5,bg="black", fg="white", font=self.myfont, height=20, width=42)
        self.output.grid(row = 0, column = 1, padx=50, pady=5, rowspan=3)
        btnsubmit=Button(self.frame_content5, width=15, height=2, text="Get Result", command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear=Button(self.frame_content5, width=15, height=2, text="Clear Output", command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-l", \
                 onvalue = "-l", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var1)
        self.C1.grid(row = 2, column = 0, padx = 5, pady = 5)
        self.t1=Text(self.frame_content,height=1,width = 20)
        self.t1.grid(row = 2, column = 1, padx = 5, pady = 5)
        l1=Label(self.frame_content, text = ': don\'t remove the 802.11 header',font=self.myfont, bg="white", justify=LEFT).grid(row = 2, column = 2, padx = 5, pady = 5)
        
        self.C2 = Checkbutton(self.frame_content, text = "-b", \
                 onvalue = "-b", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var2)
        self.C2.grid(row = 3, column = 0, padx = 5, pady = 5)
        self.t2=Text(self.frame_content,height=1,width = 20)
        self.t2.grid(row = 3, column = 1, padx = 5, pady = 5)
        l2=Label(self.frame_content, text = ': access point MAC address filter',font=self.myfont, bg="white", justify=LEFT).grid(row = 3, column = 2, padx = 5, pady = 5)
        
        self.C3 = Checkbutton(self.frame_content, text = "-k", \
                 onvalue = "-k", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row = 4, column = 0, padx = 5, pady = 5)
        self.t3=Text(self.frame_content,height=1,width = 20)
        self.t3.grid(row = 4, column = 1, padx = 5, pady = 5)
        l3=Label(self.frame_content, text = ': WPA/WPA2 Pairwise Master Key in hex',font=self.myfont, bg="white", justify=LEFT).grid(row = 4, column = 2, padx = 5, pady = 5)
        
        self.C4 = Checkbutton(self.frame_content, text = "-e", \
                 onvalue = "-e", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var4)
        self.C4.grid(row = 5, column = 0, padx = 5, pady = 5)
        self.t4=Text(self.frame_content,height=1,width = 20)
        self.t4.grid(row = 5, column = 1, padx = 5, pady = 5)
        l4=Label(self.frame_content, text = ': target network ascii identifier',font=self.myfont, bg="white", justify=LEFT).grid(row = 5, column = 2, padx = 5, pady = 5)
        
        self.C5 = Checkbutton(self.frame_content, text = "-p", \
                 onvalue = "-p", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var5)
        self.C5.grid(row = 6, column = 0, padx = 5, pady = 5)
        self.t5=Text(self.frame_content,height=1,width = 20)
        self.t5.grid(row = 6, column = 1, padx = 5, pady = 5)
        l5=Label(self.frame_content, text = ': target network WPA/WPA2 passphrase',font=self.myfont, bg="white", justify=LEFT).grid(row = 6, column = 2, padx = 5, pady = 5)
        
        self.C6 = Checkbutton(self.frame_content, text = "-w", \
                 onvalue = "-w", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var6)
        self.C6.grid(row = 8, column = 0, padx = 5, pady = 5)
        self.t6=Text(self.frame_content,height=1,width = 20)
        self.t6.grid(row = 8, column = 1, padx = 5, pady = 5)
        l6=Label(self.frame_content, text = ': target network WEP key in hexadecimal',font=self.myfont, bg="white", justify=LEFT).grid(row = 8, column = 2, padx = 5, pady = 5)
예제 #45
0
    def __init__(self, master):
        
        self.fname="" 
        #global variables
        self.t1=StringVar()
        self.t2=StringVar()
        self.t3=StringVar()
        self.t4=StringVar()
        self.t5=StringVar()
        
       
        
        self.var1=StringVar()
        self.var2=StringVar()
        self.var3=StringVar()
        self.var4=StringVar()
        self.var5=StringVar()
        
        
       
        #end
        mymaster = Frame(master, name='mymaster') # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window    
        #master.minsize(width=900, height=900)
        #master.maxsize(width=650, height=500)
        #end
        
        #title of window
        master.title("Airgraph-ng")
        #end
        
        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont=tkFont.Font(family="Helvetica", size=15,underline = True)
        self.myfontnew=tkFont.Font(family="Helvetica", size=11,underline = True)
        #end
        
        
       
        nb = Notebook(mymaster, name='nb') # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3) # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,name="frame_content", bg="lightsteelblue")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1") # add tab to Notebook
    
        # repeat for each tab
        
	self.frame_content7 = Frame(nb, name='frame_content7', bg="lightsteelblue")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb, name='frame_content5', bg="lightsteelblue")
        nb.add(self.frame_content5, text="output")
        
        #End
	#frame content 7
	Label(self.frame_content7, text = 'Airgraph-ng',font=self.headerfont, bg="midnightblue", fg="firebrick", padx=10, pady=10).grid(row = 0, column = 0)
        btndetect=Button(self.frame_content7, text = 'Detect', fg="cornflowerblue", command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 1, column = 0, padx = 5, pady = 5)
		
	btndbrowse=Button(self.frame_content7, text = 'Attach File', fg="cornflowerblue", command =self.browse_file, height=2, width=15, font=self.customFont).grid(row = 3, column = 0, padx = 5, pady = 5)	
	self.lilnew1=Listbox(self.frame_content7,bg="black", fg="firebrick", font=self.myfont, selectmode=SINGLE, width=30, height=15)
        self.lilnew1.grid(row = 1, column = 1, rowspan=3)
	#End
        
        Label(self.frame_content, text = 'Airgraph-ng',font=self.headerfont, bg="midnightblue", fg="firebrick", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content, text = 'Options :',font=self.myfontnew, bg="midnightblue", fg="deepskyblue").grid(row = 1, column = 1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5, text = 'Edit Command From Here',font=self.myfontnew, bg="midnightblue", fg="deepskyblue", justify=LEFT).grid(row = 0, column = 0)
        TextCommandBox=Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output=Text(self.frame_content5,bg="black", fg="firebrick", font=self.myfont, height=20, width=42)
        self.output.grid(row = 0, column = 1, padx=50, pady=5, rowspan=3)
        btnsubmit=Button(self.frame_content5, width=15, height=2, text="Get Result", fg="cornflowerblue", command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear=Button(self.frame_content5, width=15, height=2, text="Clear Output", fg="cornflowerblue", command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-i", fg="deepskyblue", \
                 onvalue = "-i", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var1)
        self.C1.grid(row = 2, column = 0, padx = 5, pady = 5)
        self.t1=Text(self.frame_content,height=1,width = 20)
        self.t1.grid(row = 2, column = 1, padx = 5, pady = 5)
        l1=Label(self.frame_content, text = ': Input File',font=self.myfont, bg="midnightblue", fg="deepskyblue", justify=LEFT).grid(row = 2, column = 2, padx = 5, pady = 5)
        
        self.C2 = Checkbutton(self.frame_content, text = "-o", fg="deepskyblue", \
                 onvalue = "-o", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var2)
        self.C2.grid(row = 3, column = 0, padx = 5, pady = 5)
        self.t2=Text(self.frame_content,height=1,width = 20)
        self.t2.grid(row = 3, column = 1, padx = 5, pady = 5)
        l2=Label(self.frame_content, text = ': Output File',font=self.myfont, bg="midnightblue", fg="deepskyblue", justify=LEFT).grid(row = 3, column = 2, padx = 5, pady = 5)
        
        self.C3 = Checkbutton(self.frame_content, text = "-g", fg="deepskyblue", \
                 onvalue = "-g", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var3)
        self.C3.grid(row = 4, column = 0, padx = 5, pady = 5)
        self.t3=Text(self.frame_content,height=1,width = 20)
        self.t3.grid(row = 4, column = 1, padx = 5, pady = 5)
        l3=Label(self.frame_content, text = ':  Graph Type',font=self.myfont, bg="midnightblue", fg="deepskyblue", justify=LEFT).grid(row = 4, column = 2, padx = 5, pady = 5)
        
        self.C4 = Checkbutton(self.frame_content, text = "-a", fg="deepskyblue", \
                 onvalue = "-a", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var4)
        self.C4.grid(row = 5, column = 0, padx = 5, pady = 5)
        self.t4=Text(self.frame_content,height=1,width = 20)
        self.t4.grid(row = 5, column = 1, padx = 5, pady = 5)
        l4=Label(self.frame_content, text = ': Print the about',font=self.myfont, bg="midnightblue", fg="deepskyblue", justify=LEFT).grid(row = 5, column = 2, padx = 5, pady = 5)
        
        self.C5 = Checkbutton(self.frame_content, text = "-h", fg="deepskyblue", \
                 onvalue = "-h", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var5)
        self.C5.grid(row = 6, column = 0, padx = 5, pady = 5)
        self.t5=Text(self.frame_content,height=1,width = 20)
        self.t5.grid(row = 6, column = 1, padx = 5, pady = 5)
        l5=Label(self.frame_content, text = ':  Print this help.',font=self.myfont, bg="midnightblue", fg="deepskyblue", justify=LEFT).grid(row = 6, column = 2, padx = 5, pady = 5)
예제 #46
0
class Propietarios(Frame):
    def __init__(self, parent, controller):
        Frame.__init__(self, parent)

        #VARIABLES GLOBALES
        global cedula, titulo, ingreso, rsocial, residencia, nombres, apellidos, direccion, telefono, oficina, tel, telfax, correo, cumpleanos, dia, mes, envio, celular, tipopersona, comision, retefuente, reteiva, gcontribuyente, gfactura, gcheque, reprecc, reprenombres, repredireccion, repretelefono, repreoficina, repretel, reprebanco, repretcuenta, reprenumcuenta, tit1cc, tit1nombres, tit1banco, tit1tcuenta, tit1numcuenta, tit2cc, tit2nombres, tit2banco, tit2tcuenta, tit2numcuenta, lb, note, popmenu, busqueda, dato, E
        #INSTANCIEAS DE LOS WIDGETS
        global ccE, refE, dateinE, socialE, cityE, nameE, lnameE, adressE, phoneE, officeE, officetelE, telfaxE, emailE, birthdayE, birthdayCbx, mailE, mobileE, personR1, personR2, comisionE, Ch1, Ch2, Ch3, Ch4, Ch5, note, cc0E, name0E, adress0E, phone0E, office0E, officetel0E, bank0Cbx, tbank0Cbx, tcuenta0E, cc1E, name1E, bank1Cbx, tbank1Cbx, tcuenta1E, cc2E, name2E, bank2Cbx, tbank2Cbx, tcuenta2E, add, update, delete, clean
        global info, lists, _propietarios

        _propietarios = dict()
        lists = []

        #Variables
        cedula = StringVar()
        titulo = StringVar()
        ingreso = StringVar()
        rsocial = StringVar()
        residencia = StringVar()
        nombres = StringVar()
        apellidos = StringVar()
        direccion = StringVar()
        telefono = StringVar()
        oficina = StringVar()
        tel = StringVar()
        telfax = StringVar()
        correo = StringVar()
        dia = IntVar()
        mes = StringVar()
        envio = StringVar()
        celular = StringVar()
        tipopersona = IntVar()
        comision = DoubleVar()
        retefuente = IntVar()
        reteiva = IntVar()
        gcontribuyente = IntVar()
        gfactura = IntVar()
        gcheque = IntVar()
        notas = StringVar()

        #----------------------------

        reprecc = StringVar()
        reprenombres = StringVar()
        repredireccion = StringVar()
        repretelefono = StringVar()
        repreoficina = StringVar()
        repretel = StringVar()
        reprebanco = StringVar()
        repretcuenta = StringVar()
        reprenumcuenta = StringVar()

        tit1cc = StringVar()
        tit1nombres = StringVar()
        tit1banco = StringVar()
        tit1tcuenta = StringVar()
        tit1numcuenta = StringVar()

        tit2cc = StringVar()
        tit2nombres = StringVar()
        tit2banco = StringVar()
        tit2tcuenta = StringVar()
        tit2numcuenta = StringVar()

        meses = [
            "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio",
            "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
        ]
        tbancos = [
            'Bancolombia', "Banco Bogotá", "Banco Agrario", "Banco Occidente"
        ]

        tbanktype = ['Corriente', 'Ahorro']

        #BUSQUEDA = ["Nombre","CC/Nit"]
        busqueda = StringVar()
        busqueda.trace("w", lambda name, index, mode: buscar())
        info = IntVar()
        #eleccion = IntVar()
        dato = StringVar()

        # MENU DEL MOUSE

        popmenu = Menu(self, tearoff=0)
        popmenu.add_command(label="Imprimir", command=hello)
        popmenu.add_command(label="Cargar", command=modificar)
        popmenu.add_command(label="Eliminar", command=borrar)
        #popmenu.add_separator()
        popmenu.bind('<Escape>', release)

        #WIDGETS

        #========================= HEADER ==============================

        self.header = Label(self, text="GESTIÓN DE PROPIETARIOS", font="bold")
        self.header.pack(pady=20, side=TOP)

        #========================== WRAPPER ============================
        #Contiene los Notebooks con los campos formulario

        self.wrapper = Frame(self)
        self.wrapper.pack(side=LEFT, fill=Y)
        #Esto centro el wrapper
        #self.wrapper.pack(side=LEFT, fill=BOTH, expand=True)

        #================ NOTEBOOK =============>

        self.nb = Notebook(self.wrapper)

        #-----------------------> TAB 1

        self.tab1 = Frame(self.nb)

        self.f0 = Frame(self.tab1)  #Para dejar espacio entre Tab y Label
        self.f0.pack(fill=X, pady=10)  #-------------------------------

        #========================= PERSONALES ==========================

        self.f1 = Frame(self.tab1)  #-------------------------------
        self.f1.pack(pady=5, fill=X)

        self.ccL = Label(self.f1, text='CC/Nit:')
        self.ccL.pack(side=LEFT)
        ccE = Entry(self.f1, textvariable=cedula)
        ccE.pack(side=LEFT, fill=X, expand=1)
        ccE.focus_set()

        self.refL = Label(self.f1, text='Título:')
        self.refL.pack(side=LEFT)
        refE = Entry(self.f1, textvariable=titulo, width=10)
        refE.pack(side=LEFT)
        #refE.bind("<KeyRelease>", caps)

        self.dateinL = Label(self.f1, text='Fecha Ingreso:')
        self.dateinL.pack(side=LEFT)
        dateinE = Entry(self.f1,
                        textvariable=ingreso,
                        width=10,
                        state=DISABLED)
        ingreso.set("0000-00-00")
        dateinE.pack(side=LEFT)

        self.f2 = Frame(self.tab1)  #-------------------------------
        self.f2.pack(pady=5, fill=X)

        self.socialL = Label(self.f2, text='Razón Social:')
        self.socialL.pack(side=LEFT)
        socialE = Entry(self.f2, textvariable=rsocial)
        socialE.pack(side=LEFT, fill=X, expand=1)
        socialE.bind("<KeyRelease>", caps)

        self.cityL = Label(self.f2, text='Ciudad de residencia:')
        self.cityL.pack(side=LEFT)
        cityE = Entry(self.f2, textvariable=residencia, width=15)
        cityE.pack(side=LEFT)
        cityE.bind("<KeyRelease>", caps)

        self.f3 = Frame(self.tab1)
        self.f3.pack(pady=5,
                     fill=X)  #-----------------------------------------

        self.nameL = Label(self.f3, text='Nombres:')
        self.nameL.pack(side=LEFT)
        nameE = Entry(self.f3, textvariable=nombres)
        nameE.pack(side=LEFT, fill=X, expand=1)
        nameE.bind("<KeyRelease>", caps)

        self.lnameL = Label(self.f3, text='Apellidos:')
        self.lnameL.pack(side=LEFT)
        lnameE = Entry(self.f3, textvariable=apellidos)
        lnameE.pack(side=LEFT, fill=X, expand=1)
        lnameE.bind("<KeyRelease>", caps)

        self.f4 = Frame(self.tab1)
        self.f4.pack(pady=5,
                     fill=X)  #-----------------------------------------

        self.adressL = Label(self.f4, text='Dir. Casa:')
        self.adressL.pack(side=LEFT)
        adressE = Entry(self.f4, textvariable=direccion)
        adressE.pack(side=LEFT, fill=X, expand=1)
        adressE.bind("<KeyRelease>", caps)

        self.phoneL = Label(self.f4, text='Tel:')
        self.phoneL.pack(side=LEFT)
        phoneE = Entry(self.f4, textvariable=telefono, width=20)
        phoneE.pack(side=LEFT)

        self.f5 = Frame(self.tab1)
        self.f5.pack(pady=5, fill=X)  #------------------------------------

        self.officeL = Label(self.f5, text='Dir. Oficina:')
        self.officeL.pack(side=LEFT)
        officeE = Entry(self.f5, textvariable=oficina, width=20)
        officeE.pack(side=LEFT, fill=X, expand=1)
        officeE.bind("<KeyRelease>", caps)

        self.officetelL = Label(self.f5, text='Tel:')
        self.officetelL.pack(side=LEFT)
        officetelE = Entry(self.f5, textvariable=tel, width=15)
        officetelE.pack(fill=X, side=LEFT)

        self.telfaxL = Label(self.f5, text='Tel. Fax:')
        self.telfaxL.pack(side=LEFT)
        telfaxE = Entry(self.f5, textvariable=telfax, width=10)
        telfaxE.pack(side=LEFT)

        self.f6 = Frame(self.tab1)
        self.f6.pack(pady=5, fill=X)  #------------------------------------

        self.emailL = Label(self.f6, text='Email:')
        self.emailL.pack(side=LEFT)
        emailE = Entry(self.f6, textvariable=correo, width=30)
        emailE.pack(side=LEFT)

        self.birthdayL = Label(self.f6, text='Cumpleaños:')
        self.birthdayL.pack(side=LEFT)

        self.birthdayL2 = Label(self.f6, text='Día:')
        self.birthdayL2.pack(padx=5, side=LEFT)

        #s = Spinbox(self.f6, from_=1, to=31,textvariable=dia, width=3)
        #s.pack(side=LEFT)

        birthdayE = Entry(self.f6, textvariable=dia, width=3)
        birthdayE.pack(side=LEFT)

        self.birthdayL3 = Label(self.f6, text='Mes:')
        self.birthdayL3.pack(padx=5, side=LEFT)

        birthdayCbx = Combobox(self.f6,
                               textvariable=mes,
                               values=meses,
                               width=10)
        birthdayCbx.set('Enero')
        birthdayCbx.pack(side=LEFT)

        self.f7 = Frame(self.tab1)
        self.f7.pack(pady=5, fill=X)  #------------------------------------

        self.mailL = Label(self.f7, text='Dir. Correspondencia:')
        self.mailL.pack(side=LEFT)
        mailE = Entry(self.f7, textvariable=envio)
        mailE.pack(side=LEFT, fill=X, expand=1)
        mailE.bind("<KeyRelease>", caps)

        self.mobileL = Label(self.f7, text='Celular:')
        self.mobileL.pack(side=LEFT)
        mobileE = Entry(self.f7, textvariable=celular, width=10)
        mobileE.pack(side=LEFT, fill=X, expand=1)

        self.f8 = Frame(self.tab1)
        self.f8.pack(pady=5, fill=X)  #------------------------------------

        self.personL = Label(self.f8, text='Tipo Persona:')
        self.personL.pack(side=LEFT)

        personR1 = Radiobutton(self.f8,
                               text="Natural",
                               variable=tipopersona,
                               value=1)
        personR1.pack(padx=20, side=LEFT)

        personR2 = Radiobutton(self.f8,
                               text="Jurídica",
                               variable=tipopersona,
                               value=2)
        personR2.pack(padx=20, side=LEFT)

        self.comisionL = Label(self.f8, text='$ Comisión:')
        self.comisionL.pack(side=LEFT)

        comisionE = Entry(self.f8, textvariable=comision, width=5)
        comisionE.pack(side=LEFT)

        self.f = Frame(self.tab1)
        self.f.pack(pady=5, fill=X)  #------------------------------------

        Ch1 = Checkbutton(self.f, text="Retefuente", variable=retefuente)
        Ch1.pack(side=LEFT)

        Ch2 = Checkbutton(self.f, text="Rete IVA", variable=reteiva)
        Ch2.pack(side=LEFT)

        Ch3 = Checkbutton(self.f,
                          text="Gran Contribuyente",
                          variable=gcontribuyente)
        Ch3.pack(side=LEFT)

        Ch4 = Checkbutton(self.f, text="Genera Factura", variable=gfactura)
        Ch4.pack(side=LEFT)

        Ch5 = Checkbutton(self.f, text="Genera Cheque", variable=gcheque)
        Ch5.pack(side=LEFT)

        self.f9 = Frame(self.tab1)
        self.f9.pack(pady=5, fill=X)  #------------------------------------

        self.notesL = Label(self.f9, text='Observaciones:')
        self.notesL.pack(side=LEFT)

        self.f10 = Frame(self.tab1)
        self.f10.pack(pady=5, fill=X)  #------------------------------------

        note = Text(self.f10, height=5)
        note.pack(side=LEFT, fill=X, expand=1)

        self.tab1.pack()

        #-----------------------> TAB 2

        self.tab2 = Frame(self.nb)
        self.tab2.pack()

        self.f0 = Frame(self.tab2)  #Para dejar espacio entre Tab y Label
        self.f0.pack(fill=X, pady=10)  #----------------------------------

        #======================= COMPLEMENTARIOS =======================

        self.lf = LabelFrame(self.tab2, text="Datos Representante")

        self.f0 = Frame(self.lf)
        self.f0.pack(fill=X, pady=5)  #-------------------------------

        self.ccRL = Label(self.f0, text='CC:')
        self.ccRL.pack(side=LEFT)
        cc0E = Entry(self.f0, textvariable=reprecc, width=10)
        cc0E.pack(side=LEFT, fill=X, expand=1)

        self.nameL = Label(self.f0, text='Nombres:')
        self.nameL.pack(side=LEFT)
        name0E = Entry(self.f0, textvariable=reprenombres)
        name0E.pack(side=LEFT, fill=X, expand=1)
        name0E.bind("<KeyRelease>", caps)

        self.f1 = Frame(self.lf)
        self.f1.pack(fill=X, pady=5)  #-------------------------------

        self.adressL = Label(self.f1, text='Dir. Casa:')
        self.adressL.pack(side=LEFT)
        adress0E = Entry(self.f1, textvariable=repredireccion)
        adress0E.pack(side=LEFT, fill=X, expand=1)
        adress0E.bind("<KeyRelease>", caps)

        self.phoneL = Label(self.f1, text='Tel:')
        self.phoneL.pack(side=LEFT)
        phone0E = Entry(self.f1, textvariable=repretelefono, width=20)
        phone0E.pack(side=LEFT)

        self.f2 = Frame(self.lf)
        self.f2.pack(fill=X, pady=5)  #-------------------------------

        self.officeL = Label(self.f2, text='Dir. Oficina:')
        self.officeL.pack(side=LEFT)
        office0E = Entry(self.f2, textvariable=repreoficina)
        office0E.pack(side=LEFT, fill=X, expand=1)
        office0E.bind("<KeyRelease>", caps)

        self.officetelL = Label(self.f2, text='Tel:')
        self.officetelL.pack(side=LEFT)
        officetel0E = Entry(self.f2, textvariable=repretel, width=20)
        officetel0E.pack(fill=X, side=LEFT)

        self.f3 = Frame(self.lf)
        self.f3.pack(fill=X)  #-------------------------------------------

        self.tbancpL = Label(self.f3, text='Banco:')
        self.tbancpL.pack(side=LEFT)
        bank0Cbx = Combobox(self.f3,
                            textvariable=reprebanco,
                            values=tbancos,
                            width=12)
        bank0Cbx.set('')
        bank0Cbx.pack(side=LEFT)

        self.tbancpL = Label(self.f3, text='Tipo Cuenta:')
        self.tbancpL.pack(side=LEFT)
        tbank0Cbx = Combobox(self.f3,
                             textvariable=repretcuenta,
                             values=tbanktype,
                             width=8)
        tbank0Cbx.set('')
        tbank0Cbx.pack(side=LEFT)

        self.tcuentaL = Label(self.f3, text='# Cuenta:')
        self.tcuentaL.pack(side=LEFT)
        tcuenta0E = Entry(self.f3, textvariable=reprenumcuenta)
        tcuenta0E.pack(side=LEFT, fill=X, expand=1)

        self.lf.pack(fill=X, ipady=5)  #==================================

        self.f0 = Frame(self.tab2)  #Para dejar espacio entre Tab y Label
        self.f0.pack(fill=X, pady=10)  #-------------------------------

        #---------------------------------------------------------------

        self.lf1 = LabelFrame(self.tab2, text="Datos Titular 1")

        self.f4 = Frame(self.lf1)
        self.f4.pack(fill=X, pady=5)  #-------------------------------

        self.ccL = Label(self.f4, text='CC:')
        self.ccL.pack(side=LEFT)
        cc1E = Entry(self.f4, textvariable=tit1cc)
        cc1E.pack(side=LEFT, fill=X, expand=1)

        self.nameL = Label(self.f4, text='Nombres:')
        self.nameL.pack(side=LEFT)
        name1E = Entry(self.f4, textvariable=tit1nombres)
        name1E.pack(side=LEFT, fill=X, expand=1)
        name1E.bind("<KeyRelease>", caps)

        self.f5 = Frame(self.lf1)
        self.f5.pack(fill=X)  #-------------------------------------------

        self.tbancpL = Label(self.f5, text='Banco:')
        self.tbancpL.pack(side=LEFT)
        bank1Cbx = Combobox(self.f5,
                            textvariable=tit1banco,
                            values=tbancos,
                            width=12)
        bank1Cbx.set('')
        bank1Cbx.pack(side=LEFT)

        self.tbancpL = Label(self.f5, text='Tipo Cuenta:')
        self.tbancpL.pack(side=LEFT)
        tbank1Cbx = Combobox(self.f5,
                             textvariable=tit1tcuenta,
                             values=tbanktype,
                             width=8)
        tbank1Cbx.set('')
        tbank1Cbx.pack(side=LEFT)

        self.tcuentaL = Label(self.f5, text='# Cuenta:')
        self.tcuentaL.pack(side=LEFT)
        tcuenta1E = Entry(self.f5, textvariable=tit1numcuenta)
        tcuenta1E.pack(side=LEFT, fill=X, expand=1)

        self.lf1.pack(fill=X, ipady=5)  #================================

        self.f0 = Frame(self.tab2)  #Para dejar espacio entre Tab y Label
        self.f0.pack(fill=X, pady=10)  #-------------------------------

        #---------------------------------------------------------------

        self.lf2 = LabelFrame(self.tab2, text="Datos Titular 2")

        self.f5 = Frame(self.lf2)
        self.f5.pack(fill=X, pady=5)  #-------------------------------

        self.ccL = Label(self.f5, text='CC:')
        self.ccL.pack(side=LEFT)
        cc2E = Entry(self.f5, textvariable=tit2cc)
        cc2E.pack(side=LEFT, fill=X, expand=1)

        self.nameL = Label(self.f5, text='Nombres:')
        self.nameL.pack(side=LEFT)
        name2E = Entry(self.f5, textvariable=tit2nombres)
        name2E.pack(side=LEFT, fill=X, expand=1)
        name2E.bind("<KeyRelease>", caps)

        self.f6 = Frame(self.lf2)
        self.f6.pack(fill=X)  #-------------------------------------------

        self.tbancpL = Label(self.f6, text='Banco:')
        self.tbancpL.pack(side=LEFT)
        bank2Cbx = Combobox(self.f6,
                            textvariable=tit2banco,
                            values=tbancos,
                            width=12)
        bank2Cbx.set('')
        bank2Cbx.pack(side=LEFT)

        self.tbancpL = Label(self.f6, text='Tipo Cuenta:')
        self.tbancpL.pack(side=LEFT)
        tbank2Cbx = Combobox(self.f6,
                             textvariable=tit2tcuenta,
                             values=tbanktype,
                             width=8)
        tbank2Cbx.set('')
        tbank2Cbx.pack(side=LEFT)

        self.tcuentaL = Label(self.f6, text='# Cuenta:')
        self.tcuentaL.pack(side=LEFT)
        tcuenta2E = Entry(self.f6, textvariable=tit2numcuenta)
        tcuenta2E.pack(side=LEFT, fill=X, expand=1)

        self.lf2.pack(fill=X, ipady=5)  #================================

        #---------------------------------------------------------------

        self.nb.add(self.tab1, text="Personales")
        self.nb.add(self.tab2, text="Complementarios")

        self.nb.pack()

        #=========================== BOTONES ===========================

        self.btns = Frame(self.wrapper)
        self.btns.pack()  #-------------------------------

        clean = Button(self.btns,
                       text='Limpiar',
                       bg='navy',
                       foreground='white',
                       activebackground='red3',
                       activeforeground='white',
                       command=limpiar)
        clean.pack(side=RIGHT)

        update = Button(self.btns,
                        text='Actualizar',
                        bg='navy',
                        foreground='white',
                        activebackground='red3',
                        activeforeground='white',
                        command=actualizar,
                        state=DISABLED)
        update.pack(side=RIGHT)

        add = Button(self.btns,
                     text='Agregar',
                     bg='navy',
                     foreground='white',
                     activebackground='red3',
                     activeforeground='white',
                     command=Agregar)
        add.pack(side=RIGHT)

        #========================= ASIDE ===========================

        self.aside = Frame(self)
        self.aside.pack(side=LEFT, fill=BOTH, expand=True)

        self.wrap1 = Frame(self.aside)
        self.wrap1.pack()

        self.viewer = Label(self.wrap1, text="LISTA DE PROPIETARIOS")
        self.viewer.pack()

        scroll = Scrollbar(self.wrap1, orient=VERTICAL)
        scroll.pack(side=RIGHT, fill=Y)

        lb = Listbox(self.wrap1,
                     yscrollcommand=scroll.set,
                     height=20,
                     width=30,
                     bg='#d8ecf3')
        scroll.config(command=lb.yview)
        lb.pack(fill=BOTH)
        lb.bind("<Double-Button-1>", callback)
        lb.bind("<Button-3>", popup)
        #lb.bind('<Escape>', release)

        self.wrap2 = Frame(self.aside)
        self.wrap2.pack()

        self.updateBP = Button(self.wrap2,
                               text='Cargar lista',
                               width=20,
                               bg='navy',
                               foreground='white',
                               activebackground='red3',
                               activeforeground='white',
                               command=cargar_lista)
        self.updateBP.pack()

        delete = Button(self.wrap2,
                        text='Borrar',
                        bg='navy',
                        width=20,
                        foreground='white',
                        activebackground='red3',
                        activeforeground='white',
                        command=borrar)
        delete.pack()

        edit = Button(self.wrap2,
                      text='Modificar',
                      bg='navy',
                      width=20,
                      foreground='white',
                      activebackground='red3',
                      activeforeground='white',
                      command=modificar)
        edit.pack()

        self.wrap3 = Frame(self.aside)
        self.wrap3.pack()

        buscador = Label(self.wrap3, text="Buscar por:")
        buscador.pack(side=LEFT)

        R1 = Radiobutton(self.wrap3, text="CC", variable=info, value=1)
        R1.pack(side=LEFT)
        R2 = Radiobutton(self.wrap3, text="Apellido", variable=info, value=2)
        R2.pack(side=LEFT)
        info.set(1)

        self.wrap4 = Frame(self.aside)
        self.wrap4.pack()

        E = Entry(self.wrap4, textvariable=busqueda, width=24)
        E.pack()
        E.bind("<KeyRelease>", caps)
예제 #47
0
파일: layout.py 프로젝트: farmborst/pytswa
def cs_tabbar(root, w, h, names):
    nb = Notebook(root, width=w, height=h)
    tabs = [Frame(nb) for i in range(len(names))]  # 5 tabs
    [nb.add(tabs[i], text=name) for i, name in enumerate(names)]
    nb.pack()
    return tabs
예제 #48
0
#     for _file in _list_file:
#         _listbox_googleDrive.insert(END, str(_file).replace("/",""))

#Create the objects to communicate with DBox
_client_dropbox = dropbox_client.DropBox()
# _client_googledrive = googledrive_client.GoogleDrive()

#Create a Main Window to display
MainWindow = Tk()
MainWindow.title('Cloud Sync')
MainWindow.minsize(500, 500)
MainWindow.maxsize(500, 500)

#Create tabs
_tabs = Notebook(MainWindow)
_tabs.pack(fill='both', expand='yes')

_tab_upload = Text(MainWindow)
_tab_dropBox = Text(MainWindow)
_tab_googleDrive = Text(MainWindow)

#Add tabs to the Main Window
_tabs.add(_tab_upload, text='Upload')
_tabs.add(_tab_dropBox, text='Dropbox')
_tabs.add(_tab_googleDrive, text='Google Drive')

#Label is used to display information to user
_label_upload = Label(_tab_upload, fg='Red', text='Choose a file to upload', bg='white', font=("Calibri", 10))
_label_upload.pack(pady=10)

#Button let's the user select a file to upload
예제 #49
0
    def __init__(self, master):
        
	self.fname="" 
        #global variables
        self.t1=StringVar()
        self.t2=StringVar()
        self.t3=StringVar()
        self.t4=StringVar()
        self.t5=StringVar()
        self.t6=StringVar()
        self.t7=StringVar()
        self.t8=StringVar()
        self.t9=StringVar()
        self.t10=StringVar()
        self.t11=StringVar()
        self.t12=StringVar()
        
        self.var1=StringVar()
        self.var2=StringVar()
        self.var3=StringVar()
        self.var4=StringVar()
        self.var5=StringVar()
        self.var6=StringVar()
        self.var7=StringVar()
        self.var8=StringVar()
        self.var9=StringVar()
        self.var10=StringVar()
        self.var11=StringVar()
        self.var12=StringVar()
        #end
        
        mymaster = Frame(master, name='mymaster') # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window    
        #master.minsize(width=900, height=900)
        #master.maxsize(width=800, height=600)
        #end
        
        #title of window
        master.title("Airtun-ng")
        #end
        
        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont=tkFont.Font(family="Helvetica", size=15,underline = True)
        self.myfontnew=tkFont.Font(family="Helvetica", size=11,underline = True)
        #end
        
        
       
        nb = Notebook(mymaster, name='nb') # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3) # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1") # add tab to Notebook
    
        # repeat for each tab
        self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")
        
        #End
        
	#frame content 7
	Label(self.frame_content7, text = 'Aigraph-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        btndetect=Button(self.frame_content7, text = 'Detect', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 1, column = 0, padx = 5, pady = 5)
		
	btndbrowse=Button(self.frame_content7, text = 'Attach File', command =self.browse_file, height=2, width=15, font=self.customFont).grid(row = 3, column = 0, padx = 5, pady = 5)	
	self.lilnew1=Listbox(self.frame_content7,bg="black", fg="white", font=self.myfont, selectmode=SINGLE, width=30, height=15)
        self.lilnew1.grid(row = 1, column = 1, rowspan=3)
	#End
	
        Label(self.frame_content, text = 'Airtun-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content, text = 'Options :',font=self.myfontnew, bg="white").grid(row = 1, column = 1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5, text = 'Edit Command From Here',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 0, column = 0)
        TextCommandBox=Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output=Text(self.frame_content5,bg="black", fg="white", font=self.myfont, height=20, width=42)
        self.output.grid(row = 0, column = 1, padx=50, pady=5, rowspan=3)
        btnsubmit=Button(self.frame_content5, width=15, height=2, text="Get Result", command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear=Button(self.frame_content5, width=15, height=2, text="Clear Output", command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-x", \
                 onvalue = "-x", offvalue ="", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var1)
        self.C1.grid(row = 2, column = 0, padx = 5, pady = 5)
        self.t1=Text(self.frame_content,height=1,width = 20)
        self.t1.grid(row = 2, column = 1, padx = 5, pady = 5)
        l1=Label(self.frame_content, text = ': maximum number of packets per second (optional)',font=self.myfont, bg="white", justify=LEFT).grid(row = 2, column = 2, padx = 5, pady = 5)
        
        self.C2 = Checkbutton(self.frame_content, text = "-a", \
                 onvalue = "-a", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var2)
        self.C2.grid(row = 3, column = 0, padx = 5, pady = 5)
        self.t2=Text(self.frame_content,height=1,width = 20)
        self.t2.grid(row = 3, column = 1, padx = 5, pady = 5)
        l2=Label(self.frame_content, text = ': set Access Point MAC address (mandatory)',font=self.myfont, bg="white", justify=LEFT).grid(row = 3, column = 2, padx = 5, pady = 5)
        
        self.C3 = Checkbutton(self.frame_content, text = "-i", \
                 onvalue = "-i", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row = 4, column = 0, padx = 5, pady = 5)
        self.t3=Text(self.frame_content,height=1,width = 20)
        self.t3.grid(row = 4, column = 1, padx = 5, pady = 5)
        l3=Label(self.frame_content, text = ': capture packets from this interface (optional)',font=self.myfont, bg="white", justify=LEFT).grid(row = 4, column = 2, padx = 5, pady = 5)
        
        self.C4 = Checkbutton(self.frame_content, text = "-y", \
                 onvalue = "-y", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var5)
        self.C4.grid(row = 5, column = 0, padx = 5, pady = 5)
        self.t4=Text(self.frame_content,height=1,width = 20)
        self.t4.grid(row = 5, column = 1, padx = 5, pady = 5)
        l4=Label(self.frame_content, text = ': read PRGA from this file (optional / one of -y or -w must be defined)',font=self.myfont, bg="white", justify=LEFT).grid(row = 5, column = 2, padx = 5, pady = 5)
        
        self.C5 = Checkbutton(self.frame_content, text = "-W", \
                 onvalue = "-W", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var6)
        self.C5.grid(row = 6, column = 0, padx = 5, pady = 5)
        self.t5=Text(self.frame_content,height=1,width = 20)
        self.t5.grid(row = 6, column = 1, padx = 5, pady = 5)
        l5=Label(self.frame_content, text = ': use this WEP-KEY to encrypt packets (optional / one of -y or -w must be defined)',font=self.myfont, bg="white", justify=LEFT).grid(row = 6, column = 2, padx = 5, pady = 5)
        
        self.C6 = Checkbutton(self.frame_content, text = "-t", \
                 onvalue = "-t", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var7)
        self.C6.grid(row = 8, column = 0, padx = 5, pady = 5)
        self.t6=Text(self.frame_content,height=1,width = 20)
        self.t6.grid(row = 8, column = 1, padx = 5, pady = 5)
        l6=Label(self.frame_content, text = ': send frames to AP (1) or to client (0) (optional / defaults to 0)',font=self.myfont, bg="white", justify=LEFT).grid(row = 8, column = 2, padx = 5, pady = 5)
        
        self.C7 = Checkbutton(self.frame_content, text = "-r", \
                 onvalue = "-r", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var8)
        self.C7.grid(row = 9, column = 0, padx = 5, pady = 5)
        self.t7=Text(self.frame_content,height=1,width = 20)
        self.t7.grid(row = 9, column = 1, padx = 5, pady = 5)
        l7=Label(self.frame_content, text = ': read frames out of pcap file (optional)',font=self.myfont, bg="white", justify=LEFT).grid(row = 9, column = 2, padx = 5, pady = 5)
        
        self.C8 = Checkbutton(self.frame_content, text = "-h", \
                 onvalue = "-h", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var9)
        self.C8.grid(row = 10, column = 0, padx = 5, pady = 5)
        self.t8=Text(self.frame_content,height=1,width = 20)
        self.t8.grid(row = 10, column = 1, padx = 5, pady = 5)
        l8=Label(self.frame_content, text = ': source MAC address',font=self.myfont, bg="white", justify=LEFT).grid(row = 10, column = 2, padx = 5, pady = 5)
        
        self.C9 = Checkbutton(self.frame_content, text = "-H", \
                 onvalue = "-H", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var10)
        self.C9.grid(row = 11, column = 0, padx = 5, pady = 5)
        self.t9=Text(self.frame_content,height=1,width = 20)
        self.t9.grid(row = 11, column = 1, padx = 5, pady = 5)
        l9=Label(self.frame_content, text = ': Display help. Long form help',font=self.myfont, bg="white", justify=LEFT).grid(row = 11, column = 2, padx = 5, pady = 5)
        
        Label(self.frame_content, text = 'Repeater Options :',font=self.myfontnew, bg="white").grid(row = 12, column = 1)
        
        self.C10 = Checkbutton(self.frame_content, text = "--repeat", \
                 onvalue = "--repeat", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var11)
        self.C10.grid(row = 13, column = 0, padx = 5, pady = 5)
        self.t10=Text(self.frame_content,height=1,width = 20)
        self.t10.grid(row = 13, column = 1, padx = 5, pady = 5)
        l10=Label(self.frame_content, text = ': activates repeat mode. Short form -f.',font=self.myfont, bg="white", justify=LEFT).grid(row = 13, column = 2, padx = 5, pady = 5)
        
        self.C11 = Checkbutton(self.frame_content, text = "--bssid", \
                 onvalue = "--bssid", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont, variable=self.var12)
        self.C11.grid(row = 14, column = 0, padx = 5, pady = 5)
        self.t11=Text(self.frame_content,height=1,width = 20)
        self.t11.grid(row = 14, column = 1, padx = 5, pady = 5)
        l11=Label(self.frame_content, text = ': BSSID to repeat. Short form -d.',font=self.myfont, bg="white", justify=LEFT).grid(row = 14, column = 2, padx = 5, pady = 5)
        
        self.C12 = Checkbutton(self.frame_content, text = "--netmask", \
                 onvalue = "--netmask", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont)
        self.C12.grid(row = 15, column = 0, padx = 5, pady = 5)
        self.t12=Text(self.frame_content,height=1,width = 20)
        self.t12.grid(row = 15, column = 1, padx = 5, pady = 5)
        l12=Label(self.frame_content, text = ': netmask for BSSID filter. Short form -m.',font=self.myfont, bg="white", justify=LEFT).grid(row = 15, column = 2, padx = 5, pady = 5)
예제 #50
0
    def __init__(self, master):

        self.fname = ""
        #global variables
        self.t1 = StringVar()
        self.t2 = StringVar()
        self.t3 = StringVar()
        self.t4 = StringVar()
        self.t5 = StringVar()
        self.t6 = StringVar()
        self.t7 = StringVar()
        self.t8 = StringVar()
        self.t9 = StringVar()
        self.t10 = StringVar()
        self.t11 = StringVar()
        self.t12 = StringVar()
        self.t13 = StringVar()
        self.t14 = StringVar()
        self.t15 = StringVar()
        self.t16 = StringVar()
        self.t17 = StringVar()
        self.t18 = StringVar()
        self.t19 = StringVar()
        self.t20 = StringVar()
        self.t21 = StringVar()
        self.t22 = StringVar()
        self.t23 = StringVar()
        self.t24 = StringVar()
        self.t25 = StringVar()
        self.t26 = StringVar()
        self.t27 = StringVar()
        self.t28 = StringVar()
        self.t29 = StringVar()
        self.t30 = StringVar()
        self.t31 = StringVar()
        self.t32 = StringVar()
        self.t33 = StringVar()
        self.t34 = StringVar()

        self.var1 = StringVar()
        self.var2 = StringVar()
        self.var3 = StringVar()
        self.var4 = StringVar()
        self.var5 = StringVar()
        self.var6 = StringVar()
        self.var7 = StringVar()
        self.var8 = StringVar()
        self.var9 = StringVar()
        self.var10 = StringVar()
        self.var11 = StringVar()
        self.var12 = StringVar()
        self.var13 = StringVar()
        self.var14 = StringVar()
        self.var15 = StringVar()
        self.var16 = StringVar()
        self.var17 = StringVar()
        self.var18 = StringVar()
        self.var19 = StringVar()
        self.var20 = StringVar()
        self.var21 = StringVar()
        self.var22 = StringVar()
        self.var23 = StringVar()
        self.var24 = StringVar()
        self.var25 = StringVar()
        self.var26 = StringVar()
        self.var27 = StringVar()
        self.var28 = StringVar()
        self.var29 = StringVar()
        self.var30 = StringVar()
        self.var31 = StringVar()
        self.var32 = StringVar()
        self.var33 = StringVar()
        self.var34 = StringVar()
        #end

        mymaster = Frame(master, name='mymaster')  # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window
        #master.minsize(width=900, height=900)
        #master.maxsize(width=750, height=470)
        #end

        #title of window
        master.title("Aircrack-ng")
        #end

        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont = tkFont.Font(family="Helvetica",
                                      size=15,
                                      underline=True)
        self.myfontnew = tkFont.Font(family="Helvetica",
                                     size=11,
                                     underline=True)
        #end

        nb = Notebook(mymaster, name='nb')  # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3)  # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,
                                   name="frame_content",
                                   bg="lightsteelblue")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1")  # add tab to Notebook

        # repeat for each tab
        self.frame_content2 = Frame(nb,
                                    name='frame_content2',
                                    bg="lightsteelblue")
        nb.add(self.frame_content2, text="Filter-2")
        self.frame_content3 = Frame(nb,
                                    name='frame_content3',
                                    bg="lightsteelblue")
        nb.add(self.frame_content3, text="Filter-3")
        self.frame_content4 = Frame(nb,
                                    name='frame_content4',
                                    bg="lightsteelblue")
        nb.add(self.frame_content4, text="Filter-4")
        self.frame_content6 = Frame(nb,
                                    name='frame_content6',
                                    bg="lightsteelblue")
        nb.add(self.frame_content6, text="Filter-5")
        self.frame_content7 = Frame(nb,
                                    name='frame_content7',
                                    bg="lightsteelblue")
        nb.add(self.frame_content7, text="Detect Devices")
        self.frame_content5 = Frame(nb,
                                    name='frame_content5',
                                    bg="lightsteelblue")
        nb.add(self.frame_content5, text="output")

        #End

        #frame content 7
        Label(self.frame_content7,
              text='Aircrack-ng',
              font=self.headerfont,
              bg="midnightblue",
              fg="firebrick",
              padx=10,
              pady=10).grid(row=0, column=0)
        btndetect = Button(self.frame_content7,
                           text='Detect',
                           fg="cornflowerblue",
                           command=self.canvas_detect,
                           height=2,
                           width=15,
                           font=self.customFont).grid(row=1,
                                                      column=0,
                                                      padx=5,
                                                      pady=5)

        btndbrowse = Button(self.frame_content7,
                            text='Attach File',
                            fg="cornflowerblue",
                            command=self.browse_file,
                            height=2,
                            width=15,
                            font=self.customFont).grid(row=3,
                                                       column=0,
                                                       padx=5,
                                                       pady=5)
        self.lilnew1 = Listbox(self.frame_content7,
                               bg="black",
                               fg="firebrick",
                               font=self.myfont,
                               selectmode=SINGLE,
                               width=30,
                               height=15)
        self.lilnew1.grid(row=1, column=1, rowspan=3)
        #End

        Label(self.frame_content,
              text='Aircrack-ng',
              font=self.headerfont,
              bg="midnightblue",
              fg="firebrick",
              padx=10,
              pady=10).grid(row=0, column=0)
        Label(self.frame_content,
              text='Options :',
              font=self.myfontnew,
              bg="midnightblue",
              fg="deepskyblue").grid(row=1, column=1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5,
              text='Edit Command From Here',
              font=self.myfontnew,
              bg="midnightblue",
              fg="deepskyblue",
              justify=LEFT).grid(row=0, column=0)
        TextCommandBox = Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output = Text(self.frame_content5,
                           bg="black",
                           fg="firebrick",
                           font=self.myfont,
                           height=20,
                           width=42)
        self.output.grid(row=0, column=1, padx=50, pady=5, rowspan=3)
        btnsubmit = Button(self.frame_content5,
                           width=15,
                           height=2,
                           text="Get Result",
                           fg="cornflowerblue",
                           command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear = Button(self.frame_content5,
                          width=15,
                          height=2,
                          text="Clear Output",
                          fg="cornflowerblue",
                          command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-a", fg="deepskyblue", \
                 onvalue = "-a", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var1)
        self.C1.grid(row=2, column=0, padx=5, pady=5)
        self.t1 = Text(self.frame_content, height=1, width=20)
        self.t1.grid(row=2, column=1, padx=5, pady=5)
        l1 = Label(
            self.frame_content,
            text=': Force attack mode (1 = static WEP, 2 = WPA/WPA2-PSK).',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=2, column=2, padx=5, pady=5)

        self.C2 = Checkbutton(self.frame_content, text = "-b", fg="deepskyblue", \
                 onvalue = "-b", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var2)
        self.C2.grid(row=3, column=0, padx=5, pady=5)
        self.t2 = Text(self.frame_content, height=1, width=20)
        self.t2.grid(row=3, column=1, padx=5, pady=5)
        l2 = Label(
            self.frame_content,
            text=
            ': Long version bssid. Select the target network based on\n  the access point\'s MAC address.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=3, column=2, padx=5, pady=5)

        self.C3 = Checkbutton(self.frame_content, text = "-e", fg="deepskyblue", \
                 onvalue = "-e", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var3)
        self.C3.grid(row=4, column=0, padx=5, pady=5)
        self.t3 = Text(self.frame_content, height=1, width=20)
        self.t3.grid(row=4, column=1, padx=5, pady=5)
        l3 = Label(
            self.frame_content,
            text=
            ': If set, all IVs from networks with the same ESSID will be used.\n  This option is also required for WPA/WPA2-PSK cracking if the\n  ESSID is not broadcasted (hidden).',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=4, column=2, padx=5, pady=5)

        self.C4 = Checkbutton(self.frame_content, text = "-p", fg="deepskyblue", \
                 onvalue = "-p", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var4)
        self.C4.grid(row=5, column=0, padx=5, pady=5)
        self.t4 = Text(self.frame_content, height=1, width=20)
        self.t4.grid(row=5, column=1, padx=5, pady=5)
        l4 = Label(
            self.frame_content,
            text=
            ': On SMP systems: # of CPU to use. This option is invalid on\n  non-SMP systems.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=5, column=2, padx=5, pady=5)

        self.C5 = Checkbutton(self.frame_content, text = "-q", fg="deepskyblue", \
                 onvalue = "-q", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var5)
        self.C5.grid(row=6, column=0, padx=5, pady=5)
        self.t5 = Text(self.frame_content, height=1, width=20)
        self.t5.grid(row=6, column=1, padx=5, pady=5)
        l5 = Label(
            self.frame_content,
            text=
            ': Enable quiet mode (no status output until the key is found, or not).',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=6, column=2, padx=5, pady=5)

        self.C6 = Checkbutton(self.frame_content, text = "-c", fg="deepskyblue", \
                 onvalue = "-c", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var6)
        self.C6.grid(row=7, column=0, padx=5, pady=5)
        self.t6 = Text(self.frame_content, height=1, width=20)
        self.t6.grid(row=7, column=1, padx=5, pady=5)
        l6 = Label(
            self.frame_content,
            text=
            ': (WEP cracking) Restrict the search space to alpha-numeric\n  characters only (0x20 - 0x7F).',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=7, column=2, padx=5, pady=5)

        self.C7 = Checkbutton(self.frame_content, text = "-t", fg="deepskyblue", \
                 onvalue = "-t", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var7)
        self.C7.grid(row=8, column=0, padx=5, pady=5)
        self.t7 = Text(self.frame_content, height=1, width=20)
        self.t7.grid(row=8, column=1, padx=5, pady=5)
        l7 = Label(
            self.frame_content,
            text=
            ': (WEP cracking) Restrict the search space to binary coded decimal\n  hex characters.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=8, column=2, padx=5, pady=5)

        Label(self.frame_content2,
              text='Aircrack-ng',
              font=self.headerfont,
              bg="midnightblue",
              fg="firebrick",
              padx=10,
              pady=10).grid(row=0, column=0)
        #frame2
        self.C8 = Checkbutton(self.frame_content2, text = "-h", fg="deepskyblue", \
                 onvalue = "-h", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var8)
        self.C8.grid(row=9, column=0, padx=5, pady=5)
        self.t8 = Text(self.frame_content2, height=1, width=20)
        self.t8.grid(row=9, column=1, padx=5, pady=5)
        l8 = Label(
            self.frame_content2,
            text=
            ':  (WEP cracking) Restrict the search space to numeric\n   characters (0x30-0x39) These keys are used by default\n   in most Fritz!BOXes.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=9, column=2, padx=5, pady=5)

        self.C9 = Checkbutton(self.frame_content2, text = "-d", fg="deepskyblue", \
                 onvalue = "-d", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var9)
        self.C9.grid(row=10, column=0, padx=5, pady=5)
        self.t9 = Text(self.frame_content2, height=1, width=20)
        self.t9.grid(row=10, column=1, padx=5, pady=5)
        l9 = Label(
            self.frame_content2,
            text=
            ': (WEP cracking) Long version debug. Set the beginning\n  of the WEP key (in hex), for debugging purposes.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=10, column=2, padx=5, pady=5)


        self.C10 = Checkbutton(self.frame_content2, text = "-m", fg="deepskyblue", \
                 onvalue = "-m", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var10)
        self.C10.grid(row=11, column=0, padx=5, pady=5)
        self.t10 = Text(self.frame_content2, height=1, width=20)
        self.t10.grid(row=11, column=1, padx=5, pady=5)
        l10 = Label(
            self.frame_content2,
            text=
            ': (WEP cracking) MAC address to filter WEP data packets.\n  Alternatively, specify -m ff:ff:ff:ff:ff:ff to use all and every IVs,\n  regardless of the network.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=11, column=2, padx=5, pady=5)

        self.C11 = Checkbutton(self.frame_content2, text = "-M", fg="deepskyblue", \
                 onvalue = "-M", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var11)
        self.C11.grid(row=12, column=0, padx=5, pady=5)
        self.t11 = Text(self.frame_content2, height=1, width=20)
        self.t11.grid(row=12, column=1, padx=5, pady=5)
        l11 = Label(
            self.frame_content2,
            text=': (WEP cracking) Sets the maximum number of ivs to use.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=12, column=2, padx=5, pady=5)

        self.C12 = Checkbutton(self.frame_content2, text = "-n", fg="deepskyblue", \
                 onvalue = "-n", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var12)
        self.C12.grid(row=13, column=0, padx=5, pady=5)
        self.t12 = Text(self.frame_content2, height=1, width=20)
        self.t12.grid(row=13, column=1, padx=5, pady=5)
        l12 = Label(
            self.frame_content2,
            text=
            ': (WEP cracking) Specify the length of the key: 64 for 40-bit\n  WEP, 128 for 104-bit WEP, etc. The default value is 128.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=13, column=2, padx=5, pady=5)

        self.C13 = Checkbutton(self.frame_content2, text = "-i", fg="deepskyblue", \
                 onvalue = "-i", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var13)
        self.C13.grid(row=14, column=0, padx=5, pady=5)
        self.t13 = Text(self.frame_content2, height=1, width=20)
        self.t13.grid(row=14, column=1, padx=5, pady=5)
        l13 = Label(
            self.frame_content2,
            text=
            ': (WEP cracking) Only keep the IVs that have this key index\n  (1 to 4). The default behaviour is to ignore the key index.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=14, column=2, padx=5, pady=5)

        self.C14 = Checkbutton(self.frame_content2, text = "-f", fg="deepskyblue", \
                 onvalue = "-f", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var14)
        self.C14.grid(row=15, column=0, padx=5, pady=5)
        self.t14 = Text(self.frame_content2, height=1, width=20)
        self.t14.grid(row=15, column=1, padx=5, pady=5)
        l14 = Label(
            self.frame_content2,
            text=
            ': (WEP cracking) By default, this parameter is set to 2 for\n  104-bit WEP and to 5 for 40-bit WEP. Specify a higher\n  value to increase the bruteforce level: cracking will take\n  more time, but with a higher likelyhood of success.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=15, column=2, padx=5, pady=5)

        #frame3
        Label(self.frame_content3,
              text='Aircrack-ng',
              font=self.headerfont,
              bg="midnightblue",
              fg="firebrick",
              padx=10,
              pady=10).grid(row=0, column=0)

        self.C15 = Checkbutton(self.frame_content3, text = "-H", fg="deepskyblue", \
                 onvalue = "-H", offvalue = "", height=1, \
                 width = 7, bg="midnightblue", font=self.customFont,variable=self.var15)
        self.C15.grid(row=17, column=0, padx=5, pady=5)
        self.t15 = Text(self.frame_content3, height=1, width=20)
        self.t15.grid(row=17, column=1, padx=5, pady=5)
        l15 = Label(self.frame_content3,
                    text=': Long version help. Output help information.',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=17, column=2, padx=5, pady=5)

        self.C16 = Checkbutton(self.frame_content3, text = "-l", fg="deepskyblue", \
                 onvalue = "-l", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var16)
        self.C16.grid(row=18, column=0, padx=5, pady=5)
        self.t16 = Text(self.frame_content3, height=1, width=20)
        self.t16.grid(row=18, column=1, padx=5, pady=5)
        l16 = Label(
            self.frame_content3,
            text=': (Lowercase L, ell) logs the key to the file specified.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=18, column=2, padx=5, pady=5)

        self.C17 = Checkbutton(self.frame_content3, text = "-K", fg="deepskyblue", \
                 onvalue = "-K", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var17)
        self.C17.grid(row=19, column=0, padx=5, pady=5)
        self.t17 = Text(self.frame_content3, height=1, width=20)
        self.t17.grid(row=19, column=1, padx=5, pady=5)
        l17 = Label(
            self.frame_content3,
            text=
            ':  (WEP cracking) There are 17 korek statistical attacks.\n   Sometimes one attack creates a huge false positive that\n   prevents the key from being found, even with lots of IVs.\n   Try -k 1, -k 2, -k 17 to disable each attack selectively.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=19, column=2, padx=5, pady=5)


        self.C18 = Checkbutton(self.frame_content3, text = "-k", fg="deepskyblue", \
                 onvalue = "-k", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var18)
        self.C18.grid(row=21, column=0, padx=5, pady=5)
        self.t18 = Text(self.frame_content3, height=1, width=20)
        self.t18.grid(row=21, column=1, padx=5, pady=5)
        l18 = Label(self.frame_content3,
                    text=': number of packets per second (default: 100)',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=21, column=2, padx=5, pady=5)

        self.C19 = Checkbutton(self.frame_content3, text = "-p", fg="deepskyblue", \
                 onvalue = "-p", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var19)
        self.C19.grid(row=22, column=0, padx=5, pady=5)
        self.t19 = Text(self.frame_content3, height=1, width=20)
        self.t19.grid(row=22, column=1, padx=5, pady=5)
        l19 = Label(
            self.frame_content3,
            text=
            ': Allow the number of threads for cracking even if you have\n   a non-SMP computer.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=22, column=2, padx=5, pady=5)


        self.C20 = Checkbutton(self.frame_content3, text = "-r", fg="deepskyblue", \
                 onvalue = "-r", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var20)
        self.C20.grid(row=23, column=0, padx=5, pady=5)
        self.t20 = Text(self.frame_content3, height=1, width=20)
        self.t20.grid(row=23, column=1, padx=5, pady=5)
        l20 = Label(
            self.frame_content3,
            text=
            ': Utilizes a database generated by airolib-ng as input to\n   determine the WPA key. Outputs an error message if\n   aircrack-ng has not been compiled with sqlite support.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=23, column=2, padx=5, pady=5)

        self.C21 = Checkbutton(self.frame_content3, text = "-x/-x0", fg="deepskyblue", \
                 onvalue = "-x/-x0", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var21)
        self.C21.grid(row=24, column=0, padx=5, pady=5)
        self.t21 = Text(self.frame_content3, height=1, width=20)
        self.t21.grid(row=24, column=1, padx=5, pady=5)
        l21 = Label(self.frame_content3,
                    text=':  (WEP cracking) Disable last keybytes brutforce.',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=24, column=2, padx=5, pady=5)

        #frame4
        Label(self.frame_content4,
              text='Aircrack-ng',
              font=self.headerfont,
              bg="midnightblue",
              fg="firebrick",
              padx=10,
              pady=10).grid(row=0, column=0)
        self.C22 = Checkbutton(self.frame_content4, text = "-x1", fg="deepskyblue", \
                 onvalue = "-x1", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var22)
        self.C22.grid(row=25, column=0, padx=5, pady=5)
        self.t22 = Text(self.frame_content4, height=1, width=20)
        self.t22.grid(row=25, column=1, padx=5, pady=5)
        l22 = Label(
            self.frame_content4,
            text=
            ':  (WEP cracking) Enable last keybyte bruteforcing (default).',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=25, column=2, padx=5, pady=5)

        self.C23 = Checkbutton(self.frame_content4, text = "-x2", fg="deepskyblue", \
                 onvalue = "-x2", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var23)
        self.C23.grid(row=26, column=0, padx=5, pady=5)
        self.t23 = Text(self.frame_content4, height=1, width=20)
        self.t23.grid(row=26, column=1, padx=5, pady=5)
        l23 = Label(
            self.frame_content4,
            text=':  (WEP cracking) Enable last two keybytes bruteforcing.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=26, column=2, padx=5, pady=5)

        self.C24 = Checkbutton(self.frame_content4, text = "-X", fg="deepskyblue", \
                 onvalue = "-X", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var24)
        self.C24.grid(row=27, column=0, padx=5, pady=5)
        self.t24 = Text(self.frame_content4, height=1, width=20)
        self.t24.grid(row=27, column=1, padx=5, pady=5)
        l24 = Label(
            self.frame_content4,
            text=
            ':  (WEP cracking) Disable bruteforce multithreading (SMP only).',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=27, column=2, padx=5, pady=5)

        self.C25 = Checkbutton(self.frame_content4, text = "-y", fg="deepskyblue", \
                 onvalue = "-y", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var25)
        self.C25.grid(row=28, column=0, padx=5, pady=5)
        self.t25 = Text(self.frame_content4, height=1, width=20)
        self.t25.grid(row=28, column=1, padx=5, pady=5)
        l25 = Label(
            self.frame_content4,
            text=
            ':  (WEP cracking) Experimental single bruteforce attack which\n   should only be used when the standard attack mode fails with\n   more than one million IVs',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=28, column=2, padx=5, pady=5)


        self.C26 = Checkbutton(self.frame_content4, text = "-u", fg="deepskyblue", \
                 onvalue = "-u", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var26)
        self.C26.grid(row=29, column=0, padx=5, pady=5)
        self.t26 = Text(self.frame_content4, height=1, width=20)
        self.t26.grid(row=29, column=1, padx=5, pady=5)
        l26 = Label(
            self.frame_content4,
            text=
            ':  Long form -cpu-detect. Provide information on the number of\n   CPUs and MMX support. Example responses to "aircrack-ng \n   -cpu-detect" are "Nb CPU detected: 2" or Nb CPU detected: \n   1 (MMX available)".',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=29, column=2, padx=5, pady=5)

        self.C27 = Checkbutton(self.frame_content4, text = "-w", fg="deepskyblue", \
                 onvalue = "-w", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var27)
        self.C27.grid(row=30, column=0, padx=5, pady=5)
        self.t27 = Text(self.frame_content4, height=1, width=20)
        self.t27.grid(row=30, column=1, padx=5, pady=5)
        l27 = Label(
            self.frame_content4,
            text=
            ':   (WPA cracking) Path to a wordlist or "-"without the quotes for \n    standard in (stdin).',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=30, column=2, padx=5, pady=5)

        self.C28 = Checkbutton(self.frame_content4, text = "-z", fg="deepskyblue", \
                 onvalue = "-z", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var28)
        self.C28.grid(row=31, column=0, padx=5, pady=5)
        self.t28 = Text(self.frame_content4, height=1, width=20)
        self.t28.grid(row=31, column=1, padx=5, pady=5)
        l28 = Label(
            self.frame_content4,
            text=':  Invokes the PTW WEP cracking method. (Default in v1.x)',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=31, column=2, padx=5, pady=5)

        #frame4
        Label(self.frame_content6,
              text='Aircrack-ng',
              font=self.headerfont,
              bg="midnightblue",
              fg="firebrick",
              padx=10,
              pady=10).grid(row=0, column=0)
        self.C29 = Checkbutton(self.frame_content6, text = "-P", fg="deepskyblue", \
                 onvalue = "-P", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var29)
        self.C29.grid(row=32, column=0, padx=5, pady=5)
        self.t29 = Text(self.frame_content6, height=1, width=20)
        self.t29.grid(row=32, column=1, padx=5, pady=5)
        l29 = Label(
            self.frame_content6,
            text=':  Long version -ptw-debug. Invokes the PTW debug mode.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=32, column=2, padx=5, pady=5)

        self.C30 = Checkbutton(self.frame_content6, text = "-C", fg="deepskyblue", \
                 onvalue = "-C", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var30)
        self.C30.grid(row=33, column=0, padx=5, pady=5)
        self.t30 = Text(self.frame_content6, height=1, width=20)
        self.t30.grid(row=33, column=1, padx=5, pady=5)
        l30 = Label(
            self.frame_content6,
            text=
            ':   Long version -combine. Merge the given APs to a virtual one.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=33, column=2, padx=5, pady=5)

        self.C31 = Checkbutton(self.frame_content6, text = "-D", fg="deepskyblue", \
                 onvalue = "-D", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var31)
        self.C31.grid(row=34, column=0, padx=5, pady=5)
        self.t31 = Text(self.frame_content6, height=1, width=20)
        self.t31.grid(row=34, column=1, padx=5, pady=5)
        l31 = Label(
            self.frame_content6,
            text=':  Long version -wep-decloak. Run in WEP decloak mode.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=34, column=2, padx=5, pady=5)

        self.C32 = Checkbutton(self.frame_content6, text = "-V", fg="deepskyblue", \
                 onvalue = "-V", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var32)
        self.C32.grid(row=35, column=0, padx=5, pady=5)
        self.t32 = Text(self.frame_content6, height=1, width=20)
        self.t32.grid(row=35, column=1, padx=5, pady=5)
        l32 = Label(
            self.frame_content6,
            text=
            ':  Long version -visual-inspection. Run in visual inspection mode.',
            font=self.myfont,
            bg="midnightblue",
            fg="deepskyblue",
            justify=LEFT).grid(row=35, column=2, padx=5, pady=5)

        self.C33 = Checkbutton(self.frame_content6, text = "-1", fg="deepskyblue", \
                 onvalue = "-1", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var33)
        self.C33.grid(row=36, column=0, padx=5, pady=5)
        self.t33 = Text(self.frame_content6, height=1, width=20)
        self.t33.grid(row=36, column=1, padx=5, pady=5)
        l33 = Label(self.frame_content6,
                    text=':  Long version -oneshot. Run in oneshot mode.',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=36, column=2, padx=5, pady=5)

        self.C34 = Checkbutton(self.frame_content6, text = "-S", fg="deepskyblue", \
                 onvalue = "-S", offvalue = "", height=1, \
                 bg="midnightblue", font=self.customFont,variable=self.var34)
        self.C34.grid(row=37, column=0, padx=5, pady=5)
        self.t34 = Text(self.frame_content6, height=1, width=20)
        self.t34.grid(row=37, column=1, padx=5, pady=5)
        l34 = Label(self.frame_content6,
                    text=':  WPA cracking speed test.',
                    font=self.myfont,
                    bg="midnightblue",
                    fg="deepskyblue",
                    justify=LEFT).grid(row=37, column=2, padx=5, pady=5)
예제 #51
0
class GUI:

    ## GUI variables
    titleText = 'PyCX Simulator'  # window title
    timeInterval = 0              # refresh time in milliseconds
    running = False
    modelFigure = None
    stepSize = 1
    currentStep = 0
    def __init__(self,title='PyCX Simulator',interval=0,stepSize=1,parameterSetters=[]):
        self.titleText = title
        self.timeInterval = interval
        self.stepSize = stepSize
        self.parameterSetters = parameterSetters
        self.varEntries = {}
        self.statusStr = ""
               
        self.initGUI()
    def initGUI(self):
        #create root window
        self.rootWindow = Tk()
        self.statusText = StringVar(value=self.statusStr) 
        self.setStatusStr("Simulation not yet started")

        self.rootWindow.wm_title(self.titleText)
        self.rootWindow.protocol('WM_DELETE_WINDOW',self.quitGUI)
        self.rootWindow.geometry('550x400')
        self.rootWindow.columnconfigure(0, weight=1)
        self.rootWindow.rowconfigure(0, weight=1)
        
        self.notebook = Notebook(self.rootWindow)      
        self.notebook.grid(row=0,column=0,padx=2,pady=2,sticky='nswe')
        

        self.frameRun = Frame()
        self.frameSettings = Frame()
        self.frameParameters = Frame()
        self.frameInformation = Frame()          
        
        self.notebook.add(self.frameRun,text="Run")
        self.notebook.add(self.frameSettings,text="Settings")
        self.notebook.add(self.frameParameters,text="Parameters")
        self.notebook.add(self.frameInformation,text="Info")
     
        self.notebook.pack(expand=YES, fill=BOTH, padx=5, pady=5 ,side=TOP)
        self.status = Label(self.rootWindow, width=40,height=3, relief=SUNKEN, bd=1,textvariable=self.statusText)
        self.status.grid(row=1,column=0,padx=2,pady=2,sticky='nswe')
        self.status.pack(side=TOP, fill=X, padx=1, pady=1, expand=NO)



        
        self.runPauseString = StringVar()
        self.runPauseString.set("Run")
        self.buttonRun = Button(self.frameRun,width=30,height=2,textvariable=self.runPauseString,command=self.runEvent)
        self.buttonRun.pack(side=TOP, padx=5, pady=5)



        self.showHelp(self.buttonRun,"Runs the simulation (or pauses the running simulation)")
        self.buttonStep = Button(self.frameRun,width=30,height=2,text='Step Once',command=self.stepOnce)
        self.buttonStep.pack(side=TOP, padx=5, pady=5)
        self.showHelp(self.buttonStep,"Steps the simulation only once")
        self.buttonReset = Button(self.frameRun,width=30,height=2,text='Reset',command=self.resetModel)
        self.buttonReset.pack(side=TOP, padx=5, pady=5) 
        self.showHelp(self.buttonReset,"Resets the simulation")
 
   
        
        can = Canvas(self.frameSettings)
        lab = Label(can, width=25,height=1,text="Step size ", justify=LEFT, anchor=W,takefocus=0)
        lab.pack(side='left')
        self.stepScale = Scale(can,from_=1, to=50, resolution=1,command=self.changeStepSize,orient=HORIZONTAL, width=25,length=150)
        self.stepScale.set(self.stepSize)
        self.showHelp(self.stepScale,"Skips model redraw during every [n] simulation steps\nResults in a faster model run.")
        self.stepScale.pack(side='left')    
        can.pack(side='top')
    
        can = Canvas(self.frameSettings)
        lab = Label(can, width=25,height=1,text="Step visualization delay in ms ", justify=LEFT, anchor=W,takefocus=0)
        lab.pack(side='left')
        self.stepDelay = Scale(can,from_=0, to=max(2000,self.timeInterval), resolution=10,command=self.changeStepDelay,orient=HORIZONTAL, width=25,length=150)
        self.stepDelay.set(self.timeInterval)
        self.showHelp(self.stepDelay,"The visualization of each step is delays by the given number of milliseconds.")
        self.stepDelay.pack(side='left')    
        can.pack(side='top')
        scrollInfo = Scrollbar(self.frameInformation)
        self.textInformation = Text(self.frameInformation, width=45,height=13,bg='lightgray',wrap=WORD,font=("Courier",10))
        scrollInfo.pack(side=RIGHT, fill=Y)
        self.textInformation.pack(side=LEFT,fill=BOTH,expand=YES)
        scrollInfo.config(command=self.textInformation.yview)
        self.textInformation.config(yscrollcommand=scrollInfo.set)
        for variableSetter in self.parameterSetters:
            can = Canvas(self.frameParameters)
            lab = Label(can, width=25,height=1,text=variableSetter.__name__+" ",anchor=W,takefocus=0)
            lab.pack(side='left')
            ent = Entry(can, width=11)
            ent.insert(0, str(variableSetter()))
            if variableSetter.__doc__ != None and len(variableSetter.__doc__) > 0:
                self.showHelp(ent,variableSetter.__doc__.strip())
            ent.pack(side='left')            
            can.pack(side='top')
            self.varEntries[variableSetter]=ent
        if len(self.parameterSetters) > 0:
            self.buttonSaveParameters = Button(self.frameParameters,width=50,height=1,command=self.saveParametersCmd,text="Save parameters to the running model",state=DISABLED)
            self.showHelp(self.buttonSaveParameters,"Saves the parameter values.\nNot all values may take effect on a running model\nA model reset might be required.")
            self.buttonSaveParameters.pack(side='top',padx=5,pady=5)
            self.buttonSaveParametersAndReset = Button(self.frameParameters,width=50,height=1,command=self.saveParametersAndResetCmd,text="Save parameters to the model and reset the model")
            self.showHelp(self.buttonSaveParametersAndReset,"Saves the given parameter values and resets the model")
            self.buttonSaveParametersAndReset.pack(side='top',padx=5,pady=5)
        
    
    def setStatusStr(self,newStatus):
        self.statusStr = newStatus
        self.statusText.set(self.statusStr)  
    #model control functions
    def changeStepSize(self,val):        
        self.stepSize = int(val)
    def changeStepDelay(self,val):        
        self.timeInterval= int(val)    
    def saveParametersCmd(self):
        for variableSetter in self.parameterSetters:
            variableSetter(float(self.varEntries[variableSetter].get()))
        self.setStatusStr("New parameter values have been set")
    def saveParametersAndResetCmd(self):
        self.saveParametersCmd()
        self.resetModel()

    def runEvent(self):
        self.running = not self.running
        if self.running:
            self.rootWindow.after(self.timeInterval,self.stepModel)
            self.runPauseString.set("Pause")
            self.buttonStep.configure(state=DISABLED)
            self.buttonReset.configure(state=DISABLED)
            if len(self.parameterSetters) > 0:
                self.buttonSaveParameters.configure(state=NORMAL)
                self.buttonSaveParametersAndReset.configure(state=DISABLED)     
        else:
            self.runPauseString.set("Continue Run")
            self.buttonStep.configure(state=NORMAL)
            self.buttonReset.configure(state=NORMAL)
            if len(self.parameterSetters) > 0:
                self.buttonSaveParameters.configure(state=NORMAL)
                self.buttonSaveParametersAndReset.configure(state=NORMAL)

    def stepModel(self):
        if self.running:
            self.modelStepFunc()
            self.currentStep += 1
            self.setStatusStr("Step "+str(self.currentStep))
            self.status.configure(foreground='black')
            if (self.currentStep) % self.stepSize == 0:
                self.drawModel()
            self.rootWindow.after(int(self.timeInterval*1.0/self.stepSize),self.stepModel)

    def stepOnce(self):
        self.running = False
        self.runPauseString.set("Continue Run")
        self.modelStepFunc()
        self.currentStep += 1
        self.setStatusStr("Step "+str(self.currentStep))
        self.drawModel()
        if len(self.parameterSetters) > 0:
            self.buttonSaveParameters.configure(state=NORMAL)

    def resetModel(self):
        self.running = False        
        self.runPauseString.set("Run")
        self.modelInitFunc()
        self.currentStep = 0;
        self.setStatusStr("Model has been reset")
        self.drawModel()

    def drawModel(self):
        
        if self.modelFigure == None or self.modelFigure.canvas.manager.window == None:
            self.modelFigure = PL.figure()
            PL.ion()
        self.modelDrawFunc()
        self.modelFigure.canvas.manager.window.update()

    def start(self,func=[]):
        if len(func)==3:
            self.modelInitFunc = func[0]
            self.modelDrawFunc = func[1]
            self.modelStepFunc = func[2]            
            if (self.modelStepFunc.__doc__ != None and len(self.modelStepFunc.__doc__)>0):
                self.showHelp(self.buttonStep,self.modelStepFunc.__doc__.strip())                
            if (self.modelInitFunc.__doc__ != None and len(self.modelInitFunc.__doc__)>0):
                self.textInformation.config(state=NORMAL)
                self.textInformation.delete(1.0, END)
                self.textInformation.insert(END, self.modelInitFunc.__doc__.strip())
                self.textInformation.config(state=DISABLED)
                
            self.modelInitFunc()
            self.drawModel()     
        self.rootWindow.mainloop()

    def quitGUI(self):
        PL.close('all')
        self.rootWindow.quit()
        self.rootWindow.destroy()
    
    
    
    def showHelp(self, widget,text):
        def setText(self):
            self.statusText.set(text)
            self.status.configure(foreground='blue')
            
        def showHelpLeave(self):
            self.statusText.set(self.statusStr)
            self.status.configure(foreground='black')
        widget.bind("<Enter>", lambda e : setText(self))
        widget.bind("<Leave>", lambda e : showHelpLeave(self))
예제 #52
0
class Contratos(Frame):
    def __init__(self, parent, controller):
        Frame.__init__(self, parent)

        #VARIABLES GLOBALES
        global cod, cc, inquilino, codinm, inmueble, nit, owner, rel, vlrenta, duracion
        global contratos, tcontrato, incremento, gfacturaIni, facturaSgte, fecha, hoy
        global notas, anexos, destinacion, servicios, conexos, tercero, nombret, fecha
        global aplicado, cc_aplicado, n_aplicado, inm_aplicado, novedad, n_nombre, n_valor
        global h, busqueda, clean, update, add

        #INSTANCIEAS DE LOS WIDGETS
        global e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, Cbx1, chkb1, chkb2, lb, cedulaE, notas

        fecha = datetime.date.today()
        hoy = "%s" % fecha  #ESTE NUESTRA LA FECHA EN FORMATO AÑO-MES-DIA (YYYY/MM/DD)
        #hoy = time.strftime("%d/%m/%y") #ESTO PARA VER FORMATO FECHA EN DIA/MES/AÑO
        #hoy = time.strftime("%y/%m/%d")
        h = hoy

        #VARIABLES
        lupa = PhotoImage(file='img/lupa.png')
        schedule = PhotoImage(file='img/calendar.gif')

        cod = IntVar()
        cc = StringVar()
        inquilino = StringVar()
        codinm = IntVar()
        inmueble = StringVar()
        nit = StringVar()
        owner = StringVar()
        rel = IntVar()

        vlrenta = DoubleVar()
        duracion = IntVar()
        contratos = ['Vivienda', 'Comercial', 'Mixta']
        tcontrato = StringVar()
        incremento = DoubleVar()
        gfacturaIni = IntVar()
        facturaSgte = IntVar()
        fecha = StringVar()

        notas = StringVar()
        anexos = StringVar()
        destinacion = StringVar()
        servicios = StringVar()
        conexos = StringVar()

        tercero = StringVar()
        nombret = StringVar()

        aplicado = IntVar()
        cc_aplicado = StringVar()
        n_aplicado = StringVar()
        inm_aplicado = StringVar()
        novedad = StringVar()
        n_nombre = StringVar()
        n_valor = DoubleVar()

        #BUSQUEDA = ["Nombre","CC/Nit"]
        busqueda = StringVar()
        busqueda.trace("w", lambda name, index, mode: buscar())
        dato = StringVar()

        #WIDGETS

        #========================= HEADER ===========================

        self.header = Label(self, text="CONTRATOS", font="bold")
        self.header.pack(pady=20, side=TOP)

        #========================== WRAPPER ==========================

        self.wrapper = Frame(self)
        self.wrapper.pack(side=LEFT, fill=Y)

        #================ NOTEBOOK =============>

        self.nb = Notebook(self.wrapper)

        #-----------------------> TAB 1

        self.tab1 = Frame(self.nb)

        self.f0 = Frame(self.tab1)  #-------------------------------------
        self.f0.pack(pady=5, fill=X)

        l1 = Label(self.f0, text='Código:')
        l1.pack(side=LEFT)

        e1 = Entry(self.f0, textvariable=cod, width=10)
        e1.pack(side=LEFT)

        self.f1 = Frame(self.tab1)  #-------------------------------------
        self.f1.pack(pady=5, fill=X)

        l2 = Label(self.f1, text='Arrendatario:')
        l2.pack(side=LEFT, fill=X)

        e2 = Entry(self.f1, textvariable=cc, width=15)
        e2.pack(side=LEFT)
        e2.bind('<Return>', buscarA)

        b1 = Button(self.f1, image=lupa, command=topArrendatario)
        b1.image = lupa
        b1.pack(side=LEFT)

        e3 = Entry(self.f1, textvariable=inquilino, state=DISABLED)
        e3.pack(side=LEFT, fill=X, expand=1)

        self.f2 = Frame(self.tab1)
        self.f2.pack(pady=5, fill=X)  #------------------------------------

        l3 = Label(self.f2, text='Inmueble:')
        l3.pack(side=LEFT)

        e4 = Entry(self.f2, textvariable=codinm, width=10)
        e4.pack(side=LEFT)
        e4.bind('<Return>', buscarR)

        b2 = Button(self.f2, image=lupa, command=topRelacion)
        b2.pack(side=LEFT)

        e5 = Entry(self.f2, textvariable=inmueble, state=DISABLED)
        e5.pack(side=LEFT, fill=X, expand=1)

        self.f3 = Frame(self.tab1)
        self.f3.pack(pady=5, fill=X)  #------------------------------------

        l4 = Label(self.f3, text='Propietario:')
        l4.pack(side=LEFT)

        e6 = Entry(self.f3, width=15, textvariable=nit, state=DISABLED)
        e6.pack(side=LEFT)
        e7 = Entry(self.f3, width=5, textvariable=owner, state=DISABLED)
        e7.pack(side=LEFT, fill=X, expand=1)

        self.f4 = Frame(self.tab1)
        self.f4.pack(pady=5, fill=X)  #------------------------------------

        self.arriendo = Label(self.f4, text='Arriendo $:')
        self.arriendo.pack(side=LEFT)
        e8 = Entry(self.f4, textvariable=vlrenta, state=DISABLED, width=20)
        e8.pack(side=LEFT)

        self.duracion = Label(self.f4, text='Duración Contrato:')
        self.duracion.pack(side=LEFT)
        e9 = Entry(self.f4, textvariable=duracion, width=5)
        e9.pack(side=LEFT)

        self.meses = Label(self.f4, text='Meses')
        self.meses.pack(side=LEFT)

        self.f5 = Frame(self.tab1)
        self.f5.pack(pady=5, fill=X)  #------------------------------------

        self.tcontrato = Label(self.f5, text='Tipo Contrato:')
        self.tcontrato.pack(side=LEFT)

        Cbx1 = Combobox(self.f5,
                        textvariable=tcontrato,
                        values=contratos,
                        width=10)
        Cbx1.set('')
        Cbx1.pack(side=LEFT)

        self.incremento = Label(self.f5, text='Incremento:')
        self.incremento.pack(side=LEFT)
        e10 = Entry(self.f5, textvariable=incremento, width=5)
        e10.pack(side=LEFT)

        chkb1 = Checkbutton(self.f5,
                            text="General factura\n inicial",
                            variable=gfacturaIni)
        chkb1.pack(side=LEFT)
        chkb2 = Checkbutton(self.f5,
                            text="Facturar príodo\n siguiente",
                            variable=facturaSgte)
        chkb2.pack(side=LEFT)

        self.f6 = Frame(self.tab1)
        self.f6.pack(pady=5, fill=X)  #------------------------------------

        btime = Button(self.f6, image=schedule, command=calendario)
        btime.image = schedule
        btime.pack(side=RIGHT)

        etime = Entry(self.f6, textvariable=fecha, width=10)
        fecha.set(hoy)
        etime.pack(side=RIGHT)

        #ltime = Label(self.f6, text=hoy, font="bold", foreground='red')
        #ltime.pack(side=RIGHT)

        self.fi = Label(self.f6, text='Fecha Inicio: ')
        self.fi.pack(side=RIGHT)

        self.tab1.pack()

        #-----------------------> TAB 2

        self.tab2 = Frame(self.nb)
        self.tab2.pack()

        self.f7 = Frame(self.tab2)  #-------------------------------------
        self.f7.pack(fill=X, pady=10)

        notas = Text(self.f7, height=5)
        notas.pack(side=LEFT, fill=X, expand=1)

        self.f8 = Frame(self.tab2)
        self.f8.pack(pady=5,
                     fill=X)  #-------------------------------------------

        self.destino = Label(self.f8, text='Destinación:')
        self.destino.pack(side=LEFT)
        self.destinoE = Entry(self.f8, textvariable=destinacion, width=5)
        self.destinoE.pack(side=LEFT, fill=X, expand=1)

        self.f9 = Frame(self.tab2)
        self.f9.pack(pady=5,
                     fill=X)  #-------------------------------------------

        self.servicios = Label(self.f9, text='Servicios adicionales:')
        self.servicios.pack(side=LEFT)
        self.serviciosE = Entry(self.f9, textvariable=servicios, width=5)
        self.serviciosE.pack(side=LEFT, fill=X, expand=1)

        self.f10 = Frame(self.tab2)
        self.f10.pack(pady=5,
                      fill=X)  #-------------------------------------------

        self.conexos = Label(self.f10, text='Conexos:')
        self.conexos.pack(side=LEFT)
        self.conexosE = Entry(self.f10, textvariable=conexos, width=5)
        self.conexosE.pack(side=LEFT, fill=X, expand=1)

        #-----------------------> TAB 3

        self.tab3 = Frame(self.nb)
        self.tab3.pack()

        self.f11 = Frame(self.tab3)  #-------------------------------------
        self.f11.pack(fill=X, pady=5)

        self.cedula = Label(self.f11, text='CC/Nit: ')
        self.cedula.pack(side=LEFT)

        cedulaE = Entry(self.f11, textvariable=tercero, width=15)
        cedulaE.pack(side=LEFT)
        cedulaE.bind('<Return>', buscarT)

        b4 = Button(self.f11, image=lupa, command=topTercero)
        b4.image = lupa
        b4.pack(side=LEFT)

        self.f12 = Frame(self.tab3)  #-------------------------------------
        self.f12.pack(fill=X, pady=5)

        self.tercero = Label(self.f12, text='Nombre: ')
        self.tercero.pack(side=LEFT)

        self.terceroE = Entry(self.f12,
                              textvariable=nombret,
                              width=5,
                              state=DISABLED)
        self.terceroE.pack(side=LEFT, fill=X, expand=1)

        #-----------------------> TAB 4

        self.tab4 = Frame(self.nb)
        self.tab4.pack()

        self.f13 = Frame(self.tab4)  #-------------------------------------
        self.f13.pack(fill=X, pady=5)

        l = Label(self.f13, text='Aplicar a: ')
        l.pack(side=LEFT)

        Ch = Checkbutton(self.f13, text="Propietario", variable=aplicado)
        Ch.pack(side=LEFT)

        self.f14 = Frame(self.tab4)  #-------------------------------------
        self.f14.pack(fill=X, pady=5)

        l13 = Label(self.f14, text='CC/Nit: ')
        l13.pack(side=LEFT)

        e13 = Entry(self.f14, textvariable=cc_aplicado, width=15)
        e13.pack(side=LEFT)

        b13 = Button(self.f14, image=lupa, command=None)
        b13.image = lupa
        b13.pack(side=LEFT)

        e13 = Entry(self.f14, textvariable=n_aplicado, state=DISABLED)
        e13.pack(side=LEFT, fill=X, expand=1)

        self.f15 = Frame(self.tab4)
        self.f15.pack(fill=X, pady=5)  #------------------------------------

        l14 = Label(self.f15, text='Cod.Inmueble:')
        l14.pack(side=LEFT)

        e14 = Entry(self.f15,
                    textvariable=inm_aplicado,
                    width=5,
                    state=DISABLED)
        e14.pack(side=LEFT, fill=X, expand=1)

        self.f16 = Frame(self.tab4)
        self.f16.pack(fill=X, pady=5)  #------------------------------------

        l16 = Label(self.f16, text='Novedad:')
        l16.pack(side=LEFT, fill=X)

        e16 = Entry(self.f16, textvariable=novedad, width=15)
        e16.pack(side=LEFT)

        b16 = Button(self.f16, image=lupa, command=None)
        b16.image = lupa
        b16.pack(side=LEFT)

        e16 = Entry(self.f16, textvariable=n_nombre, state=DISABLED)
        e16.pack(side=LEFT, fill=X, expand=1)

        self.f17 = Frame(self.tab4)
        self.f17.pack(fill=X, pady=5)  #------------------------------------

        l17 = Label(self.f17, text='Vlr Novedad:')
        l17.pack(side=LEFT, fill=X)

        e17 = Entry(self.f17, textvariable=n_valor, width=15)
        e17.pack(side=LEFT)

        #---------------------------------------------------------------

        self.nb.add(self.tab1, text="General")
        self.nb.add(self.tab2, text="Anexos")
        self.nb.add(self.tab3, text="Tercero")
        self.nb.add(self.tab4, text="Gasto fijo")

        self.nb.pack()

        self.fBtn = Frame(self.wrapper)
        self.fBtn.pack()  #-------------------------------

        clean = Button(self.fBtn,
                       text='Limpiar',
                       bg='navy',
                       foreground='white',
                       activebackground='red3',
                       activeforeground='white',
                       command=limpiar)
        clean.pack(side=RIGHT)

        update = Button(self.fBtn,
                        text='Actualizar',
                        bg='navy',
                        foreground='white',
                        activebackground='red3',
                        activeforeground='white',
                        command=actualizar,
                        state=DISABLED)
        update.pack(side=RIGHT)

        add = Button(self.fBtn,
                     text='Agregar',
                     bg='navy',
                     foreground='white',
                     activebackground='red3',
                     activeforeground='white',
                     command=agregar)
        add.pack(side=RIGHT)

        #========================= ASIDE ===========================

        self.aside = Frame(self)
        self.aside.pack(side=TOP, fill=BOTH)

        self.wrap1 = Frame(self.aside)
        self.wrap1.pack()

        self.viewer = Label(self.wrap1, text="LISTA DE CONTRATOS")
        self.viewer.pack()

        scroll = Scrollbar(self.wrap1, orient=VERTICAL)
        scroll.pack(side=RIGHT, fill=Y)
        lb = Listbox(self.wrap1,
                     yscrollcommand=scroll.set,
                     height=20,
                     width=30)
        scroll.config(command=lb.yview)
        lb.pack(fill=BOTH)
        lb.bind("<Double-Button-1>", callback)

        self.wrap2 = Frame(self.aside)
        self.wrap2.pack()

        show = Button(self.wrap2,
                      text='Cargar lista',
                      bg='navy',
                      foreground='white',
                      activebackground='red3',
                      activeforeground='white',
                      command=cargar)
        show.pack(fill=X)

        delete = Button(self.wrap2,
                        text='Borrar',
                        bg='navy',
                        foreground='white',
                        activebackground='red3',
                        activeforeground='white',
                        command=borrar)
        delete.pack(fill=X)

        edit = Button(self.wrap2,
                      text='Modificar',
                      bg='navy',
                      foreground='white',
                      activebackground='red3',
                      activeforeground='white',
                      command=modificar)
        edit.pack(fill=X)

        buscador = Label(self.wrap2, text="Buscar por CC:")
        buscador.pack()
        E = Entry(self.wrap2, textvariable=busqueda, width=24)
        E.pack()
예제 #53
0
    def __init__(self, master):
	
	self.fname=""        
        #global variables
        self.t1=StringVar()
        self.t2=StringVar()
        self.t3=StringVar()
        self.t4=StringVar()
        self.t5=StringVar()
        self.t6=StringVar()
        self.t7=StringVar()
        self.t8=StringVar()
        self.t9=StringVar()
        self.t10=StringVar()
        
        self.var1=StringVar()
        self.var2=StringVar()
        self.var3=StringVar()
        self.var4=StringVar()
        self.var5=StringVar()
        self.var6=StringVar()
        self.var7=StringVar()
        self.var8=StringVar()
        self.var9=StringVar()
        self.var10=StringVar()
        #end
        
        mymaster = Frame(master, name='mymaster') # create Frame in "root"
        mymaster.pack(fill=BOTH)
        #min and max size of window    
        #master.minsize(width=900, height=900)
        #master.maxsize(width=650, height=500)
        #end
        
        #title of window
        master.title("Airdrop-ng")
        #end
        
        #for the style of fonts
        self.customFont = tkFont.Font(family="Helvetica", size=12)
        self.myfont = tkFont.Font(family="Helvetica", size=10)
        self.myfont2 = tkFont.Font(family="Helvetica", size=8)
        self.headerfont=tkFont.Font(family="Helvetica", size=15,underline = True)
        self.myfontnew=tkFont.Font(family="Helvetica", size=11,underline = True)
        #end
        
        
       
        nb = Notebook(mymaster, name='nb') # create Notebook in "master"
        nb.pack(fill=BOTH, padx=2, pady=3) # fill "master" but pad sides
        #content frame
        self.frame_content = Frame(nb,name="frame_content", bg="white")
        self.frame_content.pack(fill=BOTH, side=TOP, expand=True)
        nb.add(self.frame_content, text="Filter-1") # add tab to Notebook
	self.frame_content7 = Frame(nb, name='frame_content7', bg="white")
        nb.add(self.frame_content7, text="Detect Devices")
    
        # repeat for each tab
        
        self.frame_content5 = Frame(nb, name='frame_content5', bg="white")
        nb.add(self.frame_content5, text="output")
        
        #End
        
	#frame content 7
	Label(self.frame_content7, text = 'Airdrop-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        btndetect=Button(self.frame_content7, text = 'Detect', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 1, column = 0, padx = 5, pady = 5)
		
	btndbrowse=Button(self.frame_content7, text = 'Attach File', command =self.browse_file, height=2, width=15, font=self.customFont).grid(row = 3, column = 0, padx = 5, pady = 5)	
	self.lilnew1=Listbox(self.frame_content7,bg="black", fg="white", font=self.myfont, selectmode=SINGLE, width=30, height=15)
        self.lilnew1.grid(row = 1, column = 1, rowspan=3)
	#End
	
        Label(self.frame_content, text = 'Airdrop-ng',font=self.headerfont, bg="white", padx=10, pady=10).grid(row = 0, column = 0)
        Label(self.frame_content, text = 'Options :',font=self.myfontnew, bg="white").grid(row = 1, column = 1)
        #Button(self.frame_content, text = 'ivs', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 0, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'gpsd', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 1, padx = 5, pady = 5)
        #Button(self.frame_content, text = 'write', command =self.canvas_detect, height=2, width=15, font=self.customFont).grid(row = 2, column = 2, padx = 5, pady = 5)
        #command Listbox
        Label(self.frame_content5, text = 'Edit Command From Here',font=self.myfontnew, bg="white", justify=LEFT).grid(row = 0, column = 0)
        TextCommandBox=Text(self.frame_content5, height=5, width=30)
        TextCommandBox.grid(row=1, column=0, padx=5, pady=5)
        self.output=Text(self.frame_content5,bg="black", fg="white", font=self.myfont, height=20, width=42)
        self.output.grid(row = 0, column = 1, padx=50, pady=5, rowspan=3)
        btnsubmit=Button(self.frame_content5, width=15, height=2, text="Get Result", command=self.mycallback)
        btnsubmit.grid(row=2, column=0)
        btnclear=Button(self.frame_content5, width=15, height=2, text="Clear Output", command=self.clearoutput)
        btnclear.grid(row=3, column=0)
        #end
        self.C1 = Checkbutton(self.frame_content, text = "-i", \
                 onvalue = "-i", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var1)
        self.C1.grid(row = 2, column = 0, padx = 5, pady = 5)
        self.t1=Text(self.frame_content,height=1,width = 20)
        self.t1.grid(row = 2, column = 1, padx = 5, pady = 5)
        l1=Label(self.frame_content, text = ': Wireless card in monitor mode to inject from',font=self.myfont, bg="white", justify=LEFT).grid(row = 2, column = 2, padx = 5, pady = 5)
        
        self.C2 = Checkbutton(self.frame_content, text = "-t", \
                 onvalue = "-t", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var2)
        self.C2.grid(row = 3, column = 0, padx = 5, pady = 5)
        self.t2=Text(self.frame_content,height=1,width = 20)
        self.t2.grid(row = 3, column = 1, padx = 5, pady = 5)
        l2=Label(self.frame_content, text = ': Airodump txt file in CSV format NOT the pcap',font=self.myfont, bg="white", justify=LEFT).grid(row = 3, column = 2, padx = 5, pady = 5)
        
        self.C3 = Checkbutton(self.frame_content, text = "-p", \
                 onvalue = "-p", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var3)
        self.C3.grid(row = 4, column = 0, padx = 5, pady = 5)
        self.t3=Text(self.frame_content,height=1,width = 20)
        self.t3.grid(row = 4, column = 1, padx = 5, pady = 5)
        l3=Label(self.frame_content, text = ': Disable the use of Psyco JIT',font=self.myfont, bg="white", justify=LEFT).grid(row = 4, column = 2, padx = 5, pady = 5)
        
        self.C4 = Checkbutton(self.frame_content, text = "-r", \
                 onvalue = "-r", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var4)
        self.C4.grid(row = 5, column = 0, padx = 5, pady = 5)
        self.t4=Text(self.frame_content,height=1,width = 20)
        self.t4.grid(row = 5, column = 1, padx = 5, pady = 5)
        l4=Label(self.frame_content, text = ': Rule File for matched deauths)',font=self.myfont, bg="white", justify=LEFT).grid(row = 5, column = 2, padx = 5, pady = 5)
        
        self.C5 = Checkbutton(self.frame_content, text = "-u", \
                 onvalue = "-u", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var5)
        self.C5.grid(row = 6, column = 0, padx = 5, pady = 5)
        self.t5=Text(self.frame_content,height=1,width = 20)
        self.t5.grid(row = 6, column = 1, padx = 5, pady = 5)
        l5=Label(self.frame_content, text = ': Updates OUI list.',font=self.myfont, bg="white", justify=LEFT).grid(row = 6, column = 2, padx = 5, pady = 5)
        
        self.C6 = Checkbutton(self.frame_content, text = "-d", \
                 onvalue = "-d", offvalue = "", height=1, \
                 bg="white", font=self.customFont,variable=self.var6)
        self.C6.grid(row = 8, column = 0, padx = 5, pady = 5)
        self.t6=Text(self.frame_content,height=1,width = 20)
        self.t6.grid(row = 8, column = 1, padx = 5, pady = 5)
        l6=Label(self.frame_content, text = ': Injection driver. Default is mac80211.',font=self.myfont, bg="white", justify=LEFT).grid(row = 8, column = 2, padx = 5, pady = 5)
        
        self.C7 = Checkbutton(self.frame_content, text = "-s", \
                 onvalue = "-s", offvalue = "", height=1, \
                 width = 7, bg="white", font=self.customFont,variable=self.var7)
        self.C7.grid(row = 9, column = 0, padx = 5, pady = 5)
        self.t7=Text(self.frame_content,height=1,width = 20)
        self.t7.grid(row = 9, column = 1, padx = 5, pady = 5)
        l7=Label(self.frame_content, text = ': Time to sleep between sending each packet',font=self.myfont, bg="white", justify=LEFT).grid(row = 9, column = 2, padx = 5, pady = 5)
        
        self.C8 = Checkbutton(self.frame_content, text = "-b", \
                onvalue = "-b", offvalue = "", height=1, \
                width = 7, bg="white", font=self.customFont,variable=self.var8)
        self.C8.grid(row = 10, column = 0, padx = 5, pady = 5)
        self.t8=Text(self.frame_content,height=1,width = 20)
        self.t8.grid(row = 10, column = 1, padx = 5, pady = 5)
        l8=Label(self.frame_content, text = ': Turn on Rule Debugging',font=self.myfont, bg="white", justify=LEFT).grid(row = 10, column = 2, padx = 5, pady = 5)
        
        self.C9 = Checkbutton(self.frame_content, text = "-l", \
                onvalue = "-l", offvalue = "", height=1, \
                width = 7, bg="white", font=self.customFont,variable=self.var9)
        self.C9.grid(row = 11, column = 0, padx = 5, pady = 5)
        self.t9=Text(self.frame_content,height=1,width = 20)
        self.t9.grid(row = 11, column = 1, padx = 5, pady = 5)
        l9=Label(self.frame_content, text = ': Enable Logging to a file',font=self.myfont, bg="white", justify=LEFT).grid(row = 11, column = 2, padx = 5, pady = 5)
        
        self.C10 = Checkbutton(self.frame_content, text = "-n", \
                onvalue = "-n", offvalue = "", height=1, \
                width = 7, bg="white", font=self.customFont,variable=self.var10)
        self.C10.grid(row = 12, column = 0, padx = 5, pady = 5)
        self.t10=Text(self.frame_content,height=1,width = 20)
        self.t10.grid(row = 12, column = 1, padx = 5, pady = 5)
        l10=Label(self.frame_content, text = ': Time to sleep between loops',font=self.myfont, bg="white", justify=LEFT).grid(row = 12, column = 2, padx = 5, pady = 5)
예제 #54
0
파일: layout.py 프로젝트: kramerfelix/accpy
def cs_tabbar(root, w, h, names):
    nb = Notebook(root, width=w, height=h)
    tabs = [Frame(nb) for i in range(len(names))]  # 5 tabs
    [nb.add(tabs[i], text=name) for i, name in enumerate(names)]
    nb.pack()
    return tabs