Skip to content

Commit

Permalink
Merge pull request #5 from boegel/generaloption
Browse files Browse the repository at this point in the history
fixing remarks
  • Loading branch information
stdweird committed Feb 15, 2013
2 parents 8c50da6 + c9891dc commit da3b6b7
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion easybuild/framework/extensioneasyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
EasyBuild support for building and installing extensions as actual extensions or as stand-alone modules,
implemented as an easyblock
@authors: Kenneth Hoste (Ghent University)
@author: Kenneth Hoste (Ghent University)
"""
import copy
import os
Expand Down
16 changes: 8 additions & 8 deletions easybuild/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def parse_options(args=None, logfile=None):
(options, paths, opt_parser) = eboptions.parse_options(args=args)

if not logfile:
# mkstemp returns (fd,filename), fd is from os.open, not regular open!
fd, logfile = tempfile.mkstemp(suffix='.log', prefix='easybuild-')
os.close(fd)
# mkstemp returns (fd,filename), fd is from os.open, not regular open!
fd, logfile = tempfile.mkstemp(suffix='.log', prefix='easybuild-')
os.close(fd)

if options.logtostdout:
if os.path.exists(logfile):
Expand Down Expand Up @@ -267,7 +267,7 @@ def main(args=None, keep_logs=False, logfile=None, exit_on_error=True):

if any([options.avail_easyconfig_params, options.list_easyblocks, options.list_toolchains, options.search,
options.version, options.regtest]):
if logfile and not keep_log:
if logfile and not keep_logs:
os.remove(logfile)
sys.exit(0)

Expand Down Expand Up @@ -393,7 +393,7 @@ def main(args=None, keep_logs=False, logfile=None, exit_on_error=True):
try:
remove_log_handler(hn)
hn.close()
if logfile and not keep_log:
if logfile and not keep_logs:
os.remove(logfile)

for ec in easyconfigs:
Expand All @@ -403,10 +403,10 @@ def main(args=None, keep_logs=False, logfile=None, exit_on_error=True):
except IOError, err:
error("Something went wrong closing and removing the log %s : %s" % (logfile, err))

if keep_log:
if keep_logs:
return logfile

def error(message, log, exitCode=1, opt_parser=None, exit_on_error=True):
def error(message, log=None, exitCode=1, opt_parser=None, exit_on_error=True):
"""
Print error message and exit EasyBuild
"""
Expand All @@ -416,7 +416,7 @@ def error(message, log, exitCode=1, opt_parser=None, exit_on_error=True):
opt_parser.print_shorthelp()
print_msg("ERROR: %s\n" % message)
sys.exit(exitCode)
else:
elif log:
log.error(message)

def warning(message):
Expand Down
2 changes: 1 addition & 1 deletion easybuild/test/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_no_args(self):
os.close(fd)

try:
logf = main(args=[], exit_on_error=False, logfile=logfile)
main(args=[], exit_on_error=False, logfile=logfile, keep_logs=True)
except:
pass
outtxt = open(logfile, 'r').read()
Expand Down
2 changes: 1 addition & 1 deletion easybuild/toolchains/iiqmpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"""
EasyBuild support for iiqmpi compiler toolchain (includes Intel compilers, QLogicMPI).
@authors: Kenneth Hoste (UGent)
@author: Kenneth Hoste (Ghent University)
"""

from easybuild.toolchains.compiler.inteliccifort import IntelIccIfort
Expand Down
2 changes: 1 addition & 1 deletion easybuild/toolchains/iqacml.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"""
EasyBuild support for iqacml compiler toolchain (includes Intel compilers, QLogicMPI, ACML, BLACS, ScaLAPACK and FFTW).
@authors: Kenneth Hoste (UGent)
@author: Kenneth Hoste (Ghent University)
"""

from easybuild.toolchains.compiler.inteliccifort import IntelIccIfort
Expand Down
2 changes: 1 addition & 1 deletion easybuild/tools/build_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def init_logger(name=None, version=None, debug=False, filename=None, typ='UNKNOW
filename = log_filename(name, version)
hand = fancylogger.logToFile(filename, name=typ)
else:
hand = fancylogger.logToScreen(True)
hand = fancylogger.logToScreen(True, name=typ)

# initialize our logger
log = fancylogger.getLogger(typ)
Expand Down
12 changes: 6 additions & 6 deletions easybuild/tools/module_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
"""
Generating module files.
@authors: Stijn De Weirdt (UGent)
@authors: Dries Verdegem (UGent)
@authors: Kenneth Hoste (UGent)
@authors: Pieter De Baets (UGent)
@authors: Jens Timmerman (UGent)
@authors: Fotis Georgatos (Uni.Lu)
@author: Stijn De Weirdt (Ghent University)
@author: Dries Verdegem (Ghent University)
@author: Kenneth Hoste (Ghent University)
@author: Pieter De Baets (Ghent University)
@author: Jens Timmerman (Ghent University)
@author: Fotis Georgatos (Uni.Lu)
"""
import os
import shutil
Expand Down
2 changes: 1 addition & 1 deletion easybuild/tools/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"""
Module with various utility functions
@authors: Kenneth Hoste (UGent)
@author: Kenneth Hoste (Ghent University)
"""

# FIXME: remove when Python version on which we rely provides any by itself
Expand Down

0 comments on commit da3b6b7

Please sign in to comment.