Remove unused assignments in cogran_gui.py
At the moment there are several lines in cogran_gui.py
, that contain assignments to variables that apparently are not used. Especially the with statements with fiona.open
are not used correctly and should be refactored. To keep flake8 quiet for the moment and point to these issues here # noqa
has been added to the respective lines.
Output of cat cogran/gui/cogran_gui.py | grep -C2 -n --colour 'noqa'
:
97-
98- # for the readers we need to collect all the driver's extensions
99: fiona_readers = [ # noqa
100- d for (d, modes) in supported_drivers.items() if "r" in modes
101- ]
--
111-
112- # for the writers the user chooses their own extension, we just need the drivers
113: fiona_writers = [ # noqa
114- d for (d, modes) in supported_drivers.items() if "w" in modes
115- ]
--
492- try:
493- # try to open it with fiona to make sure it is valid
494: with fiona.open(filepath, "r") as source: # noqa
495- self.source = filepath
496- self.textBrowserFeedback.append(
--
525- try:
526- # try to open it with fiona to make sure it is valid
527: with fiona.open(filepath, "r") as target: # noqa
528- self.target = filepath
529- self.textBrowserFeedback.append(
--
560- try:
561- # try to open it with fiona to make sure it is valid
562: with fiona.open(filepath, "r") as mask: # noqa
563- self.mask = filepath
564- self.textBrowserFeedback.append(f"Mask file '{self.mask}' selected.")
Edited by Philipp Loose