Skip to content
  • Stavros Sachtouris's avatar
    Escape characters in CLI output methods · 5852db11
    Stavros Sachtouris authored
    Closes grnet/kamaki#32
    
    Kamaki CLI commands use some generic output methods to handle outputs.
    
    Generic output methods that escape control characters:
    - in kamaki.cli.utils: print_items, print_dict, print_list
    - in kamaki.cli.cmds: error
    
    Generic output methods that don't escape control characters:
    - in kamaki.cli.cmds: writeln, write
    
    The methods that don't escape control characters are used when the
    standard methods are not sufficient. For example, in "kamaki.cli.pithos"
    the "PithosAccount.print_objects" method adds decorative escape characters
    (i.e., bold, alignment), but has to escape the parts object and container
    names. To achieve this, escaping is handled in the method, and the output
    is printed with the "write" and "writeln" methods mentioned earlier.
    
    An encoding issue with kamaki.cli.errors.CLIError and the Exceptions extending it,
    is fixed. It is now ensured that the error message will always be in unicode.
    
    Also, fix flake8 errors on files affected by the above changes
    5852db11