From: "Andrea Arteaga" <andyspiros@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/, numbench/reports/
Date: Mon, 5 Mar 2012 15:48:28 +0000 (UTC) [thread overview]
Message-ID: <1330962349.d4f647843ee0b1a9cc5d8be2d6ec12dfb0dad3c3.spiros@gentoo> (raw)
commit: d4f647843ee0b1a9cc5d8be2d6ec12dfb0dad3c3
Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
AuthorDate: Mon Mar 5 15:45:49 2012 +0000
Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
CommitDate: Mon Mar 5 15:45:49 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=d4f64784
Renamed HTMLReport, made reports modular.
---
numbench/benchconfig.py | 6 +--
numbench/benchpkgconfig.py | 70 ---------------------------
numbench/report.py | 2 +-
numbench/{htmlreport.py => reports/html.py} | 2 +-
4 files changed, 4 insertions(+), 76 deletions(-)
diff --git a/numbench/benchconfig.py b/numbench/benchconfig.py
index a3b40cf..64b8982 100644
--- a/numbench/benchconfig.py
+++ b/numbench/benchconfig.py
@@ -39,11 +39,9 @@ if not locals().has_key('initialized'):
('ABI=$(portageq envvar ABI); echo `portageq envvar LIBDIR_$ABI`', \
stdout=sp.PIPE, shell=True).communicate()[0].strip()
if not libdir:
- libdir = '/usr/lib'
+ libdir = 'usr/lib'
else:
- libdir = '/usr/' + libdir
- while libdir[0] == '/':
- libdir = libdir[1:]
+ libdir = 'usr/' + libdir
# Parse arguments
passargs = sys.argv[3:]
diff --git a/numbench/benchpkgconfig.py b/numbench/benchpkgconfig.py
deleted file mode 100644
index 9051cb4..0000000
--- a/numbench/benchpkgconfig.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#=====================================================
-# Copyright (C) 2011 Andrea Arteaga <andyspiros@gmail.com>
-#=====================================================
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-# 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.
-#
-import os
-from os.path import join as pjoin, basename, dirname, exists
-import subprocess as sp
-
-import benchconfig as cfg
-
-def GetFile(file, impl, roots='/'):
- if file[-3:] != '.pc':
- fname = file + '.pc'
- else:
- fname = file
-
- libdir = cfg.libdir
- while libdir[0] == '/':
- libdir = libdir[1:]
-
- # Check alternatives
- if type(roots) == type(''):
- roots = roots,
- pkgcfgpath = ':'.join([pjoin(r,'etc/env.d/alternatives', file, impl, \
- libdir, 'pkgconfig', fname) for r in roots])
-
- if os.path.exists(pkgcfgpath):
- return pkgcfgpath
- else:
- raise Exception('pkg-config fname ' + file + ' not found', pkgcfgpath)
-
-def Requires(fname):
- env = {'PKG_CONFIG_PATH' : dirname(fname)}
- cmd = ['pkg-config', '--print-requires', basename(fname)[:-3]]
- proc = sp.Popen(cmd, env=env, stdout=sp.PIPE)
- return proc.communicate()[0].split()
-
-
-def Run(fname, root='/', requires=True):
- if not requires:
- lines = file(fname, 'r').readlines()
- newlines = [l for l in lines if l[:10] != 'Requires: ']
- file(fname, 'w').writelines(newlines)
-
- bname = basename(fname)
- if bname[-3:] == '.pc':
- bname = bname[:-3]
-
- env = {'PKG_CONFIG_PATH' : dirname(fname), 'PKG_CONFIG_SYSROOT_DIR' : root}
- cmd = ['pkg-config', '--libs', '--cflags', bname]
- proc = sp.Popen(cmd, env=env, stdout=sp.PIPE)
- out = proc.communicate()[0].strip()
-
- if not requires:
- file(fname, 'w').writelines(lines)
-
- return out
\ No newline at end of file
diff --git a/numbench/report.py b/numbench/report.py
index 986e641..679aa54 100644
--- a/numbench/report.py
+++ b/numbench/report.py
@@ -21,7 +21,7 @@ from shutil import copy as fcopy, copytree, rmtree
import benchconfig as cfg
from utils import benchutils as bu
-from htmlreport import HTMLreport
+from reports.html import ReportFile as HTMLreport
from testdescr import testdescr
from benchprint import Print
diff --git a/numbench/htmlreport.py b/numbench/reports/html.py
similarity index 99%
rename from numbench/htmlreport.py
rename to numbench/reports/html.py
index a0d61b4..356f2ab 100644
--- a/numbench/htmlreport.py
+++ b/numbench/reports/html.py
@@ -21,7 +21,7 @@ from xml.sax.saxutils import escape as xmlescape
import benchconfig as cfg
-class HTMLreport:
+class ReportFile:
def __init__(self, fname, title='Benchmarks report', \
inputfile=pjoin(cfg.reportdir, basename(cfg.inputfile))):
self.fname = fname
reply other threads:[~2012-03-05 15:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1330962349.d4f647843ee0b1a9cc5d8be2d6ec12dfb0dad3c3.spiros@gentoo \
--to=andyspiros@gmail.com \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox