From a58484daa6b71b622376b367f44917f35a9deb72 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 14 Jul 2011 17:03:07 +0000 Subject: [PATCH] =?utf8?q?Gr=C3=B6=C3=9Ferer=20Umbau=20Teil=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.brehm-online.com/svn/my-stuff/python/PyLogrotate/trunk@292 ec8d2aa5-1599-4edb-8739-2b3a1bc399aa --- LogRotate/Common.py | 4 +- LogRotate/Config.py | 627 ++++++++++++++++++++---------------- LogRotate/Getopts.py | 7 +- LogRotate/Handler.py | 52 +-- LogRotate/Script.py | 2 +- LogRotate/StatusFile.py | 41 ++- po/pylogrotate.pot | 687 ++++++++++++++++------------------------ 7 files changed, 688 insertions(+), 732 deletions(-) diff --git a/LogRotate/Common.py b/LogRotate/Common.py index 15072b0..44e29b8 100755 --- a/LogRotate/Common.py +++ b/LogRotate/Common.py @@ -198,7 +198,7 @@ def human2bytes(value, si_conform = True, use_locale_radix = False, verbose = 0) radix = locale.RADIXCHAR radix = re.escape(radix) if verbose > 5: - msg = _("using radix '%s'.") % (radix) + msg = _("Using radix '%s'.") % (radix) logger.debug(msg) value_raw = '' @@ -296,7 +296,7 @@ def period2days(period, use_locale_radix = False, verbose = 0): value = str(period).strip().lower() if period == '': - msg = _("Given period was empty") + msg = _("Given period was empty.") raise ValueError(msg) if verbose > 4: diff --git a/LogRotate/Config.py b/LogRotate/Config.py index 47b2fd8..375212a 100755 --- a/LogRotate/Config.py +++ b/LogRotate/Config.py @@ -156,7 +156,6 @@ no_values = ( 'false', ) - #======================================================================== class LogrotateConfigurationError(Exception): @@ -336,7 +335,7 @@ class LogrotateConfigurationReader(object): @type: dict ''' - self.logger.debug( _("Logrotate config reader initialised") ) + self.logger.debug( _("Logrotate config reader initialised.") ) #------------------------------------------------------------ def __str__(self): @@ -395,7 +394,8 @@ class LogrotateConfigurationReader(object): _ = self.t.lgettext if self.verbose > 3: - self.logger.debug( _("Resetting default values for directives to hard coded values")) + msg = _("Resetting default values for directives to hard coded values") + self.logger.debug(msg) self.default = {} @@ -453,11 +453,13 @@ class LogrotateConfigurationReader(object): _ = self.t.lgettext if not pattern_type in pattern_types: - raise Exception( _("Invalid taboo pattern type '%s' given") % (pattern_type) ) + msg = _("Invalid taboo pattern type '%s' given.") % (pattern_type) + raise Exception(msg) pattern = ( pattern_types[pattern_type] % pattern ) if self.verbose > 3: - self.logger.debug( _("New taboo pattern: '%s'.") % (pattern) ) + msg = _("New taboo pattern: '%s'.") % (pattern) + self.logger.debug(msg) self.taboo.append(pattern) @@ -486,7 +488,8 @@ class LogrotateConfigurationReader(object): path_list.append(real_dir) dir_included[real_dir] = True else: - self.logger.debug( _("'%s' is not a directory") % (item)) + msg = _("'%s' is not a directory.") % (item) + self.logger.debug(msg) # Including default path list from python def_path = os.defpath @@ -498,7 +501,8 @@ class LogrotateConfigurationReader(object): path_list.append(real_dir) dir_included[real_dir] = True else: - self.logger.debug( _("'%s' is not a directory") % (item)) + msg = _("'%s' is not a directory.") % (item) + self.logger.debug(msg) # Including own defined directories for item in ('/usr/local/bin', '/sbin', '/usr/sbin', '/usr/local/sbin'): @@ -508,7 +512,8 @@ class LogrotateConfigurationReader(object): path_list.append(real_dir) dir_included[real_dir] = True else: - self.logger.debug( _("'%s' is not a directory") % (item)) + msg = _("'%s' is not a directory.") % (item) + self.logger.debug(msg) self.search_path = path_list @@ -526,7 +531,7 @@ class LogrotateConfigurationReader(object): @rtype: list ''' - #_ = self.t.lgettext + _ = self.t.lgettext path_list = self.search_path if include_current: @@ -557,14 +562,19 @@ class LogrotateConfigurationReader(object): found = True break else: - self.logger.debug( _("Search path '%s' doesn't exists or is not a directory") % (search_dir)) + msg = _("Search path '%s' doesn't exists or is not " + + "a directory.") \ + % (search_dir) + self.logger.debug(msg) if found: - self.logger.debug( _("Shred command found: '%s'") %(cmd) ) + msg = _("Shred command found: '%s'.") % (cmd) + self.logger.debug(msg) self.shred_command = cmd return True else: - self.logger.warning( _("Shred command not found, shred disabled") ) + msg = _("Shred command not found, shred disabled.") + self.logger.warning(msg) self.shred_command = None return False @@ -705,7 +715,9 @@ class LogrotateConfigurationReader(object): try: cfile = open(configfile, 'Ur') except IOError, e: - raise LogrotateConfigurationError( ( _("Could not read configuration file '%s'") % (configfile) ) + ': ' + str(e)) + msg = _("Could not read configuration file '%s'") % (configfile) + msg += ': ' + str(e) + raise LogrotateConfigurationError(msg) lines = cfile.readlines() cfile.close() @@ -751,8 +763,10 @@ class LogrotateConfigurationReader(object): if line == '{': if self.verbose > 3: - self.logger.debug( ( _("Starting a logfile definition (file '%(file)s', line %(line)s)") - % {'file': configfile, 'line': linenr})) + msg = _("Starting a logfile definition.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': configfile, 'lnr': linenr}) + self.logger.debug(msg) self._start_logfile_definition( line = line, @@ -770,10 +784,11 @@ class LogrotateConfigurationReader(object): if match or os.path.isabs(line): if in_fd: - raise LogrotateConfigurationError( - ( _("Logfile pattern definition not allowed inside a logfile definition (file '%(file)s', line %(line)s)") - % {'file': configfile, 'line': linenr}) - ) + msg = _("Logfile pattern definition not allowed inside " + + "a logfile definition.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': configfile, 'lnr': linenr}) + raise LogrotateConfigurationError(msg) do_start_logfile_definition = False # look, whether a start of a logfile definition is necessary @@ -787,17 +802,17 @@ class LogrotateConfigurationReader(object): parts = split_parts(line) if self.verbose > 3: - self.logger.debug( - ( _("Split into parts of: '%s'") % (line)) - + ":\n" + pp.pformat(parts) - ) + msg = _("Split into parts of: '%s'") % (line) + msg += ":\n" + pp.pformat(parts) + self.logger.debug(msg) for pattern in parts: if pattern == '{': - raise LogrotateConfigurationError( - ( _("Syntax error: open curly bracket inside a logfile pattern definition (file '%(file)s', line %(line)s)") - % {'file': configfile, 'line': linenr}) - ) + msg = _("Syntax error: open curly bracket inside a" + + "logfile pattern definition.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': configfile, 'lnr': linenr}) + raise LogrotateConfigurationError(msg) self.new_log['file_patterns'].append(pattern) # start of a logfile definition, if necessary @@ -818,18 +833,19 @@ class LogrotateConfigurationReader(object): match = re.search(r'^}(.*)', line) if match: if not in_fd: - raise LogrotateConfigurationError( - ( _("Syntax error: unbalanced closing curly bracket found (file '%(file)s', line %(line)s)") - % {'file': configfile, 'line': linenr}) - ) + msg = _("Syntax error: unbalanced closing curly bracket found.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") % {'file': configfile, 'lnr': linenr}) + raise LogrotateConfigurationError(msg) rest = match.group(1) if self.verbose > 2: - self.logger.debug( ( _("End of a logfile definition (file '%(file)s', line %(line)s)") % {'file': configfile, 'line': linenr})) + msg = _("End of a logfile definition.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") % {'file': configfile, 'lnr': linenr}) + self.logger.debug(msg) if rest: - self.logger.warning( - ( _("Needless content found at the end of a logfile definition found: '%(rest)s' (file '%(file)s', line %(line)s)") - % { 'rest': str(rest), 'file': configfile, 'line': linenr}) - ) + msg = _("Needless content found at the end of a logfile definition found: '%s'.") \ + (str(rest)) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") % {'file': configfile, 'lnr': linenr}) + self.logger.warning(msg) # set a compress ext, if Compress is True if self.new_log['compress']: if not self.new_log['compressext']: @@ -876,10 +892,11 @@ class LogrotateConfigurationReader(object): if match: rest = match.group(1) if in_fd or in_logfile_list: - self.logger.warning( - ( _("Syntax error: include may not appear inside of log file definition (file '%(file)s', line %(line)s)") - % {'file': configfile, 'line': linenr}) - ) + msg = _("Syntax error: include may not appear inside of " + + "log file definition.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': configfile, 'lnr': linenr}) + self.logger.warning(msg) continue self._do_include(line, rest, configfile, linenr) continue @@ -895,10 +912,11 @@ class LogrotateConfigurationReader(object): if values[0]: script_name = values[0] if self.verbose > 3: - self.logger.debug( - ( _("Found start of a regular script definition: type: '%(type)s', name: '%(name)s' (file '%(file)s', line %(line)s)") - % {'type': script_type, 'name': script_name, 'file': configfile, 'line': linenr}) - ) + msg = _("Found start of a regular script definition: " + + "type: '%(type)s', name: '%(name)s'.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': configfile, 'lnr': linenr}) + self.logger.debug(msg) newscript = self._start_log_script_definition( script_type = script_type, script_name = script_name, @@ -910,22 +928,25 @@ class LogrotateConfigurationReader(object): if newscript: in_script = True if self.verbose > 3: - self.logger.debug( ( _("New log script name: '%s'.") % (newscript) )) + msg = _("New log script name: '%s'.") % (newscript) + self.logger.debug(msg) continue # start of an explicite external script definition match = re.search(r'^script(\s+.*)?$', line, re.IGNORECASE) if match: if self.verbose > 3: - self.logger.debug( ( _("Found start of a external script definition. (file '%(file)s', line %(line)s)") - % {'file': configfile, 'line': linenr}) - ) + msg = _("Found start of a external script definition.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': configfile, 'lnr': linenr}) + self.logger.debug(msg) rest = match.group(1) if in_fd or in_logfile_list: - self.logger.warning( - ( _("Syntax error: external script definition may not appear inside of a log file definition (file '%(file)s', line %(line)s)") - % {'file': configfile, 'line': linenr}) - ) + msg = _("Syntax error: external script definition may " + + "not appear inside of a log file definition.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': configfile, 'lnr': linenr}) + self.logger.warning(msg) continue newscript = self._ext_script_definition( line, rest, configfile, linenr @@ -933,14 +954,15 @@ class LogrotateConfigurationReader(object): if newscript: in_script = True if self.verbose > 3: - self.logger.debug( ( _("New external script name: '%s'.") % (newscript) )) + msg = _("New external script name: '%s'.") % (newscript) + self.logger.debug(msg) continue # all other options if not self._option(line, in_fd, configfile, linenr): - self.logger.warning( ( _("Syntax error in file '%(file)s', line %(line)s") - % {'file': configfile, 'line': linenr}) - ) + msg = _("Syntax error in file '%(file)s', line %(line)s") \ + % {'file': configfile, 'line': linenr} + self.logger.warning(msg) return True @@ -966,10 +988,9 @@ class LogrotateConfigurationReader(object): _ = self.t.lgettext if self.verbose > 4: - self.logger.debug( - ( _("Checking line '%(line)s' for a logrotate option. (file '%(file)s', line %(lnr)s)") - % {'line': line, 'file': filename, 'lnr': linenr}) - ) + msg = _("Checking line '%s' for a logrotate option.") % (line) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) # where to insert the option? directive = self.default @@ -986,7 +1007,8 @@ class LogrotateConfigurationReader(object): option = match.group(1).lower() val = match.group(2) else: - self.logger.warning( ( _("Could not detect option in line '%s'.") % (line))) + msg = _("Could not detect option in line '%s'.") % (line) + self.logger.warning(msg) return False val = re.sub(r'^\s+$', '', val) if self.verbose > 4: @@ -998,10 +1020,10 @@ class LogrotateConfigurationReader(object): pattern = r'^(' + '|'.join(unsupported_options) + r')$' match = re.search(pattern, option, re.IGNORECASE) if match: - self.logger.info( - ( _("Unsupported option '%(option)s'. (file '%(file)s', line %(lnr)s)") - % {'option': match.group(1).lower(), 'file': filename, 'lnr': linenr}) - ) + msg = _("Unsupported option '%s'.") % (match.group(1).lower()) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.info(msg) return True # Check for boolean option @@ -1011,40 +1033,55 @@ class LogrotateConfigurationReader(object): negated = match.group(1) key = match.group(2).lower() if val: - self.logger.warning( - ( _("Found value '%(value)s' behind the boolean option '%(option)s', ignoring. (file '%(file)s', line %(lnr)s)") - % {'value': val, 'option': option, 'file': filename, 'lnr': linenr}) - ) + msg = _("Found value '%(value)s' behind the boolean option " + + "'%(option)s', ignoring.") \ + % {'value': val, 'option': option} + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.warning(msg) if negated is None: option_value = True else: option_value = False if self.verbose > 4: - self.logger.debug( - ( _("Setting boolean option '%(option)s' in '%(directive)s' to '%(value)s'. (file '%(file)s', line %(lnr)s)") - % {'option': key, 'directive': directive_str, 'value': str(option_value), 'file': filename, 'lnr': linenr}) - ) + msg = _("Setting boolean option '%(option)s' in " + + "'%(directive)s' to '%(value)s'.") \ + % {'option': key, + 'directive': directive_str, + 'value': str(option_value) + } + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) directive[key] = option_value if key == 'copy' and option_value: if directive['copytruncate']: - msg = _("Option 'copy' disables option 'copytruncate'. (file '%(file)s', line %(lnr)s)") \ - % {'file': filename, 'lnr': linenr} + msg = _("Option '%(by)s' disables option '%(what)'.") \ + % {'by': 'copy', 'what': 'copytruncate'} + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) self.logger.warning(msg) directive['copytruncate'] = False if directive['create']['enabled']: - msg = _("Option 'copy' disables option 'create'. (file '%(file)s', line %(lnr)s)") \ - % {'file': filename, 'lnr': linenr} + msg = _("Option '%(by)s' disables option '%(what)'.") \ + % {'by': 'copy', 'what': 'create'} + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) self.logger.warning(msg) directive['create']['enabled'] = False elif key == 'copytruncate' and option_value: if directive['copy']: - msg = _("Option 'copytruncate' disables option 'copy'. (file '%(file)s', line %(lnr)s)") \ - % {'file': filename, 'lnr': linenr} + msg = _("Option '%(by)s' disables option '%(what)'.") \ + % {'by': 'copytruncate', 'what': 'copy'} + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) self.logger.warning(msg) directive['copy'] = False if directive['create']['enabled']: - msg = _("Option 'copytruncate' disables option 'create'. (file '%(file)s', line %(lnr)s)") \ - % {'file': filename, 'lnr': linenr} + msg = _("Option '%(by)s' disables option '%(what)'.") \ + % {'by': 'copytruncate', 'what': 'create'} + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) self.logger.warning(msg) directive['create']['enabled'] = False return True @@ -1059,7 +1096,8 @@ class LogrotateConfigurationReader(object): if negated is None: if key in options_with_values: if val is None or val == '': - self.logger.warning( ( _("Option '%s' without a necessary value.") % (key))) + msg = _("Option '%s' must have a value.") % (key) + self.logger.warning(msg) return False else: if val is None or val == '': @@ -1067,22 +1105,27 @@ class LogrotateConfigurationReader(object): try: option_value = long(val) except ValueError, e: - self.logger.warning( - ( _("Option '%(option)s' has no integer value: %(msg)s.") - % {'option': key, 'msg': str(e)}) - ) + msg = _("Option '%(option)s' has no " + + "integer value: %(msg)s.") \ + % {'option': key, 'msg': str(e)} + self.logger.warning(msg) return False if option_value < 0: - self.logger.warning( - ( _("Negative value %(value)s for option '%(option)s' is not allowed.") - % {'value': str(option_value), 'option': key}) - ) + msg = _("Negative value %(value)s for option '%(option)s' " + + "is not allowed.") \ + % {'value': str(option_value), 'option': key} + self.logger.warning(msg) return False if self.verbose > 4: - self.logger.debug( - ( _("Setting integer option '%(option)s' in '%(directive)s' to '%(value)s'. (file '%(file)s', line %(lnr)s)") - % {'option': key, 'directive': directive_str, 'value': str(option_value), 'file': filename, 'lnr': linenr}) - ) + msg = _("Setting integer option '%(option)s' in '%(directive)s' " + + "to '%(value)s'.") \ + % { 'option': key, + 'directive': directive_str, + 'value': str(option_value) + } + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) directive[key] = option_value return True @@ -1106,13 +1149,14 @@ class LogrotateConfigurationReader(object): directive['mailaddress'] = None if self.verbose > 4: pp = pprint.PrettyPrinter(indent=4) - msg = _("Setting mail address in '%(directive)s' to '%(addr)s'. (file '%(file)s', line %(lnr)s)") \ + msg = _("Setting mail address in '%(directive)s' to " + + "'%(addr)s'.") \ % { 'directive': directive_str, 'addr': pp.pformat(directive['mailaddress']), - 'file': filename, - 'lnr': linenr, - } + } + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) self.logger.debug(msg) return True @@ -1125,15 +1169,19 @@ class LogrotateConfigurationReader(object): option_value = True directive['mailfirst'] = option_value if self.verbose > 4: - self.logger.debug( - ( _("Setting mailfirst in '%(directive)s' to '%(value)s'. (file '%(file)s', line %(lnr)s)") - % {'directive': directive_str, 'value': str(option_value), 'file': filename, 'lnr': linenr}) - ) + msg = _("Setting mailfirst in '%(directive)s' " + + "to '%(value)s'.") \ + % { 'directive': directive_str, + 'value': str(option_value) + } + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) if val is not None and val != '': - self.logger.warning( - ( _("Senseless option value '%(value)s' after '%(option)s'.") - % {'value': val, 'option': option.lower()}) - ) + msg = _("Senseless option value '%(value)s' after " + + "'%(option)s'.") \ + % {'value': val, 'option': option.lower()} + self.logger.warning(msg) return False return True @@ -1144,14 +1192,17 @@ class LogrotateConfigurationReader(object): key = match.group(1).lower() if key in options_with_values: if self.verbose > 5: - self.logger.debug( ( _("Option '%s' must have a value.") %(key))) + msg = _("Option '%s' must have a value.") % (key) + self.logger.debug(msg) if (val is None) or (val == ''): - self.logger.warning( ( _("Option '%s' without a value") %(key))) + msg = _("Option '%s' without a value.") % (key) + self.logger.debug(msg) return False if key == 'compresscmd': prog = self.check_compress_command(val) if prog is None: - self.logger.warning( ( _("Compress command '%s' not found.") %(val))) + msg = _("Compress command '%s' not found.") % (val) + self.logger.warning(msg) return False val = prog if key == 'compressoptions' and val is None: @@ -1171,7 +1222,7 @@ class LogrotateConfigurationReader(object): if self.verbose > 5: self.logger.debug( ( _("Option '%s' must have a value.") %(key))) if (val is None) or (re.search(r'^\s*$', val) is not None): - self.logger.warning( ( _("Option '%s' without a value") %(key))) + self.logger.warning( ( _("Option '%s' without a value.") %(key))) return False if key in path_options: if not os.path.abspath(val): @@ -1211,10 +1262,10 @@ class LogrotateConfigurationReader(object): use_tls = bool(val) val = use_tls if self.verbose > 4: - self.logger.debug( - ( _("Setting global option '%(option)s' to '%(value)s'. (file '%(file)s', line %(lnr)s)") - % {'option': key, 'directive': directive_str, 'value': str(val), 'file': filename, 'lnr': linenr}) - ) + msg = _("Setting global option '%(option)s' to '%(value)s'.") \ + % {'option': key, 'directive': directive_str} + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) self.global_option[key] = val return True @@ -1224,29 +1275,34 @@ class LogrotateConfigurationReader(object): if match: key = match.group(1).lower() if self.verbose > 4: - self.logger.debug( - ( _("Checking 'period': key '%(key)s', value '%(value)s'. (file '%(file)s', line %(lnr)s)") - % {'key': key, 'value': str(val), 'file': filename, 'lnr': linenr}) - ) + msg = _("Checking for option 'period': key '%(key)s', value '%(value)s'.") \ + % {'key': key, 'value': val} + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) option_value = 1 if key in valid_periods: if (val is not None) and (re.search(r'^\s*$', val) is None): - self.logger.warning( - ( _("Option '%(option)s' may not have a value ('%(value)s'). (file '%(file)s', line %(lnr)s)") - % {'option': key, 'value': val, 'file': filename, 'lnr': linenr}) - ) + msg = _("Option '%(option)s' may not have a value ('%(value)s').") \ + % {'option': key, 'value': val} + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") % {'file': filename, 'lnr': linenr}) + self.logger.warning(msg) option_value = valid_periods[key] else: try: option_value = period2days(val, verbose = self.verbose) except ValueError, e: - self.logger.warning( ( _("Invalid period definition: '%s'") %(val) )) + msg = _("Invalid period definition: '%s'.") % (val) + self.logger.warning(msg) return False if self.verbose > 4: - self.logger.debug( - ( _("Setting 'period' in '%(directive)s' to %(days)f days. (file '%(file)s', line %(lnr)s)") - % {'directive': directive_str, 'days': option_value, 'file': filename, 'lnr': linenr}) - ) + msg = _("Setting '%(what)s' in '%(directive)s' to %(to)f days.") \ + % { 'what': 'period', + 'directive': directive_str, + 'to': option_value, + } + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) directive['period'] = option_value return True @@ -1263,13 +1319,18 @@ class LogrotateConfigurationReader(object): try: option_value = period2days(val, verbose = self.verbose) except ValueError, e: - self.logger.warning( ( _("Invalid maxage definition: '%s'") %(val) )) + msg = _("Invalid maxage definition: '%s'") % (val) + self.logger.warning(msg) return False if self.verbose > 4: - self.logger.debug( - ( _("Setting 'maxage' in '%(directive)s' to %(days)f days. (file '%(file)s', line %(lnr)s)") - % {'directive': directive_str, 'days': option_value, 'file': filename, 'lnr': linenr}) - ) + msg = _("Setting '%(what)s' in '%(directive)s' to %(to)f days.") \ + % { 'what': 'maxage', + 'directive': directive_str, + 'to': option_value, + } + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) directive['maxage'] = option_value return True @@ -1284,10 +1345,9 @@ class LogrotateConfigurationReader(object): dateext = None if self.verbose > 4: - self.logger.debug( - ( _("Checking 'dateext', negated: '%(negated)s'. (file '%(file)s', line %(lnr)s)") - % {'negated': str(negated), 'file': filename, 'lnr': linenr}) - ) + msg = _("Checking for option 'dateext', negated: '%s'.") % (str(negated)) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) values = [] if val is not None: values = split_parts(val) @@ -1301,10 +1361,11 @@ class LogrotateConfigurationReader(object): re.search(r'^\s*$', first_val) is not None: option_value = 'true' if self.verbose > 5: - self.logger.debug( - ( _("'dateext': first_val: '%(first_val)s', option_value: '%(value)s'. (file '%(file)s', line %(lnr)s)") - % {'first_val': first_val, 'value': option_value, 'file': filename, 'lnr': linenr}) - ) + msg = _("'dateext': first_val: '%(first_val)s', option_value: '%(value)s'.") \ + % {'first_val': first_val, 'value': option_value} + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) if option_value in yes_values: use_dateext = True elif option_value in no_values: @@ -1314,18 +1375,26 @@ class LogrotateConfigurationReader(object): dateext = val if self.verbose > 4: - self.logger.debug( - ( _("Setting 'dateext' in '%(directive)s' to %(ext)s. (file '%(file)s', line %(lnr)s)") - % {'directive': directive_str, 'ext': str(use_dateext), 'file': filename, 'lnr': linenr}) - ) + msg = _("Setting '%(what)s' in '%(directive)s' to %(to)s.") \ + % { 'what': 'dateeext', + 'directive': directive_str, + 'to': str(use_dateext) + } + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) directive['dateext'] = use_dateext if dateext is not None: if self.verbose > 4: - self.logger.debug( - ( _("Setting 'datepattern' in '%(directive)s' to '%(pattern)s'. (file '%(file)s', line %(lnr)s)") - % {'directive': directive_str, 'pattern': dateext, 'file': filename, 'lnr': linenr}) - ) + msg = _("Setting '%(what)s' in '%(directive)s' to %(to)s.") \ + % { 'what': 'datepattern', + 'directive': directive_str, + 'to': dateext + } + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) directive['datepattern'] = dateext return True @@ -1339,30 +1408,34 @@ class LogrotateConfigurationReader(object): negated = True if self.verbose > 5: - self.logger.debug( - ( _("Checking for 'create' ... (file '%(file)s', line %(lnr)s)") - % {'file': filename, 'lnr': linenr}) - ) + msg = _("Checking for option '%s' ...") % ('create') + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) if negated: if self.verbose > 4: - self.logger.debug( - ( _("Removing 'create'. (file '%(file)s', line %(lnr)s)") - % {'file': filename, 'lnr': linenr}) - ) + msg = _("Removing '%s'.") % ('create') + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) directive['create']['enabled'] = False return True if directive['copy']: - msg = _("Option 'copy' was set, so option 'create' has no effect. (file '%(file)s', line %(lnr)s)") \ - % {'file': filename, 'lnr': linenr} + msg = _("Option '%s' was set, so option 'create' " + + "has no effect.") % ('copy') + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) self.logger.warning(msg) directive['create']['enabled'] = False return True if directive['copytruncate']: - msg = _("Option 'copytruncate' was set, so option 'create' has no effect. (file '%(file)s', line %(lnr)s)") \ - % {'file': filename, 'lnr': linenr} + msg = _("Option '%s' was set, so option 'create' " + + "has no effect.") % ('copytruncate') + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) self.logger.warning(msg) directive['create']['enabled'] = False return True @@ -1407,7 +1480,9 @@ class LogrotateConfigurationReader(object): try: owner = pwd.getpwnam(owner_raw)[2] except KeyError: - self.logger.warning( ( _("Invalid owner '%s' in 'create'.") %(owner_raw))) + msg = _("Invalid owner '%(owner)s' in '%(what)s'.") \ + % {'owner': owner_raw, 'what': 'create'} + self.logger.warning(msg) return False # Check for Group (gid) @@ -1424,7 +1499,9 @@ class LogrotateConfigurationReader(object): try: group = grp.getgrnam(group_raw)[2] except KeyError: - self.logger.warning( ( _("Invalid group '%s' in 'create'.") %(group_raw))) + msg = _("Invalid group '%(group)s' in '%(what)s'.") \ + % {'group': group_raw, 'what': 'create'} + self.logger.warning(msg) return False # Give values back ... @@ -1442,17 +1519,17 @@ class LogrotateConfigurationReader(object): negated = True if self.verbose > 5: - self.logger.debug( - ( _("Checking for 'olddir' ... (file '%(file)s', line %(lnr)s)") - % {'file': filename, 'lnr': linenr}) - ) + msg = _("Checking for option '%s' ...") % ('olddir') + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) if negated: if self.verbose > 4: - self.logger.debug( - ( _("Removing 'olddir'. (file '%(file)s', line %(lnr)s)") - % {'file': filename, 'lnr': linenr}) - ) + msg = _("Removing '%s'.") % ('olddir') + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) directive['olddir']['enabled'] = False return True @@ -1462,7 +1539,8 @@ class LogrotateConfigurationReader(object): # Check for dirname of olddir if len(values) < 1 or values[0] is None or re.search(r'^\s*$', values[0]) is not None: - self.logger.warning( ( _("Option 'olddir' without a value given."))) + msg = _("Option '%s' without a value given.") % ('olddir') + self.logger.warning(msg) return False directive['olddir']['dirname'] = values[0] directive['olddir']['enabled'] = True @@ -1501,24 +1579,27 @@ class LogrotateConfigurationReader(object): try: owner = pwd.getpwnam(owner_raw)[2] except KeyError: - self.logger.warning( ( _("Invalid owner '%s' in 'olddir'.") %(owner_raw))) + msg = _("Invalid owner '%(owner)s' in '%(what)s'.") \ + % {'owner': owner_raw, 'what': 'olddir'} + self.logger.warning(msg) return False # Check for Group (gid) if len(values) > 3: group_raw = values[3] if self.verbose > 5: - self.logger.debug( - ( _("Trying to determine olddir group '%(group)s' ... (file '%(file)s', line %(lnr)s)") - % {'group': group_raw, 'file': filename, 'lnr': linenr}) - ) + msg = _("Trying to determine olddir group '%s' ...") % (group_raw) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) if re.search(r'^[1-9]\d*$', group_raw) is not None: group = int(group_raw) else: try: group = grp.getgrnam(group_raw)[2] except KeyError: - self.logger.warning( ( _("Invalid group '%s' in 'olddir'.") %(group_raw))) + msg = _("Invalid group '%(group)s' in '%(what)s'.") \ + % {'group': group_raw, 'what': 'olddir'} + self.logger.warning(msg) return False # Give values back ... @@ -1532,10 +1613,10 @@ class LogrotateConfigurationReader(object): if match: size_str = re.sub(r'^size(?:\s*=\s*|\s+)', '', line) if self.verbose > 5: - self.logger.debug( - ( _("Checking for option 'size', value: '%(value)s' ... (file '%(file)s', line %(lnr)s)") - % {'value': size_str, 'file': filename, 'lnr': linenr}) - ) + msg = _("Checking for option 'size', value '%s' ...") % (size_str) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) if size_str is None: self.logger.warning( _("Failing size definition.")) return False @@ -1546,10 +1627,11 @@ class LogrotateConfigurationReader(object): self.logger.warning( ( _("Invalid definition for 'size': '%s'.") %(size_str))) return False if self.verbose > 4: - self.logger.debug( - ( _("Got a rotation size in '%(directive)s' of %(bytes)d bytes. (file '%(file)s', line %(lnr)s)") - % {'directive': directive_str, 'bytes': size_bytes, 'file': filename, 'lnr': linenr}) - ) + msg = _("Got a rotation size in '%(directive)s' of %(bytes)d bytes.") \ + % {'directive': directive_str, 'bytes': size_bytes} + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) directive['size'] = size_bytes return True @@ -1559,10 +1641,11 @@ class LogrotateConfigurationReader(object): if match: key = match.group(1).lower() if self.verbose > 5: - self.logger.debug( - ( _("Checking for option 'taboo%(type)s', value: '%(value)s' ... (file '%(file)s', line %(lnr)s)") - % {'type': key, 'value': val, 'file': filename, 'lnr': linenr}) - ) + msg = _("Checking for option 'taboo%(type)s', value: '%(value)s' ...") \ + % {'type': key, 'value': val} + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.debug(msg) if in_fd: self.logger.warning( ( _("Option 'taboo%s' not allowed inside a logfile directive.") %(key))) @@ -1618,26 +1701,28 @@ class LogrotateConfigurationReader(object): # insufficient arguments to include ... if len(values) < 1: - self.logger.warning( - ( _("No script name given in a script directive. (file '%(file)s', line %(lnr)s)") - % {'file': filename, 'lnr': linenr}) - ) + msg = _("No script name given in a script directive.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.warning(msg) return None # to much arguments to include ... if len(values) > 1: - self.logger.warning( - ( _("Only one script name is allowed in a script directive, the first one is used. (file '%(file)s', line %(lnr)s)") - % {'file': filename, 'lnr': linenr}) - ) + msg = _("Only one script name is allowed in a script directive, " + + "the first one is used.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.warning(msg) script_name = values[0] if script_name in self.scripts: - self.logger.warning( - ( _("Script name '%(name)s' is allready declared, it will be overwritten. (file '%(file)s', line %(lnr)s)") - % {'name': script_name, 'file': filename, 'lnr': linenr}) - ) + msg = _("Script name '%s' is allready declared, it will " + + "be overwritten.") % (script_name) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.warning(msg) self.scripts[script_name] = LogRotateScript( name = script_name, @@ -1645,13 +1730,6 @@ class LogrotateConfigurationReader(object): verbose = self.verbose, test_mode = self.test_mode, ) - #self.scripts[script_name]['cmd'] = [] - #self.scripts[script_name]['post_files'] = 0 - #self.scripts[script_name]['last_files'] = 0 - #self.scripts[script_name]['first'] = False - #self.scripts[script_name]['prerun'] = False - #self.scripts[script_name]['donepost'] = False - #self.scripts[script_name]['donelast'] = False return script_name @@ -1681,81 +1759,88 @@ class LogrotateConfigurationReader(object): # insufficient arguments to include ... if len(values) < 1: - self.logger.warning( - ( _("No file or directory given in a include directive (file '%(file)s', line %(lnr)s)") - % {'file': filename, 'lnr': linenr}) - ) + msg = _("No file or directory given in a include directive.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.warning(msg) return False # to much arguments to include ... if len(values) > 1: - self.logger.warning( - ( _("Only one declaration of a file or directory is allowed in a include directive, the first one is used. (file '%(file)s', line %(lnr)s)") - % {'file': filename, 'lnr': linenr}) - ) + msg = _("Only one declaration of a file or directory is allowed " + + "in a include directive, the first one is used.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.warning(msg) include = values[0] # including object doesn't exists if not os.path.exists(include): - self.logger.warning( - ( _("Including object '%(include)s' doesn't exists. (file '%(file)s', line %(lnr)s)") - % {'include': include, 'file': filename, 'lnr': linenr}) - ) + msg = _("Including object '%s' doesn't exists.") % (include) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.warning(msg) return False include = os.path.abspath(include) # including object is neither a regular file nor a directory if not (os.path.isfile(include) or os.path.isdir(include)): - self.logger.warning( - ( _("Including object '%(include)s' is neither a regular file nor a directory. (file '%(file)s', line %(lnr)s)") - % {'include': include, 'file': filename, 'lnr': linenr}) - ) + msg = _("Including object '%s' is neither a regular " + + "file nor a directory.") % (include) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.warning(msg) return False if self.verbose > 1: - self.logger.debug( ( _("Trying to include object '%s' ...") % (include) )) + msg = _("Trying to include object '%s' ...") % (include) + self.logger.debug(msg) # including object is a regular file if os.path.isfile(include): if include in self.config_files: - self.logger.warning( - ( _("Recursive including of '%(include)s'. (file '%(file)s', line %(lnr)s)") - % {'include': include, 'file': filename, 'lnr': linenr}) - ) + msg = _("Recursive including of '%s'.") % (include) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.warning(msg) return False return self._read(include) # This should never happen ... if not os.path.isdir(include): - raise Exception( - ( _("What the hell is this: '%(include)s'. (file '%(file)s', line %(lnr)s)") - % {'include': include, 'file': filename, 'lnr': linenr}) - ) + msg = _("What the hell is this: '%s'.") % (include) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + raise Exception(msg) # including object is a directory - include all files if self.verbose > 1: - self.logger.debug( ( _("Including directory '%s' ...") % (include) )) + msg = _("Including directory '%s' ...") % (include) + self.logger.debug(msg) dir_list = os.listdir(include) for item in sorted(dir_list, key=str.lower): item_path = os.path.abspath(os.path.join(include, item)) if self.verbose > 2: - self.logger.debug( ( _( "Including item '%(item)s' ('%(path)s') ..." ) - % {'item': item, 'path': item_path} ) - ) + msg = _("Including item '%(item)s' ('%(path)s') ...") \ + % {'item': item, 'path': item_path} + self.logger.debug(msg) # Skip directories if os.path.isdir(item_path): if self.verbose > 1: - self.logger.debug( ( _("Skip subdirectory '%s' in including.") % (item_path))) + msg = _("Skip subdirectory '%s' in including.") \ + % (item_path) + self.logger.debug(msg) continue # Skip non regular files if not os.path.isfile(item_path): - self.logger.debug( ( _("Item '%s' is not a regular file.") % (item_path))) + msg = _("Item '%s' is not a regular file.") % (item_path) + self.logger.debug(msg) continue # Check for taboo pattern @@ -1764,10 +1849,10 @@ class LogrotateConfigurationReader(object): match = re.search(pattern, item) if match: if self.verbose > 1: - self.logger.debug( - ( _("Item '%(item)s' is matching pattern '%(pattern)s', skiping.") - % {'item': item, 'pattern': pattern}) - ) + msg = _("Item '%(item)s' is matching pattern " + + "'%(pattern)s', skiping.") \ + % {'item': item, 'pattern': pattern} + self.logger.debug(msg) taboo_found = True break if taboo_found: @@ -1775,10 +1860,10 @@ class LogrotateConfigurationReader(object): # Check, whther it was former included if item_path in self.config_files: - self.logger.warning( - ( _("Recursive including of '%(include)s' (file '%(file)s', line %(lnr)s)") - % {'include': item_path, 'file': filename, 'lnr': linenr}) - ) + msg = _("Recursive including of '%s'.") % (item_path) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + self.logger.warning(msg) return False self._read(item_path) @@ -1808,16 +1893,17 @@ class LogrotateConfigurationReader(object): _ = self.t.lgettext if in_fd: - raise LogrotateConfigurationError( - ( _("Nested logfile definitions are not allowed. (file '%(file)s', line %(lnr)s)") - % {'file': filename, 'lnr': linenr}) - ) + msg = _("Nested logfile definitions are not allowed.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + raise LogrotateConfigurationError(msg) if not in_logfile_list: - raise LogrotateConfigurationError( - ( _("No logfile pattern defined on starting a logfile definition. (file '%(file)s', line %(lnr)s)") - % {'file': filename, 'lnr': linenr}) - ) + msg = _("No logfile pattern defined on starting a " + + "logfile definition.") + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + raise LogrotateConfigurationError(msg) #------------------------------------------------------------ def _start_log_script_definition( self, script_type, script_name, line, filename, in_fd, linenr): @@ -1847,10 +1933,11 @@ class LogrotateConfigurationReader(object): _ = self.t.lgettext if not in_fd: - raise LogrotateConfigurationError( - ( _("Directive '%(directive)s' is not allowed outside of a logfile definition. (file '%(file)s', line %(lnr)s)") - % {'directive': script_type, 'file': filename, 'lnr': linenr}) - ) + msg = _("Directive '%s' is not allowed outside of a logfile " + + "definition.") % (script_type) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': filename, 'lnr': linenr}) + raise LogrotateConfigurationError(msg) if script_name: self.new_log[script_type] = script_name @@ -1864,14 +1951,6 @@ class LogrotateConfigurationReader(object): verbose = self.verbose, test_mode = self.test_mode, ) - #self.scripts[new_script_name] = {} - #self.scripts[new_script_name]['cmd'] = [] - #self.scripts[new_script_name]['post_files'] = 0 - #self.scripts[new_script_name]['last_files'] = 0 - #self.scripts[new_script_name]['first'] = False - #self.scripts[new_script_name]['prerun'] = False - #self.scripts[new_script_name]['donepost'] = False - #self.scripts[new_script_name]['donelast'] = False self.new_log[script_type] = new_script_name @@ -1927,7 +2006,8 @@ class LogrotateConfigurationReader(object): _ = self.t.lgettext if self.verbose > 3: - self.logger.debug( _("Starting a new log directive with default values.")) + msg = _("Starting a new log directive with default values.") + self.logger.debug(msg) self.new_log = {} @@ -1996,7 +2076,8 @@ class LogrotateConfigurationReader(object): for pattern in self.new_log['file_patterns']: if self.verbose > 1: - msg = _("Find all logfiles for shell matching pattern '%s' ...") \ + msg = _("Find all logfiles for shell matching " + + "pattern '%s' ...") \ % (pattern) self.logger.debug(msg) logfiles = glob.glob(pattern) @@ -2009,13 +2090,15 @@ class LogrotateConfigurationReader(object): continue for logfile in logfiles: if self.verbose > 1: - msg = _("Found logfile '%(file)s for pattern '%(pattern)s'.") \ + msg = _("Found logfile '%(file)s for pattern " + + "'%(pattern)s'.") \ % {'file': logfile, 'pattern': pattern } self.logger.debug(msg) if logfile in self.defined_logfiles: f = self.defined_logfiles[logfile] - msg = ( _("Logfile '%(logfile)s' is even defined (file '%(cfgfile)s', " + - "row %(rownum)d) and so not taken a second time.") + msg = ( _("Logfile '%(logfile)s' is even defined " + + "(file '%(cfgfile)s', row %(rownum)d) " + + "and so not taken a second time.") % {'logfile': logfile, 'cfgfile': f['file'], 'rownum': f['rownum']} diff --git a/LogRotate/Getopts.py b/LogRotate/Getopts.py index f1a4da8..e44dc21 100755 --- a/LogRotate/Getopts.py +++ b/LogRotate/Getopts.py @@ -15,6 +15,7 @@ import re import sys +import os.path import gettext from optparse import OptionError @@ -182,7 +183,7 @@ class LogrotateOptParser(object): if self.parser.has_option('--version'): self.parser.remove_option('--version') - msg = _('set this do simulate commands') + msg = _('Set this do simulate commands') self.parser.add_option( '--simulate', '--test', @@ -193,7 +194,7 @@ class LogrotateOptParser(object): help = to_unicode_or_bust(msg), ) - msg = _('set the verbosity level') + msg = _('Set the verbosity level') self.parser.add_option( '--verbose', '-v', @@ -251,7 +252,7 @@ class LogrotateOptParser(object): help = to_unicode_or_bust(msg), ) - msg = _('Command to send mail (instead of using the Phyton email package)') + msg = _('Command to send mail (instead of using SMTP or the predefined sendmail command).') self.parser.add_option( '--mail', '-m', diff --git a/LogRotate/Handler.py b/LogRotate/Handler.py index a337d8e..9fc9204 100755 --- a/LogRotate/Handler.py +++ b/LogRotate/Handler.py @@ -339,10 +339,10 @@ class LogrotateHandler(object): self.mailer.sendmail = mail_cmd # end of init properties - self.logger.debug( _("Logrotating initialised") ) + self.logger.debug( _("Logrotating initialised.") ) if not self.read_configuration(): - self.logger.error( _('Could not read configuration') ) + self.logger.error( _('Could not read configuration.') ) sys.exit(1) if config_check: @@ -354,7 +354,7 @@ class LogrotateHandler(object): if not self._write_pidfile(): sys.exit(3) - self.logger.debug( _("Logrotating ready for work") ) + self.logger.debug( _("Logrotating ready for work.") ) # Create status file object self.state_file = LogrotateStatusFile( @@ -710,9 +710,9 @@ class LogrotateHandler(object): should_rotate = self._should_rotate(logfile, cur_desc_index) if self.verbose > 1: if should_rotate: - msg = _("logfile '%s' WILL rotated.") + msg = _("Logfile '%s' WILL rotated.") else: - msg = _("logfile '%s' will NOT rotated.") + msg = _("Logfile '%s' will NOT rotated.") self.logger.debug(msg % (logfile)) if not should_rotate: continue @@ -976,15 +976,15 @@ class LogrotateHandler(object): # Check and set permissions of new logfile if new_mode != old_mode: - msg = _("Setting permissions of '%(file)s' to %(mode)4o.") \ - % {'file': file_from, 'mode': new_mode} + msg = _("Setting permissions of '%(target)s' to %(mode)4o.") \ + % {'target': file_from, 'mode': new_mode} self.logger.info(msg) if not self.test: try: os.chmod(file_from, new_mode) except OSError, e: - msg = _("Error on chmod of '%(file)s': %(err)s") \ - % {'file': file_from, 'err': e.strerror} + msg = _("Error on chmod of '%(target)s': %(err)s") \ + % {'target': file_from, 'err': e.strerror} self.logger.warning(msg) # Check and set ownership of new logfile @@ -1594,7 +1594,7 @@ class LogrotateHandler(object): olddir = os.path.normpath(olddir) if self.verbose > 1: - msg = _("Olddir name is now '%s'") % (olddir) + msg = _("Olddir name is now '%s'.") % (olddir) self.logger.debug(msg) # Check for Existence and Consistence @@ -1624,7 +1624,7 @@ class LogrotateHandler(object): (dir_head, dir_tail) = os.path.split(dir_head) dirs.insert(0, dir_tail) if self.verbose > 2: - msg = _("Directory chain to create: '%s'") % (str(dirs)) + msg = _("Directory chain to create: '%s'.") % (str(dirs)) self.logger.debug(msg) # Create olddir recursive, if necessary @@ -1726,7 +1726,7 @@ class LogrotateHandler(object): _ = self.t.lgettext if self.verbose > 3: - msg = _("Executing command: '%s'") % (command) + msg = _("Executing command: '%s'.") % (command) self.logger.debug(msg) if not force: if self.test: @@ -1734,10 +1734,10 @@ class LogrotateHandler(object): try: retcode = subprocess.call(command, shell=True) if self.verbose > 3: - msg = _("Got returncode: '%s'") % (retcode) + msg = _("Got returncode: '%s'.") % (retcode) self.logger.debug(msg) if retcode < 0: - msg = _("Child was terminated by signal %d") % (-retcode) + msg = _("Child was terminated by signal %d.") % (-retcode) self.logger.error(msg) return False if retcode != expected_retcode: @@ -1777,7 +1777,7 @@ class LogrotateHandler(object): self.logger.debug(msg) if not os.path.exists(logfile): - msg = _("logfile '%s' doesn't exists, not rotated") % (logfile) + msg = _("Logfile '%s' doesn't exists, not rotated.") % (logfile) if not definition['missingok']: self.logger.error(msg) else: @@ -1786,19 +1786,19 @@ class LogrotateHandler(object): return False if not os.path.isfile(logfile): - msg = _("logfile '%s' is not a regular file, not rotated") % (logfile) + msg = _("Logfile '%s' is not a regular file, not rotated.") % (logfile) self.logger.warning(msg) return False filesize = os.path.getsize(logfile) if self.verbose > 2: - msg = _("Filesize of '%(file)s': %(size)d") % {'file': logfile, 'size': filesize} + msg = _("Filesize of '%(file)s': %(size)d.") % {'file': logfile, 'size': filesize} self.logger.debug(msg) if not filesize: if not definition['ifempty']: if self.verbose > 1: - msg = _("Logfile '%s' has a filesize of Zero, not rotated") % (logfile) + msg = _("Logfile '%s' has a filesize of Zero, not rotated.") % (logfile) self.logger.debug(msg) return False @@ -1814,11 +1814,11 @@ class LogrotateHandler(object): last_rotated = self.state_file.get_rotation_date(logfile) if self.verbose > 2: - msg = _("Date of last rotation: %s") %(last_rotated.isoformat(' ')) + msg = _("Date of last rotation: %s.") % (last_rotated.isoformat(' ')) self.logger.debug(msg) next_rotation = last_rotated + timedelta(days = definition['period']) if self.verbose > 2: - msg = _("Date of next rotation: %s") %(next_rotation.isoformat(' ')) + msg = _("Date of next rotation: %s.") % (next_rotation.isoformat(' ')) self.logger.debug(msg) if filesize < maxsize: @@ -2182,8 +2182,8 @@ class LogrotateHandler(object): _ = self.t.lgettext if self.verbose > 1: - msg = _("Compressing source '%(source)s' to target'%(target)s' with module zipfile.") \ - % {'source': source, 'target': target} + msg = _("Compressing source '%(source)s' to target'%(target)s' with module '%(module)s'.") \ + % {'source': source, 'target': target, 'module': 'zipfile'} self.logger.debug(msg) if not self.test: @@ -2245,8 +2245,8 @@ class LogrotateHandler(object): _ = self.t.lgettext if self.verbose > 1: - msg = _("Compressing source '%(source)s' to target'%(target)s' with module gzip.") \ - % {'source': source, 'target': target} + msg = _("Compressing source '%(source)s' to target'%(target)s' with module '%(module)s'.") \ + % {'source': source, 'target': target, 'module': 'gzip'} self.logger.debug(msg) if not self.test: @@ -2316,8 +2316,8 @@ class LogrotateHandler(object): _ = self.t.lgettext if self.verbose > 1: - msg = _("Compressing source '%(source)s' to target'%(target)s' with module bz2.") \ - % {'source': source, 'target': target} + msg = _("Compressing source '%(source)s' to target'%(target)s' with module '%(module)s'.") \ + % {'source': source, 'target': target, 'module': 'bz2'} self.logger.debug(msg) if not self.test: diff --git a/LogRotate/Script.py b/LogRotate/Script.py index 1feefb4..ac129be 100755 --- a/LogRotate/Script.py +++ b/LogRotate/Script.py @@ -496,7 +496,7 @@ class LogRotateScript(object): % {'name': self.name, 'retcode': retcode} self.logger.debug(msg) if retcode < 0: - msg = _("Child in script '%(name)s' was terminated by signal %(retcode)d") \ + msg = _("Child in script '%(name)s' was terminated by signal %(retcode)d.") \ % {'name': self.name, 'retcode': -retcode} self.logger.error(msg) return False diff --git a/LogRotate/StatusFile.py b/LogRotate/StatusFile.py index 7782bbc..883b25e 100755 --- a/LogRotate/StatusFile.py +++ b/LogRotate/StatusFile.py @@ -491,23 +491,30 @@ class LogrotateStatusFile(object): i += 1 line = line.strip() if self.verbose > 4: - msg = _("Performing status file line '%(line)s' (file: '%(file)s', row: %(row)d)") \ - % {'line': line, 'file': self.file_name, 'row': i, } + msg = _("Performing status file line '%s'.") \ + % (line) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': self.file_name, 'lnr': i}) self.logger.debug(msg) # check for file heading if i == 1: - match = re.search(r'^logrotate\s+state\s+-+\s+version\s+([23])$', line, re.IGNORECASE) + match = re.search( + r'^logrotate\s+state\s+-+\s+version\s+([23])$', + line, re.IGNORECASE + ) if match: # Correct file header self.status_version = int(match.group(1)) if self.verbose > 1: - msg = _("Idendified version of status file: %d") % (self.status_version) + msg = _("Idendified version of status file: %d") \ + % (self.status_version) self.logger.debug(msg) continue else: # Wrong header - msg = _("Incompatible version of status file '%(file)s': %(header)s") \ + msg = _("Incompatible version of status file " + + "'%(file)s': %(header)s") \ % { 'file': self.file_name, 'header': line } fd.close() raise LogrotateStatusFileError(msg) @@ -519,15 +526,18 @@ class LogrotateStatusFile(object): logfile = parts[0] rdate = parts[1] if self.verbose > 2: - msg = _("Found logfile '%(file)s' with rotation date '%(date)s'.") \ + msg = _("Found logfile '%(file)s' with rotation " + + "date '%(date)s'.") \ % { 'file': logfile, 'date': rdate } self.logger.debug(msg) if logfile and rdate: match = re.search(r'\s*(\d+)[_\-](\d+)[_\-](\d+)(?:[\s\-_]+(\d+)[_\-:](\d+)[_\-:](\d+))?', rdate) if not match: - msg = _("Could not determine date format: '%(date)s' (file: '%(file)s', row: %(row)d)") \ - % {'date': rdate, 'file': logfile, 'row': i, } + msg = _("Could not determine date format: '%s'.") \ + % (rdate) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': logfile, 'lnr': i}) self.logger.warning(msg) continue d = { @@ -547,10 +557,13 @@ class LogrotateStatusFile(object): dt = None try: - dt = datetime(d['Y'], d['m'], d['d'], d['H'], d['M'], d['S'], tzinfo = utc) + dt = datetime(d['Y'], d['m'], d['d'], + d['H'], d['M'], d['S'], + tzinfo = utc) except ValueError, e: - msg = _("Invalid date: '%(date)s' (file: '%(file)s', row: %(row)d)") \ - % {'date': rdate, 'file': logfile, 'row': i, } + msg = _("Invalid date: '%s'.") % (rdate) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': logfile, 'lnr': i}) self.logger.warning(msg) continue @@ -558,8 +571,10 @@ class LogrotateStatusFile(object): else: - msg = _("Neither a logfile nor a date found in line '%(line)s' (file: '%(file)s', row: %(row)d)") \ - % {'line': line, 'file': logfile, 'row': i, } + msg = _("Neither a logfile nor a date found in line '%s'.") \ + % (line) + msg += " " + ( _("(file '%(file)s', line %(lnr)s)") + % {'file': logfile, 'lnr': i}) self.logger.warning(msg) finally: diff --git a/po/pylogrotate.pot b/po/pylogrotate.pot index db8f0c9..dde5b91 100644 --- a/po/pylogrotate.pot +++ b/po/pylogrotate.pot @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: pylogrotate 0.6.0\n" "Report-Msgid-Bugs-To: frank@brehm-online.com\n" -"POT-Creation-Date: 2011-07-14 12:26+0200\n" +"POT-Creation-Date: 2011-07-14 19:02+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,26 +18,48 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 0.9.6\n" -#: LogRotate/Getopts.py:119 +#: LogRotate/Getopts.py:120 #, python-format msgid "%s [options] " msgstr "" -#: LogRotate/Config.py:489 LogRotate/Config.py:501 LogRotate/Config.py:511 +#: LogRotate/Config.py:491 LogRotate/Config.py:504 LogRotate/Config.py:515 #, python-format -msgid "'%s' is not a directory" +msgid "'%s' is not a directory." msgstr "" -#: LogRotate/Config.py:698 +#: LogRotate/Config.py:708 #, python-format msgid "'%s' is not a regular file." msgstr "" -#: LogRotate/Config.py:1305 +#: LogRotate/Config.py:1364 #, python-format -msgid "" -"'dateext': first_val: '%(first_val)s', option_value: '%(value)s'. (file " -"'%(file)s', line %(lnr)s)" +msgid "'dateext': first_val: '%(first_val)s', option_value: '%(value)s'." +msgstr "" + +#: LogRotate/Config.py:767 LogRotate/Config.py:789 LogRotate/Config.py:813 +#: LogRotate/Config.py:837 LogRotate/Config.py:842 LogRotate/Config.py:847 +#: LogRotate/Config.py:897 LogRotate/Config.py:917 LogRotate/Config.py:940 +#: LogRotate/Config.py:947 LogRotate/Config.py:992 LogRotate/Config.py:1024 +#: LogRotate/Config.py:1039 LogRotate/Config.py:1053 LogRotate/Config.py:1061 +#: LogRotate/Config.py:1068 LogRotate/Config.py:1076 LogRotate/Config.py:1083 +#: LogRotate/Config.py:1126 LogRotate/Config.py:1158 LogRotate/Config.py:1177 +#: LogRotate/Config.py:1267 LogRotate/Config.py:1280 LogRotate/Config.py:1287 +#: LogRotate/Config.py:1303 LogRotate/Config.py:1331 LogRotate/Config.py:1349 +#: LogRotate/Config.py:1366 LogRotate/Config.py:1383 LogRotate/Config.py:1395 +#: LogRotate/Config.py:1412 LogRotate/Config.py:1419 LogRotate/Config.py:1428 +#: LogRotate/Config.py:1437 LogRotate/Config.py:1523 LogRotate/Config.py:1530 +#: LogRotate/Config.py:1592 LogRotate/Config.py:1617 LogRotate/Config.py:1632 +#: LogRotate/Config.py:1646 LogRotate/Config.py:1705 LogRotate/Config.py:1714 +#: LogRotate/Config.py:1723 LogRotate/Config.py:1763 LogRotate/Config.py:1772 +#: LogRotate/Config.py:1781 LogRotate/Config.py:1792 LogRotate/Config.py:1805 +#: LogRotate/Config.py:1814 LogRotate/Config.py:1864 LogRotate/Config.py:1897 +#: LogRotate/Config.py:1904 LogRotate/Config.py:1938 +#: LogRotate/StatusFile.py:496 LogRotate/StatusFile.py:539 +#: LogRotate/StatusFile.py:565 LogRotate/StatusFile.py:576 +#, python-format +msgid "(file '%(file)s', line %(lnr)s)" msgstr "" #: LogRotate/StatusFile.py:467 @@ -64,54 +86,39 @@ msgstr "" msgid "Check, whether logfile '%s' should rotated." msgstr "" -#: LogRotate/Config.py:1288 -#, python-format -msgid "" -"Checking 'dateext', negated: '%(negated)s'. (file '%(file)s', line " -"%(lnr)s)" -msgstr "" - -#: LogRotate/Config.py:1228 +#: LogRotate/Handler.py:1168 #, python-format -msgid "" -"Checking 'period': key '%(key)s', value '%(value)s'. (file '%(file)s', " -"line %(lnr)s)" +msgid "Checking file '%s' for deleting ..." msgstr "" -#: LogRotate/Handler.py:1168 +#: LogRotate/Config.py:1411 LogRotate/Config.py:1522 #, python-format -msgid "Checking file '%s' for deleting ..." +msgid "Checking for option '%s' ..." msgstr "" -#: LogRotate/Config.py:1343 +#: LogRotate/Config.py:1348 #, python-format -msgid "Checking for 'create' ... (file '%(file)s', line %(lnr)s)" +msgid "Checking for option 'dateext', negated: '%s'." msgstr "" -#: LogRotate/Config.py:1446 +#: LogRotate/Config.py:1278 #, python-format -msgid "Checking for 'olddir' ... (file '%(file)s', line %(lnr)s)" +msgid "Checking for option 'period': key '%(key)s', value '%(value)s'." msgstr "" -#: LogRotate/Config.py:1536 +#: LogRotate/Config.py:1616 #, python-format -msgid "" -"Checking for option 'size', value: '%(value)s' ... (file '%(file)s', line" -" %(lnr)s)" +msgid "Checking for option 'size', value '%s' ..." msgstr "" -#: LogRotate/Config.py:1563 +#: LogRotate/Config.py:1644 #, python-format -msgid "" -"Checking for option 'taboo%(type)s', value: '%(value)s' ... (file " -"'%(file)s', line %(lnr)s)" +msgid "Checking for option 'taboo%(type)s', value: '%(value)s' ..." msgstr "" -#: LogRotate/Config.py:970 +#: LogRotate/Config.py:991 #, python-format -msgid "" -"Checking line '%(line)s' for a logrotate option. (file '%(file)s', line " -"%(lnr)s)" +msgid "Checking line '%s' for a logrotate option." msgstr "" #: LogRotate/StatusFile.py:398 @@ -129,7 +136,7 @@ msgstr "" msgid "Checking, whether the script '%s' should be executed." msgstr "" -#: LogRotate/Getopts.py:226 +#: LogRotate/Getopts.py:227 msgid "" "Checks only the given configuration file and does nothing. Conflicts with" " -f." @@ -137,23 +144,25 @@ msgstr "" #: LogRotate/Script.py:499 #, python-format -msgid "Child in script '%(name)s' was terminated by signal %(retcode)d" +msgid "Child in script '%(name)s' was terminated by signal %(retcode)d." msgstr "" #: LogRotate/Handler.py:1740 #, python-format -msgid "Child was terminated by signal %d" +msgid "Child was terminated by signal %d." msgstr "" -#: LogRotate/Getopts.py:254 -msgid "Command to send mail (instead of using the Phyton email package)" +#: LogRotate/Getopts.py:255 +msgid "" +"Command to send mail (instead of using SMTP or the predefined sendmail " +"command)." msgstr "" -#: LogRotate/Getopts.py:266 +#: LogRotate/Getopts.py:267 msgid "Common options" msgstr "" -#: LogRotate/Config.py:1154 +#: LogRotate/Config.py:1204 #, python-format msgid "Compress command '%s' not found." msgstr "" @@ -175,19 +184,12 @@ msgid "" "'%(cmd)s'." msgstr "" +#: LogRotate/Handler.py:2185 LogRotate/Handler.py:2248 #: LogRotate/Handler.py:2319 #, python-format -msgid "Compressing source '%(source)s' to target'%(target)s' with module bz2." -msgstr "" - -#: LogRotate/Handler.py:2248 -#, python-format -msgid "Compressing source '%(source)s' to target'%(target)s' with module gzip." -msgstr "" - -#: LogRotate/Handler.py:2185 -#, python-format -msgid "Compressing source '%(source)s' to target'%(target)s' with module zipfile." +msgid "" +"Compressing source '%(source)s' to target'%(target)s' with module " +"'%(module)s'." msgstr "" #: LogRotate/Handler.py:1881 @@ -228,7 +230,7 @@ msgid "" "'%(target)s'." msgstr "" -#: LogRotate/Config.py:989 +#: LogRotate/Config.py:1010 #, python-format msgid "Could not detect option in line '%s'." msgstr "" @@ -238,11 +240,9 @@ msgstr "" msgid "Could not determine bytes in '%s'." msgstr "" -#: LogRotate/StatusFile.py:529 +#: LogRotate/StatusFile.py:537 #, python-format -msgid "" -"Could not determine date format: '%(date)s' (file: '%(file)s', row: " -"%(row)d)" +msgid "Could not determine date format: '%s'." msgstr "" #: LogRotate/StatusFile.py:319 @@ -250,15 +250,15 @@ msgstr "" msgid "Could not open status file '%s' for write: " msgstr "" -#: LogRotate/Handler.py:345 -msgid "Could not read configuration" -msgstr "" - -#: LogRotate/Config.py:708 +#: LogRotate/Config.py:718 #, python-format msgid "Could not read configuration file '%s'" msgstr "" +#: LogRotate/Handler.py:345 +msgid "Could not read configuration." +msgstr "" + #: LogRotate/StatusFile.py:483 #, python-format msgid "Could not read status file '%s': " @@ -306,7 +306,7 @@ msgstr "" #: LogRotate/Handler.py:1817 #, python-format -msgid "Date of last rotation: %s" +msgid "Date of last rotation: %s." msgstr "" #: LogRotate/Handler.py:1834 @@ -316,7 +316,7 @@ msgstr "" #: LogRotate/Handler.py:1821 #, python-format -msgid "Date of next rotation: %s" +msgid "Date of next rotation: %s." msgstr "" #: LogRotate/Handler.py:1179 @@ -344,11 +344,9 @@ msgstr "" msgid "Deletion of all superfluid logfiles ..." msgstr "" -#: LogRotate/Config.py:1851 +#: LogRotate/Config.py:1936 #, python-format -msgid "" -"Directive '%(directive)s' is not allowed outside of a logfile definition." -" (file '%(file)s', line %(lnr)s)" +msgid "Directive '%s' is not allowed outside of a logfile definition." msgstr "" #: LogRotate/Handler.py:1650 @@ -368,10 +366,10 @@ msgstr "" #: LogRotate/Handler.py:1627 #, python-format -msgid "Directory chain to create: '%s'" +msgid "Directory chain to create: '%s'." msgstr "" -#: LogRotate/Getopts.py:279 +#: LogRotate/Getopts.py:280 msgid "Display brief usage message and exit." msgstr "" @@ -380,21 +378,15 @@ msgstr "" msgid "Do rotate logfile '%s' ..." msgstr "" -#: LogRotate/Getopts.py:206 +#: LogRotate/Getopts.py:207 msgid "Don't do anything, just test (implies -v and -T)" msgstr "" -#: LogRotate/Config.py:827 -#, python-format -msgid "End of a logfile definition (file '%(file)s', line %(line)s)" -msgstr "" - -#: LogRotate/Handler.py:986 -#, python-format -msgid "Error on chmod of '%(file)s': %(err)s" +#: LogRotate/Config.py:841 +msgid "End of a logfile definition." msgstr "" -#: LogRotate/Handler.py:2130 +#: LogRotate/Handler.py:986 LogRotate/Handler.py:2130 #, python-format msgid "Error on chmod of '%(target)s': %(err)s" msgstr "" @@ -468,7 +460,7 @@ msgstr "" #: LogRotate/Handler.py:1729 #, python-format -msgid "Executing command: '%s'" +msgid "Executing command: '%s'." msgstr "" #: LogRotate/Handler.py:759 @@ -506,11 +498,11 @@ msgstr "" msgid "Execution of script '%(name)s' failed: %(error)s" msgstr "" -#: LogRotate/Config.py:1540 +#: LogRotate/Config.py:1621 msgid "Failing size definition." msgstr "" -#: LogRotate/Config.py:670 LogRotate/Config.py:695 +#: LogRotate/Config.py:680 LogRotate/Config.py:705 #, python-format msgid "File '%s' doesn't exists." msgstr "" @@ -552,15 +544,15 @@ msgstr "" #: LogRotate/Handler.py:1795 #, python-format -msgid "Filesize of '%(file)s': %(size)d" +msgid "Filesize of '%(file)s': %(size)d." msgstr "" -#: LogRotate/Config.py:1999 +#: LogRotate/Config.py:2079 #, python-format msgid "Find all logfiles for shell matching pattern '%s' ..." msgstr "" -#: LogRotate/Getopts.py:216 +#: LogRotate/Getopts.py:217 msgid "Force file rotation" msgstr "" @@ -611,12 +603,12 @@ msgstr "" msgid "Found invalid mail address '%s'." msgstr "" -#: LogRotate/Config.py:2012 +#: LogRotate/Config.py:2093 #, python-format msgid "Found logfile '%(file)s for pattern '%(pattern)s'." msgstr "" -#: LogRotate/StatusFile.py:522 +#: LogRotate/StatusFile.py:529 #, python-format msgid "Found logfile '%(file)s' with rotation date '%(date)s'." msgstr "" @@ -633,7 +625,7 @@ msgstr "" msgid "Found old logfiles:" msgstr "" -#: LogRotate/Config.py:993 +#: LogRotate/Config.py:1015 #, python-format msgid "Found option '%(opt)s' with value '%(val)s'." msgstr "" @@ -642,25 +634,20 @@ msgstr "" msgid "Found rotations:" msgstr "" -#: LogRotate/Config.py:920 -#, python-format -msgid "" -"Found start of a external script definition. (file '%(file)s', line " -"%(line)s)" +#: LogRotate/Config.py:939 +msgid "Found start of a external script definition." msgstr "" -#: LogRotate/Config.py:899 +#: LogRotate/Config.py:915 #, python-format msgid "" "Found start of a regular script definition: type: '%(type)s', name: " -"'%(name)s' (file '%(file)s', line %(line)s)" +"'%(name)s'." msgstr "" -#: LogRotate/Config.py:1015 +#: LogRotate/Config.py:1036 #, python-format -msgid "" -"Found value '%(value)s' behind the boolean option '%(option)s', ignoring." -" (file '%(file)s', line %(lnr)s)" +msgid "Found value '%(value)s' behind the boolean option '%(option)s', ignoring." msgstr "" #: LogRotate/Mailer.py:567 @@ -672,18 +659,16 @@ msgid "Given period is 'None'." msgstr "" #: LogRotate/Common.py:299 -msgid "Given period was empty" +msgid "Given period was empty." msgstr "" #: LogRotate/Common.py:193 msgid "Given value is 'None'." msgstr "" -#: LogRotate/Config.py:1550 +#: LogRotate/Config.py:1630 #, python-format -msgid "" -"Got a rotation size in '%(directive)s' of %(bytes)d bytes. (file " -"'%(file)s', line %(lnr)s)" +msgid "Got a rotation size in '%(directive)s' of %(bytes)d bytes." msgstr "" #: LogRotate/Common.py:472 @@ -697,7 +682,7 @@ msgstr "" #: LogRotate/Handler.py:1737 #, python-format -msgid "Got returncode: '%s'" +msgid "Got returncode: '%s'." msgstr "" #: LogRotate/Mailer.py:535 @@ -709,36 +694,32 @@ msgstr "" msgid "Handler object structure" msgstr "" -#: LogRotate/StatusFile.py:505 +#: LogRotate/StatusFile.py:510 #, python-format msgid "Idendified version of status file: %d" msgstr "" -#: LogRotate/Config.py:1739 +#: LogRotate/Config.py:1820 #, python-format msgid "Including directory '%s' ..." msgstr "" -#: LogRotate/Config.py:1746 +#: LogRotate/Config.py:1828 #, python-format msgid "Including item '%(item)s' ('%(path)s') ..." msgstr "" -#: LogRotate/Config.py:1702 +#: LogRotate/Config.py:1780 #, python-format -msgid "" -"Including object '%(include)s' doesn't exists. (file '%(file)s', line " -"%(lnr)s)" +msgid "Including object '%s' doesn't exists." msgstr "" -#: LogRotate/Config.py:1712 +#: LogRotate/Config.py:1790 #, python-format -msgid "" -"Including object '%(include)s' is neither a regular file nor a " -"directory. (file '%(file)s', line %(lnr)s)" +msgid "Including object '%s' is neither a regular file nor a directory." msgstr "" -#: LogRotate/StatusFile.py:510 +#: LogRotate/StatusFile.py:516 #, python-format msgid "Incompatible version of status file '%(file)s': %(header)s" msgstr "" @@ -747,7 +728,7 @@ msgstr "" msgid "Initial search for the sendmail executable ..." msgstr "" -#: LogRotate/Config.py:1195 LogRotate/Config.py:1199 +#: LogRotate/Config.py:1246 LogRotate/Config.py:1250 #, python-format msgid "Invalid SMTP port '%s' given." msgstr "" @@ -757,37 +738,32 @@ msgstr "" msgid "Invalid content for a period: '%s'." msgstr "" -#: LogRotate/Config.py:1487 +#: LogRotate/Config.py:1565 #, python-format msgid "Invalid create mode '%s' in 'olddir'." msgstr "" -#: LogRotate/Config.py:1393 +#: LogRotate/Config.py:1466 #, python-format msgid "Invalid create mode '%s'." msgstr "" -#: LogRotate/StatusFile.py:552 +#: LogRotate/StatusFile.py:564 #, python-format -msgid "Invalid date: '%(date)s' (file: '%(file)s', row: %(row)d)" +msgid "Invalid date: '%s'." msgstr "" -#: LogRotate/Config.py:1546 +#: LogRotate/Config.py:1627 #, python-format msgid "Invalid definition for 'size': '%s'." msgstr "" -#: LogRotate/Config.py:1427 +#: LogRotate/Config.py:1502 LogRotate/Config.py:1600 #, python-format -msgid "Invalid group '%s' in 'create'." +msgid "Invalid group '%(group)s' in '%(what)s'." msgstr "" -#: LogRotate/Config.py:1521 -#, python-format -msgid "Invalid group '%s' in 'olddir'." -msgstr "" - -#: LogRotate/Config.py:1186 +#: LogRotate/Config.py:1237 #, python-format msgid "Invalid mail address for 'mailfrom' given: '%s'." msgstr "" @@ -797,32 +773,27 @@ msgstr "" msgid "Invalid mail address given: '%s'." msgstr "" -#: LogRotate/Config.py:1266 +#: LogRotate/Config.py:1322 #, python-format msgid "Invalid maxage definition: '%s'" msgstr "" -#: LogRotate/Config.py:1410 -#, python-format -msgid "Invalid owner '%s' in 'create'." -msgstr "" - -#: LogRotate/Config.py:1504 +#: LogRotate/Config.py:1483 LogRotate/Config.py:1582 #, python-format -msgid "Invalid owner '%s' in 'olddir'." +msgid "Invalid owner '%(owner)s' in '%(what)s'." msgstr "" -#: LogRotate/Config.py:1243 +#: LogRotate/Config.py:1294 #, python-format -msgid "Invalid period definition: '%s'" +msgid "Invalid period definition: '%s'." msgstr "" #: LogRotate/Config.py:456 #, python-format -msgid "Invalid taboo pattern type '%s' given" +msgid "Invalid taboo pattern type '%s' given." msgstr "" -#: LogRotate/Getopts.py:319 +#: LogRotate/Getopts.py:320 msgid "Invalid usage of --force and --config-check." msgstr "" @@ -831,47 +802,64 @@ msgstr "" msgid "Invalid value for property '%s' given." msgstr "" -#: LogRotate/Config.py:1768 +#: LogRotate/Config.py:1852 #, python-format msgid "Item '%(item)s' is matching pattern '%(pattern)s', skiping." msgstr "" -#: LogRotate/Config.py:1758 +#: LogRotate/Config.py:1842 #, python-format msgid "Item '%s' is not a regular file." msgstr "" -#: LogRotate/Config.py:866 +#: LogRotate/Config.py:882 #, python-format msgid "Lastaction script '%s' not found." msgstr "" -#: LogRotate/Config.py:2017 +#: LogRotate/Config.py:2099 #, python-format msgid "" "Logfile '%(logfile)s' is even defined (file '%(cfgfile)s', row " "%(rownum)d) and so not taken a second time." msgstr "" +#: LogRotate/Handler.py:713 +#, python-format +msgid "Logfile '%s' WILL rotated." +msgstr "" + +#: LogRotate/Handler.py:1780 +#, python-format +msgid "Logfile '%s' doesn't exists, not rotated." +msgstr "" + #: LogRotate/Handler.py:1801 #, python-format -msgid "Logfile '%s' has a filesize of Zero, not rotated" +msgid "Logfile '%s' has a filesize of Zero, not rotated." msgstr "" -#: LogRotate/Config.py:2026 +#: LogRotate/Handler.py:1789 #, python-format -msgid "Logfile '%s' will taken." +msgid "Logfile '%s' is not a regular file, not rotated." msgstr "" -#: LogRotate/Config.py:774 +#: LogRotate/Handler.py:715 #, python-format -msgid "" -"Logfile pattern definition not allowed inside a logfile definition (file " -"'%(file)s', line %(line)s)" +msgid "Logfile '%s' will NOT rotated." msgstr "" -#: LogRotate/Config.py:339 -msgid "Logrotate config reader initialised" +#: LogRotate/Config.py:2109 +#, python-format +msgid "Logfile '%s' will taken." +msgstr "" + +#: LogRotate/Config.py:787 +msgid "Logfile pattern definition not allowed inside a logfile definition." +msgstr "" + +#: LogRotate/Config.py:338 +msgid "Logrotate config reader initialised." msgstr "" #: LogRotate/Script.py:405 @@ -880,11 +868,11 @@ msgid "Logrotate script object '%s' will destroyed." msgstr "" #: LogRotate/Handler.py:342 -msgid "Logrotating initialised" +msgid "Logrotating initialised." msgstr "" #: LogRotate/Handler.py:357 -msgid "Logrotating ready for work" +msgid "Logrotating ready for work." msgstr "" #: LogRotate/Handler.py:756 @@ -927,14 +915,12 @@ msgstr "" msgid "Name of state file: '%s'" msgstr "" -#: LogRotate/Config.py:830 +#: LogRotate/Config.py:845 #, python-format -msgid "" -"Needless content found at the end of a logfile definition found: " -"'%(rest)s' (file '%(file)s', line %(line)s)" +msgid "Needless content found at the end of a logfile definition found: '%s'." msgstr "" -#: LogRotate/Config.py:1077 +#: LogRotate/Config.py:1114 #, python-format msgid "Negative value %(value)s for option '%(option)s' is not allowed." msgstr "" @@ -945,35 +931,30 @@ msgid "" "_copy_file_metadata()." msgstr "" -#: LogRotate/StatusFile.py:561 +#: LogRotate/StatusFile.py:574 #, python-format -msgid "" -"Neither a logfile nor a date found in line '%(line)s' (file: '%(file)s', " -"row: %(row)d)" +msgid "Neither a logfile nor a date found in line '%s'." msgstr "" -#: LogRotate/Config.py:1812 -#, python-format -msgid "" -"Nested logfile definitions are not allowed. (file '%(file)s', line " -"%(lnr)s)" +#: LogRotate/Config.py:1896 +msgid "Nested logfile definitions are not allowed." msgstr "" -#: LogRotate/Config.py:936 +#: LogRotate/Config.py:957 #, python-format msgid "New external script name: '%s'." msgstr "" -#: LogRotate/Config.py:913 +#: LogRotate/Config.py:931 #, python-format msgid "New log script name: '%s'." msgstr "" -#: LogRotate/Config.py:852 +#: LogRotate/Config.py:868 msgid "New logfile definition:" msgstr "" -#: LogRotate/Config.py:460 +#: LogRotate/Config.py:461 #, python-format msgid "New taboo pattern: '%s'." msgstr "" @@ -987,7 +968,7 @@ msgstr "" msgid "No compression defined." msgstr "" -#: LogRotate/Getopts.py:323 +#: LogRotate/Getopts.py:324 msgid "No configuration file given." msgstr "" @@ -1000,37 +981,31 @@ msgstr "" msgid "No execute permissions to '%s'." msgstr "" -#: LogRotate/Config.py:843 +#: LogRotate/Config.py:859 #, python-format msgid "" "No extension for compressed logfiles given (File of definition: " "'%(file)s', start definition: %(rownum)d)." msgstr "" -#: LogRotate/Config.py:1685 -#, python-format -msgid "" -"No file or directory given in a include directive (file '%(file)s', line " -"%(lnr)s)" +#: LogRotate/Config.py:1762 +msgid "No file or directory given in a include directive." msgstr "" #: LogRotate/Handler.py:649 msgid "No logfile definitions found." msgstr "" -#: LogRotate/Config.py:2004 +#: LogRotate/Config.py:2085 #, python-format msgid "No logfile found for pattern '%s'." msgstr "" -#: LogRotate/Config.py:1818 -#, python-format -msgid "" -"No logfile pattern defined on starting a logfile definition. (file " -"'%(file)s', line %(lnr)s)" +#: LogRotate/Config.py:1902 +msgid "No logfile pattern defined on starting a logfile definition." msgstr "" -#: LogRotate/Config.py:1993 +#: LogRotate/Config.py:2073 msgid "No logfile pattern defined." msgstr "" @@ -1063,11 +1038,8 @@ msgstr "" msgid "No permission to signal the process %d ..." msgstr "" -#: LogRotate/Config.py:1622 -#, python-format -msgid "" -"No script name given in a script directive. (file '%(file)s', line " -"%(lnr)s)" +#: LogRotate/Config.py:1704 +msgid "No script name given in a script directive." msgstr "" #: LogRotate/Handler.py:576 @@ -1102,7 +1074,7 @@ msgstr "" #: LogRotate/Handler.py:1597 #, python-format -msgid "Olddir name is now '%s'" +msgid "Olddir name is now '%s'." msgstr "" #: LogRotate/Mailer.py:273 @@ -1110,22 +1082,20 @@ msgstr "" msgid "Only absolute path allowed for a sendmail command: '%s'." msgstr "" -#: LogRotate/Getopts.py:327 +#: LogRotate/Getopts.py:328 msgid "Only one configuration file is allowed." msgstr "" -#: LogRotate/Config.py:1693 -#, python-format +#: LogRotate/Config.py:1770 msgid "" "Only one declaration of a file or directory is allowed in a include " -"directive, the first one is used. (file '%(file)s', line %(lnr)s)" +"directive, the first one is used." msgstr "" -#: LogRotate/Config.py:1630 -#, python-format +#: LogRotate/Config.py:1712 msgid "" "Only one script name is allowed in a script directive, the first one is " -"used. (file '%(file)s', line %(lnr)s)" +"used." msgstr "" #: LogRotate/Handler.py:994 LogRotate/Handler.py:1690 LogRotate/Handler.py:2147 @@ -1137,88 +1107,53 @@ msgstr "" msgid "Open status file '%s' for writing ..." msgstr "" -#: LogRotate/Config.py:1071 +#: LogRotate/Config.py:1059 LogRotate/Config.py:1066 LogRotate/Config.py:1074 +#: LogRotate/Config.py:1081 #, python-format -msgid "Option '%(option)s' has no integer value: %(msg)s." -msgstr "" - -#: LogRotate/Config.py:1235 -#, python-format -msgid "" -"Option '%(option)s' may not have a value ('%(value)s'). (file '%(file)s'," -" line %(lnr)s)" -msgstr "" - -#: LogRotate/Config.py:1147 LogRotate/Config.py:1172 -#, python-format -msgid "Option '%s' must have a value." -msgstr "" - -#: LogRotate/Config.py:1168 -#, python-format -msgid "Option '%s' not allowed inside a logfile directive." -msgstr "" - -#: LogRotate/Config.py:1062 -#, python-format -msgid "Option '%s' without a necessary value." +msgid "Option '%(by)s' disables option '%(what)'." msgstr "" -#: LogRotate/Config.py:1149 LogRotate/Config.py:1174 +#: LogRotate/Config.py:1108 #, python-format -msgid "Option '%s' without a value" +msgid "Option '%(option)s' has no integer value: %(msg)s." msgstr "" -#: LogRotate/Config.py:1030 +#: LogRotate/Config.py:1285 #, python-format -msgid "" -"Option 'copy' disables option 'copytruncate'. (file '%(file)s', line " -"%(lnr)s)" +msgid "Option '%(option)s' may not have a value ('%(value)s')." msgstr "" -#: LogRotate/Config.py:1035 +#: LogRotate/Config.py:1099 LogRotate/Config.py:1195 LogRotate/Config.py:1223 #, python-format -msgid "Option 'copy' disables option 'create'. (file '%(file)s', line %(lnr)s)" +msgid "Option '%s' must have a value." msgstr "" -#: LogRotate/Config.py:1357 +#: LogRotate/Config.py:1219 #, python-format -msgid "" -"Option 'copy' was set, so option 'create' has no effect. (file " -"'%(file)s', line %(lnr)s)" +msgid "Option '%s' not allowed inside a logfile directive." msgstr "" -#: LogRotate/Config.py:1041 +#: LogRotate/Config.py:1426 LogRotate/Config.py:1435 #, python-format -msgid "" -"Option 'copytruncate' disables option 'copy'. (file '%(file)s', line " -"%(lnr)s)" +msgid "Option '%s' was set, so option 'create' has no effect." msgstr "" -#: LogRotate/Config.py:1046 +#: LogRotate/Config.py:1542 #, python-format -msgid "" -"Option 'copytruncate' disables option 'create'. (file '%(file)s', line " -"%(lnr)s)" +msgid "Option '%s' without a value given." msgstr "" -#: LogRotate/Config.py:1364 +#: LogRotate/Config.py:1198 LogRotate/Config.py:1225 #, python-format -msgid "" -"Option 'copytruncate' was set, so option 'create' has no effect. (file " -"'%(file)s', line %(lnr)s)" -msgstr "" - -#: LogRotate/Config.py:1465 -msgid "Option 'olddir' without a value given." +msgid "Option '%s' without a value." msgstr "" -#: LogRotate/Config.py:1581 +#: LogRotate/Config.py:1664 #, python-format msgid "Option 'taboo%s' needs a value." msgstr "" -#: LogRotate/Config.py:1568 +#: LogRotate/Config.py:1651 #, python-format msgid "Option 'taboo%s' not allowed inside a logfile directive." msgstr "" @@ -1242,11 +1177,11 @@ msgstr "" msgid "Parent directory '%(dir)s' of status file '%(file)s' is not a directory." msgstr "" -#: LogRotate/Getopts.py:245 +#: LogRotate/Getopts.py:246 msgid "Path of PID file (different to configuration)" msgstr "" -#: LogRotate/Getopts.py:236 +#: LogRotate/Getopts.py:237 msgid "Path of state file (different to configuration)" msgstr "" @@ -1263,7 +1198,7 @@ msgstr "" #: LogRotate/StatusFile.py:494 #, python-format -msgid "Performing status file line '%(line)s' (file: '%(file)s', row: %(row)d)" +msgid "Performing status file line '%s'." msgstr "" #: LogRotate/StatusFile.py:430 @@ -1271,7 +1206,7 @@ msgstr "" msgid "Permissions to parent directory '%s' are OK." msgstr "" -#: LogRotate/Config.py:859 +#: LogRotate/Config.py:875 #, python-format msgid "Postrotate script '%s' not found." msgstr "" @@ -1291,7 +1226,7 @@ msgstr "" msgid "Reading PID file '%s' ..." msgstr "" -#: LogRotate/Config.py:702 +#: LogRotate/Config.py:712 #, python-format msgid "Reading configuration from '%s' ..." msgstr "" @@ -1306,24 +1241,14 @@ msgstr "" msgid "Recreating file '%s'." msgstr "" -#: LogRotate/Config.py:1779 -#, python-format -msgid "Recursive including of '%(include)s' (file '%(file)s', line %(lnr)s)" -msgstr "" - -#: LogRotate/Config.py:1724 -#, python-format -msgid "Recursive including of '%(include)s'. (file '%(file)s', line %(lnr)s)" -msgstr "" - -#: LogRotate/Config.py:1350 +#: LogRotate/Config.py:1804 LogRotate/Config.py:1863 #, python-format -msgid "Removing 'create'. (file '%(file)s', line %(lnr)s)" +msgid "Recursive including of '%s'." msgstr "" -#: LogRotate/Config.py:1453 +#: LogRotate/Config.py:1418 LogRotate/Config.py:1529 #, python-format -msgid "Removing 'olddir'. (file '%(file)s', line %(lnr)s)" +msgid "Removing '%s'." msgstr "" #: LogRotate/Handler.py:432 @@ -1331,7 +1256,7 @@ msgstr "" msgid "Removing PID file '%s' ..." msgstr "" -#: LogRotate/Config.py:398 +#: LogRotate/Config.py:397 msgid "Resetting default values for directives to hard coded values" msgstr "" @@ -1390,7 +1315,7 @@ msgstr "" msgid "Retrieving the name of the rotated file of '%s' ..." msgstr "" -#: LogRotate/Getopts.py:113 +#: LogRotate/Getopts.py:114 msgid "Rotates, compresses and mails system logs." msgstr "" @@ -1403,11 +1328,9 @@ msgstr "" msgid "Rotating of logfile definition:" msgstr "" -#: LogRotate/Config.py:1638 +#: LogRotate/Config.py:1721 #, python-format -msgid "" -"Script name '%(name)s' is allready declared, it will be overwritten. " -"(file '%(file)s', line %(lnr)s)" +msgid "Script name '%s' is allready declared, it will be overwritten." msgstr "" #: LogRotate/Handler.py:1338 @@ -1415,11 +1338,16 @@ msgstr "" msgid "Search for pattern '%s' ..." msgstr "" -#: LogRotate/Config.py:560 LogRotate/Config.py:620 +#: LogRotate/Config.py:630 #, python-format msgid "Search path '%s' doesn't exists or is not a directory" msgstr "" +#: LogRotate/Config.py:565 +#, python-format +msgid "Search path '%s' doesn't exists or is not a directory." +msgstr "" + #: LogRotate/Mailer.py:508 #, python-format msgid "Sending mail with attached file '%(file)s' to: %(rcpt)s" @@ -1430,7 +1358,7 @@ msgstr "" msgid "Sendmail command '%s' not found." msgstr "" -#: LogRotate/Config.py:1097 LogRotate/Config.py:1134 +#: LogRotate/Config.py:1140 LogRotate/Config.py:1181 #, python-format msgid "Senseless option value '%(value)s' after '%(option)s'." msgstr "" @@ -1440,32 +1368,22 @@ msgstr "" msgid "Set sender mail address to: '%s'." msgstr "" -#: LogRotate/Config.py:1318 -#, python-format -msgid "" -"Setting 'dateext' in '%(directive)s' to %(ext)s. (file '%(file)s', line " -"%(lnr)s)" +#: LogRotate/Getopts.py:197 +msgid "Set the verbosity level" msgstr "" -#: LogRotate/Config.py:1326 -#, python-format -msgid "" -"Setting 'datepattern' in '%(directive)s' to '%(pattern)s'. (file " -"'%(file)s', line %(lnr)s)" +#: LogRotate/Getopts.py:186 +msgid "Set this do simulate commands" msgstr "" -#: LogRotate/Config.py:1270 +#: LogRotate/Config.py:1298 LogRotate/Config.py:1326 #, python-format -msgid "" -"Setting 'maxage' in '%(directive)s' to %(days)f days. (file '%(file)s', " -"line %(lnr)s)" +msgid "Setting '%(what)s' in '%(directive)s' to %(to)f days." msgstr "" -#: LogRotate/Config.py:1247 +#: LogRotate/Config.py:1378 LogRotate/Config.py:1390 #, python-format -msgid "" -"Setting 'period' in '%(directive)s' to %(days)f days. (file '%(file)s', " -"line %(lnr)s)" +msgid "Setting '%(what)s' in '%(directive)s' to %(to)s." msgstr "" #: LogRotate/Handler.py:2108 @@ -1473,39 +1391,29 @@ msgstr "" msgid "Setting atime and mtime of target '%s'." msgstr "" -#: LogRotate/Config.py:1024 +#: LogRotate/Config.py:1047 #, python-format -msgid "" -"Setting boolean option '%(option)s' in '%(directive)s' to '%(value)s'. " -"(file '%(file)s', line %(lnr)s)" +msgid "Setting boolean option '%(option)s' in '%(directive)s' to '%(value)s'." msgstr "" -#: LogRotate/Config.py:1215 +#: LogRotate/Config.py:1265 #, python-format -msgid "" -"Setting global option '%(option)s' to '%(value)s'. (file '%(file)s', line" -" %(lnr)s)" +msgid "Setting global option '%(option)s' to '%(value)s'." msgstr "" -#: LogRotate/Config.py:1083 +#: LogRotate/Config.py:1120 #, python-format -msgid "" -"Setting integer option '%(option)s' in '%(directive)s' to '%(value)s'. " -"(file '%(file)s', line %(lnr)s)" +msgid "Setting integer option '%(option)s' in '%(directive)s' to '%(value)s'." msgstr "" -#: LogRotate/Config.py:1109 +#: LogRotate/Config.py:1152 #, python-format -msgid "" -"Setting mail address in '%(directive)s' to '%(addr)s'. (file '%(file)s', " -"line %(lnr)s)" +msgid "Setting mail address in '%(directive)s' to '%(addr)s'." msgstr "" -#: LogRotate/Config.py:1129 +#: LogRotate/Config.py:1172 #, python-format -msgid "" -"Setting mailfirst in '%(directive)s' to '%(value)s'. (file '%(file)s', " -"line %(lnr)s)" +msgid "Setting mailfirst in '%(directive)s' to '%(value)s'." msgstr "" #: LogRotate/Handler.py:1000 @@ -1513,12 +1421,7 @@ msgstr "" msgid "Setting ownership of '%(file)s' to uid %(uid)d and gid %(gid)d." msgstr "" -#: LogRotate/Handler.py:979 -#, python-format -msgid "Setting permissions of '%(file)s' to %(mode)4o." -msgstr "" - -#: LogRotate/Handler.py:2123 +#: LogRotate/Handler.py:979 LogRotate/Handler.py:2123 #, python-format msgid "Setting permissions of '%(target)s' to %(mode)4o." msgstr "" @@ -1528,24 +1431,24 @@ msgstr "" msgid "Setting rotation date of '%(file)s' to '%(date)s' ..." msgstr "" -#: LogRotate/Getopts.py:268 +#: LogRotate/Getopts.py:269 msgid "Shows a help message and exit." msgstr "" -#: LogRotate/Getopts.py:288 +#: LogRotate/Getopts.py:289 msgid "Shows the version number of the program and exit." msgstr "" -#: LogRotate/Config.py:563 +#: LogRotate/Config.py:571 #, python-format -msgid "Shred command found: '%s'" +msgid "Shred command found: '%s'." msgstr "" -#: LogRotate/Config.py:567 -msgid "Shred command not found, shred disabled" +#: LogRotate/Config.py:576 +msgid "Shred command not found, shred disabled." msgstr "" -#: LogRotate/Config.py:1753 +#: LogRotate/Config.py:1835 #, python-format msgid "Skip subdirectory '%s' in including." msgstr "" @@ -1560,7 +1463,7 @@ msgstr "" msgid "Source file '%s' for compression doesn't exists." msgstr "" -#: LogRotate/Config.py:791 +#: LogRotate/Config.py:805 #, python-format msgid "Split into parts of: '%s'" msgstr "" @@ -1585,12 +1488,11 @@ msgstr "" msgid "Stage 5: compression of old log files" msgstr "" -#: LogRotate/Config.py:754 -#, python-format -msgid "Starting a logfile definition (file '%(file)s', line %(line)s)" +#: LogRotate/Config.py:766 +msgid "Starting a logfile definition." msgstr "" -#: LogRotate/Config.py:1930 +#: LogRotate/Config.py:2009 msgid "Starting a new log directive with default values." msgstr "" @@ -1631,37 +1533,27 @@ msgstr "" msgid "Substituting '{}' in compressoptions with '%s'." msgstr "" -#: LogRotate/Config.py:941 +#: LogRotate/Config.py:963 #, python-format msgid "Syntax error in file '%(file)s', line %(line)s" msgstr "" -#: LogRotate/Config.py:926 -#, python-format +#: LogRotate/Config.py:945 msgid "" "Syntax error: external script definition may not appear inside of a log " -"file definition (file '%(file)s', line %(line)s)" +"file definition." msgstr "" -#: LogRotate/Config.py:880 -#, python-format -msgid "" -"Syntax error: include may not appear inside of log file definition (file " -"'%(file)s', line %(line)s)" +#: LogRotate/Config.py:895 +msgid "Syntax error: include may not appear inside of log file definition." msgstr "" -#: LogRotate/Config.py:798 -#, python-format -msgid "" -"Syntax error: open curly bracket inside a logfile pattern definition " -"(file '%(file)s', line %(line)s)" +#: LogRotate/Config.py:811 +msgid "Syntax error: open curly bracket inside alogfile pattern definition." msgstr "" -#: LogRotate/Config.py:822 -#, python-format -msgid "" -"Syntax error: unbalanced closing curly bracket found (file '%(file)s', " -"line %(line)s)" +#: LogRotate/Config.py:836 +msgid "Syntax error: unbalanced closing curly bracket found." msgstr "" #: LogRotate/Handler.py:2005 @@ -1709,7 +1601,7 @@ msgstr "" msgid "Truncating file '%s'." msgstr "" -#: LogRotate/Config.py:692 +#: LogRotate/Config.py:702 #, python-format msgid "Try reading configuration from '%s' ..." msgstr "" @@ -1724,49 +1616,47 @@ msgstr "" msgid "Trying check for process with PID %d ..." msgstr "" -#: LogRotate/Config.py:1418 +#: LogRotate/Config.py:1493 #, python-format msgid "" "Trying to determine create group '%(group)s'... (file '%(file)s', line " "%(lnr)s)" msgstr "" -#: LogRotate/Config.py:1384 +#: LogRotate/Config.py:1457 #, python-format msgid "" "Trying to determine create mode '%(mode)s'... (file '%(file)s', line " "%(lnr)s)" msgstr "" -#: LogRotate/Config.py:1401 +#: LogRotate/Config.py:1474 #, python-format msgid "" "Trying to determine create owner '%(owner)s'... (file '%(file)s', line " "%(lnr)s)" msgstr "" -#: LogRotate/Config.py:1478 +#: LogRotate/Config.py:1556 #, python-format msgid "" "Trying to determine olddir create mode '%(mode)s' ... (file '%(file)s', " "line %(lnr)s)" msgstr "" -#: LogRotate/Config.py:1512 +#: LogRotate/Config.py:1591 #, python-format -msgid "" -"Trying to determine olddir group '%(group)s' ... (file '%(file)s', line " -"%(lnr)s)" +msgid "Trying to determine olddir group '%s' ..." msgstr "" -#: LogRotate/Config.py:1495 +#: LogRotate/Config.py:1573 #, python-format msgid "" "Trying to determine olddir owner '%(owner)s' ... (file '%(file)s', line " "%(lnr)s)" msgstr "" -#: LogRotate/Config.py:1718 +#: LogRotate/Config.py:1798 #, python-format msgid "Trying to include object '%s' ..." msgstr "" @@ -1776,14 +1666,14 @@ msgstr "" msgid "Unknown error: '%s'" msgstr "" -#: LogRotate/Config.py:1592 +#: LogRotate/Config.py:1675 #, python-format msgid "Unknown option '%s'." msgstr "" -#: LogRotate/Config.py:1002 +#: LogRotate/Config.py:1023 #, python-format -msgid "Unsupported option '%(option)s'. (file '%(file)s', line %(lnr)s)" +msgid "Unsupported option '%s'." msgstr "" #: LogRotate/Handler.py:1515 @@ -1806,12 +1696,12 @@ msgstr "" msgid "Using date extension '.%(ext)s' from pattern '%(pattern)s'." msgstr "" -#: LogRotate/Common.py:319 +#: LogRotate/Common.py:201 LogRotate/Common.py:319 #, python-format msgid "Using radix '%s'." msgstr "" -#: LogRotate/Config.py:1179 +#: LogRotate/Config.py:1230 #, python-format msgid "Value '%(value)s' for option '%(option)s' is not an absolute path." msgstr "" @@ -1821,9 +1711,9 @@ msgstr "" msgid "Verbose mode is ON on level: %d" msgstr "" -#: LogRotate/Config.py:1733 +#: LogRotate/Config.py:1813 #, python-format -msgid "What the hell is this: '%(include)s'. (file '%(file)s', line %(lnr)s)" +msgid "What the hell is this: '%s'." msgstr "" #: LogRotate/Handler.py:621 @@ -1851,36 +1741,3 @@ msgstr "" msgid "[%(date)s]: %(prog)s is starting logrotation." msgstr "" -#: LogRotate/Handler.py:713 -#, python-format -msgid "logfile '%s' WILL rotated." -msgstr "" - -#: LogRotate/Handler.py:1780 -#, python-format -msgid "logfile '%s' doesn't exists, not rotated" -msgstr "" - -#: LogRotate/Handler.py:1789 -#, python-format -msgid "logfile '%s' is not a regular file, not rotated" -msgstr "" - -#: LogRotate/Handler.py:715 -#, python-format -msgid "logfile '%s' will NOT rotated." -msgstr "" - -#: LogRotate/Getopts.py:196 -msgid "set the verbosity level" -msgstr "" - -#: LogRotate/Getopts.py:185 -msgid "set this do simulate commands" -msgstr "" - -#: LogRotate/Common.py:201 -#, python-format -msgid "using radix '%s'." -msgstr "" - -- 2.39.5