Logo Search packages:      
Sourcecode: gameclock version File versions  Download package

def gameclock::Clock::update (   self  ) 

Refresh the display of the clock's widget

Definition at line 119 of file gameclock.py.

00119                     :
        """Refresh the display of the clock's widget"""
        # convert to seconds because that's what gmtime wants
        miliseconds = self.get_time()
        secs = miliseconds/1000
        self.text = time.strftime("%H:%M:%S", time.gmtime(abs(secs)))
        days = abs(secs) / ( 24 * 60 * 60 )
        if days >= 1:
            self.text = "%dd " % days + self.text
        self.dead = secs < 0
        if self.dead:
            self.text = "-" + self.text
        if self.game.miliseconds:
            mantissa = abs(miliseconds) - (math.floor(abs(secs))*1000)
            self.text += ".%03d" % (mantissa)
        return self.text

    def __str__(self):


Generated by  Doxygen 1.6.0   Back to index