From: Christian Herdtweck Date: Wed, 13 Jan 2016 17:10:12 +0000 (+0100) Subject: fix typos X-Git-Tag: v1.2~69 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=8620e97402379fb198d36ad7200292c6855ddf39;p=pyi2ncommon fix typos --- diff --git a/file_helpers.py b/file_helpers.py index 96acbb7..3610c7b 100644 --- a/file_helpers.py +++ b/file_helpers.py @@ -62,7 +62,8 @@ class FilesystemFillState: def get_filesystem_fill_states(): """ get fill state on all filesystems - parses the output of cmd 'df', returns list of :py:class:`FilesystemFillState` + parses the output of cmd 'df', returns list of + :py:class:`FilesystemFillState` """ # call @@ -82,7 +83,7 @@ def get_filesystem_fill_states(): # check columns and their header if len(separator_cols) != 5: - raise ValueError('unepexpected number of separator columns: {0}' + raise ValueError('unexpected number of separator columns: {0}' .format(separator_cols)) # must eliminate neighbours? title_line = out[0] diff --git a/test_helpers.py b/test_helpers.py index 548071b..3942f0f 100644 --- a/test_helpers.py +++ b/test_helpers.py @@ -35,8 +35,8 @@ class DiscFullPreventionError(Exception): """ def __init__(self, state, time_estim): super(DiscFullPreventionError, self).__init__( - 'Interrupting test to avoid full disc ({0}, full in {1} s)' - .format(state, time_estim)) + 'Interrupting test to avoid full disc ({0}, full in {1}s)' + .format(state, "?" if time_estim==None else time_estim)) self.state = state self.time_estim = time_estim @@ -51,7 +51,8 @@ class DiscFullPreventionWarning(WARN_BASE_CLASS): def __init__(self, state, time_estim): super(DiscFullPreventionWarning, self).__init__( 'Disc nearly full! Might soon abort test ({0}, ' - 'full in {1} s)'.format(state, time_estim)) + 'full in {1}s)' + .format(state, "?" if time_estim==None else time_estim)) self.state = state self.time_estim = time_estim @@ -59,7 +60,7 @@ class DiscFullPreventionWarning(WARN_BASE_CLASS): class DiscFillCheckerThread(Thread): """ a thread that checks disc fill in regular intervals """ - def __init__(self, interval=10, decision_function = None): + def __init__(self, interval=10, decision_function=None): """ creates a DiscFillCheckerThread :param int interval: time in seconds between checks of disc usage @@ -182,7 +183,7 @@ def default_disc_full_decision_function(curr_state, raise DiscFullPreventionError(curr_state, estim_empty_smallest) elif kill_level == KILL_REALLY_MEAN_EXIT: print('Disc fill below tolerance or disc full soon', file=stderr) - print('{0}, full in {1:.1f}s' + print('{0}, full in {1} s' .format(curr_state, estim_empty_smallest), file=stderr) print('Exiting now the brutal way', file=stderr) bad_exit_function_that_should_not_be_used(1)