-#!/usr/bin/env python
+#!/usr/bin/python2.7
#
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
# Author: Erwan Velu <erwan@enovance.com>
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import os
import fnmatch
fio_data_file=[]
# For all the local files
for file in os.listdir(path):
- # If the file math the regexp
+ # If the file matches the glob
if fnmatch.fnmatch(file, pattern):
# Let's consider this file
fio_data_file.append(file)
print 'fio2gnuplot -ghbiodvk -t <title> -o <outputfile> -p <pattern> -G <type> -m <time> -M <time>'
print
print '-h --help : Print this help'
- print '-p <pattern> or --pattern <pattern> : A pattern in regexp to select fio input files'
+ print '-p <pattern> or --pattern <pattern> : A glob pattern to select fio input files'
print '-b or --bandwidth : A predefined pattern for selecting *_bw.log files'
print '-i or --iops : A predefined pattern for selecting *_iops.log files'
print '-g or --gnuplot : Render gnuplot traces before exiting'
#We need to adjust the output filename regarding the pattern required by the user
if (pattern_set_by_user == True):
gnuplot_output_filename=pattern
- # As we do have some regexp in the pattern, let's make this simpliest
+ # As we do have some glob in the pattern, let's make this simpliest
# We do remove the simpliest parts of the expression to get a clear file name
gnuplot_output_filename=gnuplot_output_filename.replace('-*-','-')
gnuplot_output_filename=gnuplot_output_filename.replace('*','-')