def fix_thread_string(tstr):
    """
    Takes a string with numbers separated by period and possibly with /
    at end, and outputs a string with 3 digit numbers separated by periods.
    """
    remove_slash = lambda s: s[:-1] if s[-1] == '/' else s
    three_digits = lambda s: "%03d" % int(s)
    return '.'.join( map(three_digits, map(remove_slash, tstr.split('.'))))