コード例 #1
0
ファイル: download.py プロジェクト: rizaumami/keryx
    def progress(self, blocks, size, total):
        if blocks*size > total: fraction = float(total)/float(total)
        else:                   fraction = float(blocks*size)/float(total)

        wx.CallAfter(self.SetGauge, int(round(fraction*100,2)))
        msg = self.curfile + "\n" + str(int(round(fraction*100,2))) + " % of " + lib.convert_file_size(total) + " - File "+ str(self.numfile) + "/" + str(self.numfiles)
        wx.CallAfter(self.SetFile, msg)
コード例 #2
0
ファイル: misc.py プロジェクト: simula67/keryx_url
    def SetPackage(self, stats = ['','','','','','','',0]):
        self.details.Clear()
        if stats[1] == '': return

        update = stats[0]
        name = stats[1]
        inst = stats[2]
        latest = stats[3]
        descrip = stats[4]
        depends = stats[5]
        filename = stats[6]
        size = lib.convert_file_size(stats[7])
        
        if not name == '': self.details.AppendText(name + '\n')
        if not descrip == '': self.details.AppendText(_("Description:\t") + descrip + '\n')
        if not inst == '': self.details.AppendText(_("Installed Version:\t") + inst + '\n')
        if not latest == '': self.details.AppendText(_("Latest Version:\t") + latest + '\n')
        if not depends =='': self.details.AppendText(_("Dependencies:\t") + depends + '\n')
        if not size == '': self.details.AppendText(_("Size:\t") + size + '\n')
        if not filename == '': self.details.AppendText(_("Filename:\t") + filename + '\n')
        #self.details.AppendText("%s\n%s\t%s\n%s\t%s\n%s\t%s\n%s\t%s\n%s\t%s\n%s\t%s" % 
        #    (name, d, descrip, i, inst, l, latest, dep, depends, s, size, f, filename))

        # Fixes scrolling issue
        self.details.ScrollLines(-15)

        points = self.details.GetFont().GetPointSize()
        style = wx.Font(points, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)
        self.details.SetStyle(0, len(name), wx.TextAttr("black", wx.NullColour, style))
コード例 #3
0
ファイル: download.py プロジェクト: rizaumami/keryx
    def progress(self, blocks, size, total):
        if blocks * size > total: fraction = float(total) / float(total)
        else: fraction = float(blocks * size) / float(total)

        wx.CallAfter(self.SetGauge, int(round(fraction * 100, 2)))
        msg = self.curfile + "\n" + str(int(round(
            fraction * 100,
            2))) + " % of " + lib.convert_file_size(total) + " - File " + str(
                self.numfile) + "/" + str(self.numfiles)
        wx.CallAfter(self.SetFile, msg)
コード例 #4
0
ファイル: misc.py プロジェクト: rizaumami/keryx
    def SetPackage(self, stats=['', '', '', '', '', '', '', 0]):
        self.details.Clear()
        if stats[1] == '': return

        update = stats[0]
        name = stats[1]
        inst = stats[2]
        latest = stats[3]
        descrip = stats[4]
        depends = stats[5]
        filename = stats[6]
        size = lib.convert_file_size(stats[7])

        if not name == '': self.details.AppendText(name + '\n')
        if not descrip == '':
            self.details.AppendText(_("Description:\t") + descrip + '\n')
        if not inst == '':
            self.details.AppendText(_("Installed Version:\t") + inst + '\n')
        if not latest == '':
            self.details.AppendText(_("Latest Version:\t") + latest + '\n')
        if not depends == '':
            self.details.AppendText(_("Dependencies:\t") + depends + '\n')
        if not size == '': self.details.AppendText(_("Size:\t") + size + '\n')
        if not filename == '':
            self.details.AppendText(_("Filename:\t") + filename + '\n')
        #self.details.AppendText("%s\n%s\t%s\n%s\t%s\n%s\t%s\n%s\t%s\n%s\t%s\n%s\t%s" %
        #    (name, d, descrip, i, inst, l, latest, dep, depends, s, size, f, filename))

        # Fixes scrolling issue
        self.details.ScrollLines(-15)

        points = self.details.GetFont().GetPointSize()
        style = wx.Font(points, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL,
                        wx.FONTWEIGHT_BOLD)
        self.details.SetStyle(0, len(name),
                              wx.TextAttr("black", wx.NullColour, style))