import __builtin__
import sys

def debug(*object):

	str = `object`
	if not __builtin__.__dict__.has_key("_DEBUG"):
		_DEBUG = 1
	else:
		_DEBUG = __builtin__.__dict__['_DEBUG']
	if _DEBUG:
		#rox.info(str)
		sys.stderr.write("\n>> %s" % str)

def endsWith(str, sub):
	
	def _ends(str, sub):

		return (len(str) >= len(sub)) and (str.lower().find(sub.lower()) == len(str) - len(sub))

	if type(sub) == type([1, 2]):
		for s in sub:
			if _ends(str, s):
				return 1
	else:
		return _ends(str, sub)
	return 0


if __name__ == '__main__':
	
	assert(endsWith("Help", ".mpeg") == 0)


2004-11-22 11:39:16 CET