#-*- coding: utf-8 -*-
from Tkinter import *
from baidublog import *
class GridDemo( Frame ):
def __init__( self ):
Frame.__init__( self )
self.master.title( "Baidu Blog Backup" )
self.grid( sticky = W+E+N+S )
self.label1 = Label( self,text="百度用户名:",width = 5 )
self.label1.grid( row = 0, column = 1, sticky = W+E+N+S )
self.entry1 = Entry(self,width=20)
self.entry1.grid(row=0,column=2)
self.entry1.insert(INSERT, "codedeveloper")
self.label2 = Label( self,text="第一篇博文地址:",width = 8 )
self.label2.grid( row = 0, column = 3, sticky = W+E+N+S )
self.entry2 = Entry(self,width=40)
self.entry2.grid(row=0,column=4,sticky = W+E+N+S)
self.entry2.insert(INSERT, "977f3010ab7e17dcf7039e99.html")
self.text = Text(self)
self.text.grid(row =1,columnspan = 5,sticky = W+E+N+S)
self.button = Button(self,text='Backup', width = 30,command=self.startBackupBlog)
self.button.grid(row=2, columnspan =5)
def startBackupBlog(self):
user = self.entry1.get()
firstBlogUrl = self.entry2.get()
self.backupAction(user, firstBlogUrl)
def backupAction(self,user,firstBlogUrl):
#first read first blog
|