def __format__(self, format_spec):
format_spec = format_spec or self.default_format<EOL>h = self.seconds // <NUM_LIT><EOL>m, s = divmod(self.seconds % <NUM_LIT>, <NUM_LIT>)<EOL>l = h if h else "<STR_LIT>"<EOL>L = "<STR_LIT>" % h if h else "<STR_LIT>"<EOL>if format_spec.startswith("<STR_LIT>"):<EOL><INDENT>format_spec = format_spec[<NUM_LIT:2>:]<EOL>if not self.seconds:<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT><DEDENT>return self.TimeTemplate(format_spec).substitute(<EOL>h=h, m=m, s=s,<EOL>H="<STR_LIT>" % h, M="<STR_LIT>" % m, S="<STR_LIT>" % s,<EOL>l=l, L=L,<EOL>).strip()<EOL>
Formats the time span given the format_spec (or the default_format).