1. Jason R. Coombs
  2. jaraco.util

Commits

Jason R. Coombs  committed d84ca72

Fix number width on ui.Menu

  • Participants
  • Parent commits d744558
  • Branches default
  • Tags 6.2.1

Comments (0)

Files changed (1)

File jaraco/util/ui.py

View file
 		self.formatter = formatter
 
 	def get_choice(self, prompt="> "):
-		number_width = len(self.choices)/10+1
+		n = len(self.choices)
+		number_width = len(str(n)) + 1
 		menu_fmt = '{number:{number_width}}) {choice}'
 		formatted_choices = map(self.formatter, self.choices)
 		for number, choice in zip(count(1), formatted_choices):