Skip to content

Commit

Permalink
style(base): use basename for FileNotFoundError exception
Browse files Browse the repository at this point in the history
  • Loading branch information
hahnec committed Sep 30, 2019
1 parent b07e27a commit 5de1551
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plenopticam/lfp_reader/top_level.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# local imports
from plenopticam import misc
from plenopticam.misc.errors import LfpTypeError, PlenopticamError
from plenopticam.misc.errors import LfpTypeError
from plenopticam.lfp_reader.lfp_decoder import LfpDecoder

import os
Expand Down Expand Up @@ -35,9 +35,9 @@ def main(self):
if os.path.exists(fp):
try:
self._lfp_img = misc.load_img_file(fp)
except FileNotFoundError as e:
except FileNotFoundError:
# print status
self.sta.status_msg('File {0} not found'.format(self._lfp_path), self.cfg.params[self.cfg.opt_prnt])
self.sta.status_msg('{0} not found'.format(os.path.basename(self._lfp_path)), self.cfg.params[self.cfg.opt_prnt])
self.sta.progress(100, self.cfg.params[self.cfg.opt_prnt])
self.sta.error = True
except TypeError as e:
Expand Down Expand Up @@ -70,7 +70,7 @@ def main(self):

except FileNotFoundError as e:
# print status
self.sta.status_msg('File {0} not found'.format(self._lfp_path), self.cfg.params[self.cfg.opt_prnt])
self.sta.status_msg('{0} not found'.format(os.path.basename(self._lfp_path)), self.cfg.params[self.cfg.opt_prnt])
self.sta.progress(100, self.cfg.params[self.cfg.opt_prnt])
self.sta.error = True
except Exception as e:
Expand Down

0 comments on commit 5de1551

Please sign in to comment.