src/zonal/tzdump.py [48:102]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def sortedList(setdata):
    l = list(setdata)
    l.sort(cmp=lambda x, y: DateTime.sort(x[0], y[0]))
    return l


def formattedExpandedDates(expanded):
    items = sortedList([(item[0], item[1], secondsToTime(item[2]), secondsToTime(item[3]),) for item in expanded])
    return ", ".join(["(%s, %s, %s, %s)" % item for item in items])


def secondsToTime(seconds):
    if seconds < 0:
        seconds = -seconds
        negative = "-"
    else:
        negative = ""
    secs = divmod(seconds, 60)[1]
    mins = divmod(seconds / 60, 60)[1]
    hours = divmod(seconds / (60 * 60), 60)[1]
    if secs:
        return "%s%02d:%02d:%02d" % (negative, hours, mins, secs,)
    else:
        return "%s%02d:%02d" % (negative, hours, mins,)


def usage(error_msg=None):
    if error_msg:
        print error_msg

    print """Usage: tzdump [options] FILE
Options:
    -h            Print this help and exit
    -v            Be verbose
    --start       Start year
    --end         End year

Arguments:
    FILE          iCalendar file containing a single VTIMEZONE

Description:
    This utility will dump the transitions in a VTIMEZONE over
    the request time range.

"""

    if error_msg:
        raise ValueError(error_msg)
    else:
        sys.exit(0)


if __name__ == '__main__':

    verbose = False
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/zonal/tzverify.py [164:219]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def sortedList(setdata):
    l = list(setdata)
    l.sort(cmp=lambda x, y: DateTime.sort(x[0], y[0]))
    return l


def formattedExpandedDates(expanded):
    items = sortedList([(item[0], item[1], secondsToTime(item[2]), secondsToTime(item[3]),) for item in expanded])
    return ", ".join(["(%s, %s, %s, %s)" % item for item in items])


def secondsToTime(seconds):
    if seconds < 0:
        seconds = -seconds
        negative = "-"
    else:
        negative = ""
    secs = divmod(seconds, 60)[1]
    mins = divmod(seconds / 60, 60)[1]
    hours = divmod(seconds / (60 * 60), 60)[1]
    if secs:
        return "%s%02d:%02d:%02d" % (negative, hours, mins, secs,)
    else:
        return "%s%02d:%02d" % (negative, hours, mins,)


def usage(error_msg=None):
    if error_msg:
        print error_msg

    print """Usage: tzverify [options] DIR1 DIR2
Options:
    -h            Print this help and exit
    -v            Be verbose
    -q            Be quiet
    --start       Start year
    --end         End year

Arguments:
    DIR1          Directories containing two sets of zoneinfo data
    DIR2          to be compared

Description:
    This utility will compare iCalendar zoneinfo hierarchies by expanding
    timezone transitions and comparing.

"""

    if error_msg:
        raise ValueError(error_msg)
    else:
        sys.exit(0)

if __name__ == '__main__':

    verbose = False
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



