Пример #1
0
 def confirmEdit(self):
     fn = ps34.confirmHtml(self.filename.get())
     bt = self.body.get(1.0, 'end')
     conn = wpdb.connDb('CustomPages')
     conn.updateWebpage(fn, bt)
     bodyText = self.body.get(1.0, 'end')
     ps34.writeHTML(fn, bodyText)
     ps34.openPage(fn)
Пример #2
0
 def confirm(self):
     fn = ps34.confirmHtml(self.filename.get())
     bodyText = self.body.get(1.0, 'end')
     conn = wpdb.connDb('CustomPages')
     conn.insertPage(fn, bodyText)
     ps34.createHTMLFile(fn)
     ps34.writeHTML(fn, bodyText)
     ps34.openPage(fn)
     self.disableFrame_2()
Пример #3
0
    def createTable(self, page):
        conn = wpdb.connDb('CustomPages')
        rows = str(conn.countRecords())
        records = []
        for i in range(1, int(rows)+3, 3):
            records.append(conn.selectRange(i, i+5))
        self.frame_3.grid(row = 1, column = 0, ipady = 30)
        
        nextBtn = ttk.Button(self.frame_3, text = 'Next-->', command = self.nextPage)
        prevBtn = ttk.Button(self.frame_3, text = '<--Prev', command = self.prevPage)
        nextBtn.grid(row = 5, column = 1, sticky = E)
        prevBtn.grid(row = 5, column = 1, sticky = W)
        
        self.btn = []
        for i in range(0, 3):
            try:
                self.fn = records[page][i][1]
                self.bt = records[page][i][2]
                lbl = Label(self.frame_3, text=self.fn, width = 20, height = 5)
                lbl.grid(row = i, column = 0, ipadx = 10, ipady = 10)
                lbl2 = Label(self.frame_3, text=self.bt,
                            width = 50, height = 5, wraplength = 300)
                lbl2.grid(row = i, column = 1, ipadx = 10, ipady = 10)
                lbl3 = Label(self.frame_3, text= ' ', width = 20, height = 5)
                lbl3.grid(row = i, column = 2, ipadx = 10, ipady = 10, sticky = N+S+E+W)
                self.btn.append(ttk.Button(lbl3, text = 'Select'))
                self.btn[i].configure(command = lambda info=(self.fn, self.bt): self.selectWebpage(info))
                self.btn[i].place(x = 40, y = 35)
                if i%2 == 0:
                    lbl.config(bg = '#476bb2', fg = 'white', relief = RAISED)
                    lbl2.config(bg = '#476bb2', fg = 'white', relief = RAISED)
                    lbl3.config(bg = '#476bb2', fg = 'white', relief = RAISED)
                else:
                    lbl.config(relief = RAISED)
                    lbl2.config(relief = RAISED)
                    lbl3.config(relief = RAISED)
                if records[page+1] == []:
                    nextBtn.grid_forget()
            except:
                nextBtn.grid_forget()

        if self.page == 0:
            prevBtn.grid_forget()