def format_span(fmt, yearfrom, yearto, fromnchars, tonchars):
 args = str(yearfrom)[(- fromnchars):]
 if tonchars:
  args = (str(yearfrom)[(- fromnchars):], str(yearto)[(- tonchars):])
 return (fmt % args)

def format_span ( fmt , yearfrom , yearto , fromnchars , tonchars ) : args = str ( yearfrom ) [ ( - fromnchars ) : ] if tonchars : args = ( str ( yearfrom ) [ ( - fromnchars ) : ] , str ( yearto ) [ ( - tonchars ) : ] ) return ( fmt % args )
return a span string representation .