def parse_percent(percent_input):
 percent_input = percent_input.rstrip(u'%')
 try:
  return float(percent_input)
 except ValueError:
  raise ValueError(u"should be in format '0-x%'")

def parse_percent ( percent_input ) : percent_input = percent_input . rstrip ( u'%' ) try : return float ( percent_input ) except ValueError : raise ValueError ( u"should be in format '0-x%'" )
takes a size string from the config and turns it into int .