def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY,
"File and Folder Dialogs Tutorial")
global panel
panel = wx.Panel(self, wx.ID_ANY)
self.currentDirectory = os.getcwd()
# create the buttons and bindings
dirDlgBtn1 = wx.Button(panel, label="Choose Source")
dirDlgBtn1.Bind(wx.EVT_BUTTON, self.onDir1)
dirDlgBtn2 = wx.Button(panel, label="Choose Destination")
dirDlgBtn2.Bind(wx.EVT_BUTTON, self.onDir2)
moveBtn=wx.Button(panel, label="Check and Move Files")
moveBtn.Bind(wx.EVT_BUTTON, self.moveUFiles)
#moveBtn.Bind(wx.EVT_BUTTON, panel.Update)
#SQLite
conn = sqlite3.connect('checkTimes.db')
conn.execute('CREATE TABLE if not exists \
Checks(ID INTEGER PRIMARY KEY AUTOINCREMENT, \
checkTime DATETIME)')
cursor = conn.execute("SELECT checkTime from Checks \
where oid = (SELECT max(oid) from Checks)")
rows = cursor.fetchall()
conn.commit()
#Show Last Time Checked
timestr=str(rows).replace("[(u'", '').replace("',)]", '')
TextA=wx.StaticText(panel, -1, 'Last checked: '+timestr, (100, 175))
TextA.SetForegroundColour('Navy')
font = wx.Font(8, wx.DECORATIVE, wx.NORMAL, wx.NORMAL)
#TextA.SetFont(font)
# put the buttons in a sizer
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(dirDlgBtn1, 0, wx.ALL|wx.CENTER, 5)
sizer.Add(dirDlgBtn2, 0, wx.ALL|wx.CENTER, 5)
sizer.Add(moveBtn, 0, wx.ALL|wx.CENTER, 5)
panel.SetSizer(sizer)
评论列表
文章目录