view vixm/util.py @ 50:616700d020ba pure

Added tag v0.30-rc1 for changeset fa451278826b
author Josef "Jeff" Sipek <jeffpc@josefsipek.net>
date Mon, 06 Nov 2006 05:35:43 -0500
parents dfcf1a46fc56
children
line wrap: on
line source

# util.py - utility functions
#
# Copyright (C) 2006  Josef "Jeff" Sipek <jeffpc@josefsipek.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.

def strtime(t):
	ms = t % 1000
	t /= 1000

	s = t % 60
	t /= 60

	ret = "%02d.%03d" % (s, ms)

	if t != 0:
		m = t
		ret = "%d:%s" % (m, ret)
	
	return ret

def special2int(s):
	if s == '$':
		return -1
	if s == '':
		return 1
	return int(s)

def fixupint(i, m):
	if i == -1:
		return m
	return i