Skip to content

Commit

Permalink
Make code prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
matrulda committed Feb 1, 2019
1 parent 032488b commit 6688898
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions runfolder/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ def __init__(self, host, path, state, metadata):
self.path = path
self.state = state
self.service_version = version
if metadata:
self.metadata = metadata
else:
self.metadata = {}
self.metadata = metadata

def __repr__(self):
return "{0}: {1}@{2}".format(self.state, self.path, self.host)
Expand Down Expand Up @@ -164,7 +161,7 @@ def get_runfolder_by_path(self, path):
if not self._dir_exists(path):
raise DirectoryDoesNotExist("Directory does not exist: '{0}'".format(path))
info = RunfolderInfo(self._host(), path, self.get_runfolder_state(path),
self.get_metadata(path))
self.get_metadata(path))
return info

def _get_runfolder_state_from_state_file(self, runfolder):
Expand Down Expand Up @@ -303,10 +300,10 @@ def get_reagent_kit_barcode(self, path, run_parameters):
# Reagent kit barcode is not available for all run types,
# it is therefore expected to not be found in all cases
self._logger.debug("Reagent kit barcode not found")
barcode = None
return None
except TypeError:
self._logger.debug("[Rr]unParameters.xml not found")
barcode = None
return None
return barcode

def get_library_tube_barcode(self, path, run_parameters):
Expand All @@ -316,10 +313,10 @@ def get_library_tube_barcode(self, path, run_parameters):
# Library tube barcode is not available for all run types,
# it is therefore expected to not be found in all cases
self._logger.debug("Library tube barcode not found")
barcode = None
return None
except TypeError:
self._logger.debug("[Rr]unParameters.xml not found")
barcode = None
return None
return barcode

def read_run_parameters(self, path):
Expand Down
2 changes: 1 addition & 1 deletion runfolder_tests/unit/runfolder_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_list_available_runfolders(self):

runfolders_str = sorted([str(runfolder) for runfolder in runfolders])
expected = ["ready: /data/testarteria1/mon1/runfolder001@localhost",
"ready: /data/testarteria1/mon2/runfolder001@localhost"]
"ready: /data/testarteria1/mon2/runfolder001@localhost"]
self.assertEqual(runfolders_str, expected)

def test_next_runfolder(self):
Expand Down

0 comments on commit 6688898

Please sign in to comment.