Gentoo Archives: gentoo-commits

From: Andrea Arteaga <andyspiros@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/, numbench/confinput/, numbench/utils/
Date: Thu, 01 Mar 2012 11:05:14
Message-Id: 1330599769.0da125e3d4a0dc3c6893a2f35773a9bf68930901.spiros@gentoo
1 commit: 0da125e3d4a0dc3c6893a2f35773a9bf68930901
2 Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
3 AuthorDate: Thu Mar 1 11:02:49 2012 +0000
4 Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
5 CommitDate: Thu Mar 1 11:02:49 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=0da125e3
7
8 Moved benchutils and portageutils to utils/.
9
10 ---
11 numbench/benchprint.py | 3 ++-
12 numbench/confinput/xmlinput.py | 4 ++--
13 numbench/main.py | 10 +++-------
14 numbench/report.py | 2 +-
15 numbench/{ => utils}/benchutils.py | 0
16 numbench/utils/btl.py | 4 ++--
17 .../{PortageUtils.py => utils/portageutils.py} | 6 +++---
18 7 files changed, 13 insertions(+), 16 deletions(-)
19
20 diff --git a/numbench/benchprint.py b/numbench/benchprint.py
21 index 3f3e577..0cbd0b6 100644
22 --- a/numbench/benchprint.py
23 +++ b/numbench/benchprint.py
24 @@ -22,7 +22,8 @@ except NameError:
25
26
27 if needsinitialization:
28 - import benchconfig as cfg, benchutils as bu
29 + import benchconfig as cfg
30 + from utils import benchutils as bu
31 from os.path import dirname, join as pjoin
32
33 class _Print:
34
35 diff --git a/numbench/confinput/xmlinput.py b/numbench/confinput/xmlinput.py
36 index 4743730..0a44b7c 100644
37 --- a/numbench/confinput/xmlinput.py
38 +++ b/numbench/confinput/xmlinput.py
39 @@ -4,7 +4,7 @@ import subprocess as sp
40 from os.path import join as pjoin, dirname as pdirname, realpath as prealpath
41
42 from .. import benchconfig as cfg
43 -from .. import PortageUtils as pu
44 +from ..utils import portageutils as pu
45
46
47 def readFile(fs):
48 @@ -151,4 +151,4 @@ def parseConf(fname):
49 logdir = pjoin(cfg.logdir, tid)
50 )
51
52 - return tests
53 \ No newline at end of file
54 + return tests
55
56 diff --git a/numbench/main.py b/numbench/main.py
57 index 1285c18..fd2cf05 100644
58 --- a/numbench/main.py
59 +++ b/numbench/main.py
60 @@ -92,13 +92,10 @@ if sys.argv[2] in ('-h', '--help'):
61 import re
62 from fnmatch import fnmatch
63 from os.path import join as pjoin
64 -import benchconfig as cfg, benchutils as bu, confinput
65 -from benchprint import Print
66 -import PortageUtils as pu
67 -import report
68
69 -#from PortageUtils import \
70 -# normalize_cpv, install_dependencies, install_package, InstallException
71 +import benchconfig as cfg, confinput, report
72 +from utils import benchutils as bu, portageutils as pu
73 +from benchprint import Print
74
75
76 # Parse the configuration file
77 @@ -109,7 +106,6 @@ if not os.path.exists(cfg.inputfile):
78 cfg.tests = confinput.parseInput(cfg.inputfile)
79
80 # Import the module
81 -#os.chdir(cfg.scriptdir)
82 mod = loadModule(cfg.modulename).Module(sys.argv[3:])
83 cfg.mod = mod
84
85
86 diff --git a/numbench/report.py b/numbench/report.py
87 index ecb13b0..986e641 100644
88 --- a/numbench/report.py
89 +++ b/numbench/report.py
90 @@ -20,7 +20,7 @@ import sys, numpy as np
91 from shutil import copy as fcopy, copytree, rmtree
92
93 import benchconfig as cfg
94 -import benchutils as bu
95 +from utils import benchutils as bu
96 from htmlreport import HTMLreport
97 from testdescr import testdescr
98 from benchprint import Print
99
100 diff --git a/numbench/benchutils.py b/numbench/utils/benchutils.py
101 similarity index 100%
102 rename from numbench/benchutils.py
103 rename to numbench/utils/benchutils.py
104
105 diff --git a/numbench/utils/btl.py b/numbench/utils/btl.py
106 index 1f06f67..541ff1e 100644
107 --- a/numbench/utils/btl.py
108 +++ b/numbench/utils/btl.py
109 @@ -15,7 +15,8 @@
110 # along with this program; if not, write to the Free Software
111 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
112 #
113 -from .. import benchchildren, benchutils as bu, benchconfig as cfg
114 +from .. import benchchildren, benchconfig as cfg
115 +from ..utils import benchutils as bu
116 from ..benchprint import Print
117
118 from os.path import join as pjoin, dirname
119 @@ -27,7 +28,6 @@ btllibraries = ('rt',)
120 btldefines = ('NDEBUG',)
121
122
123 -
124 def compileTest(test, btlconfig):
125
126 # Include directories
127
128 diff --git a/numbench/PortageUtils.py b/numbench/utils/portageutils.py
129 similarity index 98%
130 rename from numbench/PortageUtils.py
131 rename to numbench/utils/portageutils.py
132 index 1da968d..41c0cdc 100644
133 --- a/numbench/PortageUtils.py
134 +++ b/numbench/utils/portageutils.py
135 @@ -19,7 +19,7 @@ import commands as cmd
136 import subprocess as sp
137 import os, portage, shlex
138 from os.path import join as pjoin, dirname
139 -import benchutils
140 +from utils import benchutils as bu
141
142 class InstallException(Exception):
143 def __init__(self, package, command, logfile):
144 @@ -150,7 +150,7 @@ def installPackage(test, package=None, env=None, logfile=None):
145 pkg = normalize_cpv(package)
146
147 # Execute emerge command and log the results
148 - benchutils.mkdir(dirname(logfile))
149 + bu.mkdir(dirname(logfile))
150 fout = file(logfile, 'w')
151 cmd = ['emerge', '--ignore-default-opts', '-OB', '=' + pkg]
152 p = sp.Popen(cmd, env=denv, stdout=fout, stderr=sp.STDOUT)
153 @@ -164,7 +164,7 @@ def installPackage(test, package=None, env=None, logfile=None):
154
155 # Unpack package onto root
156 archive = pjoin(test['pkgdir'], pkg+'.tbz2')
157 - benchutils.mkdir(test['root'])
158 + bu.mkdir(test['root'])
159 tarcmd = ['tar', 'xjvf', archive, '-C', test['root']]
160 fout.write(' '.join(tarcmd) + '\n' + 80*'-' + '\n')
161 p = sp.Popen(tarcmd, stdout=fout, stderr=sp.STDOUT)