Exemple #1
0
    def du(self, event): # wxGlade: MyFrame.<event_handler>
        print "Event handler `projectdu'"
        stats = projectdu.diskused()
        self.DU = self.tree_ctrl_1.AppendItem(self.USER, 'DiskUsage')
        self.tree_ctrl_1.Expand(self.USER)
        for i in range(0, len(stats)):
            self.du = self.tree_ctrl_1.AppendItem(self.DU, str(stats.items()[i]))
        self.SetStatusText("Disk Usage: %s" % os.environ['USER']+':'+str(stats['% Free']), 0)
        if stats['% Free'] < 10: #warning
            if stats['% Free'] <= 0: #warning
                dlg = wx.MessageDialog(self, 'disk usage error. Youve exceeded your allotment', 'Disk Hog!', wx.OK|wx.ICON_ERROR)
                dlg.ShowModal()
                dlg.Destroy()
                pylock.rmapelink()
                projectdu.plotdu()

                return -1
            else:
                pylock.apelink()
                dlg = wx.MessageDialog(self, 'Your about to loose acquisition ability. Disk Close to Full', 'move your sh**', wx.OK|wx.ICON_WARNING)
                dlg.ShowModal()
                dlg.Destroy()
                projectdu.plotdu()

                print 'mak'
                return 2
        else:
            pylock.apelink()
            print 'making links'
Exemple #2
0
 def plotdu(self, event): # wxGlade: MyFrame.<event_handler>
     print "Event handler `plotdu'  "
     projectdu.plotdu()