def human_time(seconds):
 units = [(u'y', ((((60 * 60) * 24) * 7) * 52)), (u'w', (((60 * 60) * 24) * 7)), (u'd', ((60 * 60) * 24)), (u'h', (60 * 60)), (u'm', 60), (u's', 1)]
 seconds = int(seconds)
 if (seconds < 60):
  return u'   {0:2d}s'.format(seconds)
 for i in range((len(units) - 1)):
  (unit1, limit1) = units[i]
  (unit2, limit2) = units[(i + 1)]
  if (seconds >= limit1):
   return u'{0:2d}{1}{2:2d}{3}'.format((seconds // limit1), unit1, ((seconds % limit1) // limit2), unit2)
 return u'  ~inf'

def human_time ( seconds ) : units = [ ( u'y' , ( ( ( ( 60 * 60 ) * 24 ) * 7 ) * 52 ) ) , ( u'w' , ( ( ( 60 * 60 ) * 24 ) * 7 ) ) , ( u'd' , ( ( 60 * 60 ) * 24 ) ) , ( u'h' , ( 60 * 60 ) ) , ( u'm' , 60 ) , ( u's' , 1 ) ] seconds = int ( seconds ) if ( seconds < 60 ) : return u'   {0:2d}s' . format ( seconds ) for i in range ( ( len ( units ) - 1 ) ) : ( unit1 , limit1 ) = units [ i ] ( unit2 , limit2 ) = units [ ( i + 1 ) ] if ( seconds >= limit1 ) : return u'{0:2d}{1}{2:2d}{3}' . format ( ( seconds // limit1 ) , unit1 , ( ( seconds % limit1 ) // limit2 ) , unit2 ) return u'  ~inf'
returns a human-friendly time string that is always exactly 6 characters long .