From 0824323d9937dbb6914acbd2a2198108453c904a Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 12 Jul 2011 21:27:39 +0000 Subject: [PATCH] =?utf8?q?Gr=C3=B6=C3=9Ferer=20Umbau=20Teil=203?= 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@287 ec8d2aa5-1599-4edb-8739-2b3a1bc399aa --- LogRotate/Config.py | 12 +++++++++--- LogRotate/Handler.py | 20 +++++++++++++------- LogRotate/Mailer.py | 8 +++++++- LogRotate/StatusFile.py | 8 +++++++- babel.cfg | 4 ++++ logrotate.py | 4 ++-- setup.cfg | 11 +++++++++++ setup.py | 33 +++++++++++++++++++++++++++++++++ 8 files changed, 86 insertions(+), 14 deletions(-) create mode 100644 babel.cfg create mode 100644 setup.cfg create mode 100755 setup.py diff --git a/LogRotate/Config.py b/LogRotate/Config.py index ba613de..3fc96a7 100755 --- a/LogRotate/Config.py +++ b/LogRotate/Config.py @@ -25,9 +25,15 @@ import glob import logging import email.utils -from LogRotateCommon import split_parts, email_valid, period2days, human2bytes -from LogRotateCommon import get_address_list -from LogRotateScript import LogRotateScript +try: + import LogRotate.Common +except ImportError: + sys.path.append(os.path.abspath(os.path.join(sys.path[0], '..'))) + import LogRotate.Common + +from LogRotate.Common import split_parts, email_valid, period2days, human2bytes +from LogRotate.Common import get_address_list +from LogRotate.Script import LogRotateScript revision = '$Revision$' revision = re.sub( r'\$', '', revision ) diff --git a/LogRotate/Handler.py b/LogRotate/Handler.py index dda1852..36d0ac2 100755 --- a/LogRotate/Handler.py +++ b/LogRotate/Handler.py @@ -33,15 +33,21 @@ import gzip import bz2 import zipfile -from LogRotateConfig import LogrotateConfigurationError -from LogRotateConfig import LogrotateConfigurationReader +try: + import LogRotate.Common +except ImportError: + sys.path.append(os.path.abspath(os.path.join(sys.path[0], '..'))) + import LogRotate.Common -from LogRotateStatusFile import LogrotateStatusFileError -from LogRotateStatusFile import LogrotateStatusFile -from LogRotateStatusFile import utc +from LogRotate.Config import LogrotateConfigurationError +from LogRotate.Config import LogrotateConfigurationReader -from LogRotateMailer import LogRotateMailerError -from LogRotateMailer import LogRotateMailer +from LogRotate.StatusFile import LogrotateStatusFileError +from LogRotate.StatusFile import LogrotateStatusFile +from LogRotate.StatusFile import utc + +from LogRotate.Mailer import LogRotateMailerError +from LogRotate.Mailer import LogRotateMailer revision = '$Revision$' revision = re.sub( r'\$', '', revision ) diff --git a/LogRotate/Mailer.py b/LogRotate/Mailer.py index 9ff2628..051fc62 100755 --- a/LogRotate/Mailer.py +++ b/LogRotate/Mailer.py @@ -38,7 +38,13 @@ from email.mime.text import MIMEText from quopri import encodestring as _encodestring -from LogRotateCommon import email_valid +try: + import LogRotate.Common +except ImportError: + sys.path.append(os.path.abspath(os.path.join(sys.path[0], '..'))) + import LogRotate.Common + +from LogRotate.Common import email_valid revision = '$Revision$' revision = re.sub( r'\$', '', revision ) diff --git a/LogRotate/StatusFile.py b/LogRotate/StatusFile.py index 5dc4b3c..0de706c 100755 --- a/LogRotate/StatusFile.py +++ b/LogRotate/StatusFile.py @@ -23,7 +23,13 @@ import pprint from datetime import tzinfo, timedelta, datetime, date, time -from LogRotateCommon import split_parts +try: + import LogRotate.Common +except ImportError: + sys.path.append(os.path.abspath(os.path.join(sys.path[0], '..'))) + import LogRotate.Common + +from LogRotate.Common import split_parts revision = '$Revision$' revision = re.sub( r'\$', '', revision ) diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 0000000..8e794f3 --- /dev/null +++ b/babel.cfg @@ -0,0 +1,4 @@ + +[python: **.py] + +output_file = "locale/messages.pot" diff --git a/logrotate.py b/logrotate.py index 2c2f962..1e53b9c 100755 --- a/logrotate.py +++ b/logrotate.py @@ -9,7 +9,7 @@ @contact: frank@brehm-online.com @license: GPL3 @copyright: (c) 2010-2011 by Frank Brehm, Berlin -@version: 0.5.3 +@version: 0.6.0 @summary: rotates and compress system logs ''' @@ -36,7 +36,7 @@ revision = re.sub( r'Revision: ', r'r', revision ) __author__ = 'Frank Brehm' __copyright__ = '(C) 2011 by Frank Brehm, Berlin' __contact__ = 'frank@brehm-online.com' -__version__ = '0.5.3 ' + revision +__version__ = '0.6.0 ' + revision __license__ = 'GPL3' diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..99c0c80 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,11 @@ + +[extract_messages] + +keywords = _, gettext, ngettext +mapping_file = babel.cfg +width = 76 +charset = utf-8 +copyright-holder = "2011 Frank Brehm, Berlin" +sort-output = True +;sort-by-file = True +output-file = locale/pylogrotate.pot diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..9c1b47f --- /dev/null +++ b/setup.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# $Id$ +# $URL$ + +''' +@author: Frank Brehm +@contact: frank@brehm-online.com +@license: GPL3 +@copyright: (c) 2010-2011 by Frank Brehm, Berlin +@version: 0.6.0 +@summary: setup for pylogrotate +''' + +from setuptools import setup + +setup( + name='pylogrotate', + version='0.6.0', + description='rotates and compress system logs', + author='Frank Brehm', + author_email='frank@brehm-online.com', + url='http://svn.brehm-online.com/svn/my-stuff/python/PyLogrotate/', + packages=['LogRotate'], + scripts = ['logrotate.py'], +) + + + +#======================================================================== + +# vim: fileencoding=utf-8 filetype=python ts=4 expandtab -- 2.39.5