##// END OF EJS Templates
python3: fixed raw-input
super-admin -
r4962:562a7580 default
parent child Browse files
Show More
@@ -269,7 +269,7 b' class DbManage(object):'
269 email = defaults.get('email')
269 email = defaults.get('email')
270
270
271 if username is None:
271 if username is None:
272 username = raw_input('Specify admin username:')
272 username = input('Specify admin username:')
273 if password is None:
273 if password is None:
274 password = self._get_admin_password()
274 password = self._get_admin_password()
275 if not password:
275 if not password:
@@ -278,7 +278,7 b' class DbManage(object):'
278 if not password:
278 if not password:
279 sys.exit()
279 sys.exit()
280 if email is None:
280 if email is None:
281 email = raw_input('Specify admin email:')
281 email = input('Specify admin email:')
282 api_key = self.cli_args.get('api_key')
282 api_key = self.cli_args.get('api_key')
283 self.create_user(username, password, email, True,
283 self.create_user(username, password, email, True,
284 strict_creation_check=False,
284 strict_creation_check=False,
@@ -517,7 +517,7 b' class DbManage(object):'
517 if _path is not None:
517 if _path is not None:
518 path = _path
518 path = _path
519 elif not self.tests and not test_repo_path:
519 elif not self.tests and not test_repo_path:
520 path = raw_input(
520 path = input(
521 'Enter a valid absolute path to store repositories. '
521 'Enter a valid absolute path to store repositories. '
522 'All repositories in that path will be added automatically:'
522 'All repositories in that path will be added automatically:'
523 )
523 )
@@ -291,14 +291,15 b' class _Page(list):'
291 # wrapper class can execute a query with the knowledge of what the
291 # wrapper class can execute a query with the knowledge of what the
292 # slice will be (for efficiency) and, in the same query, ask for the
292 # slice will be (for efficiency) and, in the same query, ask for the
293 # total number of items and only execute one query.
293 # total number of items and only execute one query.
294
294 try:
295 try:
295 first = (self.page - 1) * items_per_page
296 first = (self.page - 1) * items_per_page
296 last = first + items_per_page
297 last = first + items_per_page
297 self.items = list(self.collection[first:last])
298 self.items = list(self.collection[first:last])
298 except TypeError as err:
299 except TypeError as err:
299 raise TypeError(
300 raise TypeError(
300 "Your collection of type {} cannot be handled "
301 f"Your collection of type {type(self.collection)} cannot be handled "
301 "by paginate. ERROR:{}".format(type(self.collection), err)
302 f"by paginate. ERROR:{err}"
302 )
303 )
303
304
304 # Unless the user tells us how many items the collections has
305 # Unless the user tells us how many items the collections has
General Comments 0
You need to be logged in to leave comments. Login now