Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# Decorator for cli-args # Because of the sematics of decorator composition if we just append # to the options list positional options will appear to be backwards.
return ', '.join("'%s'" % i for i in l)
caching=False, print_empty=False)
row.append(formatters[field](o)) else:
"""wrap long strings to be no longer then max_length""" return '\n'.join([string[i:i + max_length] for i in range(0, len(string), max_length)])
"""pretty table prints dictionaries.
Wrap values to max_length wrap if wrap>0 """ caching=False, print_empty=False)
"""Helper for the _find_* methods.""" # first try to get entity as integer id
# now try to get entity as uuid
# finally try to find entity by name (manager.resource_class.__name__.lower(), name_or_id)) except exceptions.NoUniqueMatch: msg = ("Multiple %s matches found for '%s', use an ID to be more" " specific." % (manager.resource_class.__name__.lower(), name_or_id)) raise exc.CommandError(msg)
"""Adds 'unauthenticated' attribute to decorated function.
Usage::
@unauthenticated def mymethod(f): ... """
""" Checks to see if the function is marked as not requiring authentication with the @unauthenticated decorator. Returns True if decorator is set to True, False otherwise. """
""" Prompt user for password if not provided so the password doesn't show up in the bash history. """ if not (hasattr(sys.stdin, 'isatty') and sys.stdin.isatty()): # nothing to do return
while True: try: new_passwd = getpass.getpass('New Password: ') rep_passwd = getpass.getpass('Repeat New Password: ') if new_passwd == rep_passwd: return new_passwd except EOFError: return |