[Erp5-report] r45660 luke - /erp5/trunk/utils/z2loganalyser/analyzeZ2log.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Apr 22 16:56:37 CEST 2011
Author: luke
Date: Fri Apr 22 16:56:36 2011
New Revision: 45660
URL: http://svn.erp5.org?rev=45660&view=rev
Log:
- allow to provide pattern used to search for files
Modified:
erp5/trunk/utils/z2loganalyser/analyzeZ2log.py
Modified: erp5/trunk/utils/z2loganalyser/analyzeZ2log.py
URL: http://svn.erp5.org/erp5/trunk/utils/z2loganalyser/analyzeZ2log.py?rev=45660&r1=45659&r2=45660&view=diff
==============================================================================
--- erp5/trunk/utils/z2loganalyser/analyzeZ2log.py [utf8] (original)
+++ erp5/trunk/utils/z2loganalyser/analyzeZ2log.py [utf8] Fri Apr 22 16:56:36 2011
@@ -44,6 +44,7 @@ class Parser(OptionParser):
"""
Initialize all options possibles.
"""
+ default_pattern = 'Z2.log*.gz'
OptionParser.__init__(self, usage=usage, version=version,
option_list=[
Option("-v", "--verbose",
@@ -60,6 +61,9 @@ class Parser(OptionParser):
action="store_true",
default=0,
dest="force"),
+ Option("-p", "--pattern",
+ help="Pattern to use to search files, defaults to %r" % default_pattern,
+ default=default_pattern),
])
def check_args(self):
@@ -129,7 +133,7 @@ class Executor:
top_directory_path = self.config.directory_path
# Z2.log-20090430.gz
- for filename in glob.glob(self.config.directory_path + '/Z2.log*.gz'):
+ for filename in glob.glob(self.config.directory_path + '/' + self.config.pattern):
f = gzip.open(filename, 'rb')
for line in f:
More information about the Erp5-report
mailing list