8e9a16e Merge all wrapping methods into one

1 file Authored by lruzicka 6 months ago, Committed by lruzicka 6 months ago,
    Merge all wrapping methods into one
    
    Previously, users could set the wrapping width for the output, but
    they would have to use three different swithces to achieve a useful
    setting to wrap the output, i.e. they would have to set the
    --wrap-width and --wrap-bugs and --wrap-rpms.
    
    This PR removes the three options, merging them into --width.
    By default, the width is set to 0 which triggers auto-detection
    based on the width of the terminal window, i.e. --width=0.
    
    If you resize the terminal window while the application is running,
    the next update will automatically adjust to the new width of the
    terminal.
    
    On non-terminal environments, where the window width cannot be figured,
    the default width is 80.
    
    Users can override this by using an explicit value using --width=<width>.
    
    Fixes: https://pagure.io/fedora-easy-karma/issue/53
    Merges: https://pagure.io/fedora-easy-karma/pull-request/54
    
    Do not fail on width < 0 and more
    
    This PR fixes problems of the rebased PR. It adds protection to
    the code when user choose negative value for width. Everything is
    now taken.
    
    It renames self.twidth into self.termwidth for better readibility,
    as well as term_width() into determine_termwidth, dtto.
    
    It removes whitespace from the config file creation text.
    
    It adds error message to self.debug, but this change also required
    to remove @classmethod and @staticmethod from affected functions.
    
        
file modified
+54 -46