'Append the format extension to the last argument
@param f: the function
@param args: argument list
@param ext: the format extension
@return: tuple (f, args)'

@staticmethod
def __format(f, args, ext):

    if ((not ext) or (ext == 'html')):
        return (f, args)
    items = [f]
    if args:
        items += args
    items = [i.rsplit('.', 1)[0] for i in items]
    items.append(('%s.%s' % (items.pop(), ext)))
    return (items[0], items[1:])
