Skip to content

Commit

Permalink
code smells removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Simkovic committed Apr 15, 2017
1 parent 015aa15 commit f7d1a7e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion simbad/lattice/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def copy_results(self, pdb_db, dir=os.getcwd()):

for count, result in enumerate(search_results):
if count <= self.max_to_keep:
f_name = os.path.join(pdb_db, '{0}', 'pdb{1}.ent.gz'.format(result.pdb_code[1:3], result.pdb_code))
f_name = os.path.join(pdb_db, '{0}', 'pdb{1}.ent.gz').format(result.pdb_code[1:3], result.pdb_code)
with gzip.open(f_name, 'rb') as f_in:
f_name_out = os.path.join(out_dir, '{0}.pdb'.format(result.pdb_code))
with open(f_name_out, 'w') as f_out:
Expand Down
2 changes: 1 addition & 1 deletion simbad/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self):
def setup(self, optd):

if optd['work_dir']:
logger.info('Making a named work directory: {0}', optd['work_dir'])
logger.info('Making a named work directory: %s', optd['work_dir'])
if os.path.isdir(optd['work_dir']):
msg = "Cannot create work_dir {0}".format(optd['work_dir'])
exit_util.exit_error(msg, sys.exc_info()[2])
Expand Down
2 changes: 1 addition & 1 deletion simbad/util/clusterize.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def submitJob(self, subScript=None, jobDir=None):
command_line='bsub'
stdin = open( subScript, "r")
else:
msg = "Unrecognised QTYPE: ".format(self.QTYPE)
msg = "Unrecognised QTYPE: {0}".format(self.QTYPE)
raise RuntimeError(msg)

logger.debug("Submitting job with command: %s", command_line)
Expand Down
4 changes: 2 additions & 2 deletions simbad/util/logging_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def setup_console_logging(level=logging.INFO,
try:
cl = logging.StreamHandler(stream=sys.stdout)
except TypeError:
cl = logging.StreamHandler(strm=sys.stdout)
cl = logging.StreamHandler(stream=sys.stdout)
cl.setLevel(level)
formatter = logging.Formatter(formatstr)
cl.setFormatter(formatter)
Expand All @@ -48,4 +48,4 @@ def setup_file_logging(logfile,
fl.setFormatter(formatter)
logger.addHandler(fl)

return logger
return logger
2 changes: 1 addition & 1 deletion simbad/util/options_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _exit(msg):

if (optd['mtz'] and optd['sf_cif']):
msg = "Please supply a single crystallographic data file."
_exit(msg, optd['work_dir'])
_exit(msg)

####################################################################################################################
# NEED TO ADD A SECTION HERE TO CHECK THAT DATABASES ARE INSTALLED
Expand Down

0 comments on commit f7d1a7e

Please sign in to comment.