def find_c(self, path): '''Return the commander associated with path, or None.''' g = self.g self.update() path = g.os_path_normcase(path) short_path = g.shortFileName(path) for c in self.commanders_list: fn = g.os_path_normcase(c.fileName()) short_fn = g.shortFileName(fn) if fn == path or short_fn == short_path: return c
def find_c(self,path): '''Return the commander associated with path, or None.''' g = self.g self.update() path = g.os_path_normcase(path) short_path = g.shortFileName(path) for c in self.commanders_list: fn = g.os_path_normcase(c.fileName()) short_fn = g.shortFileName(fn) if fn == path or short_fn == short_path: return c
def find_c(self, path): """Return the commander associated with path, or None.""" g = self.g # type:ignore # mypy seems confused. g is a local var. self.update() path = g.os_path_normcase(path) short_path = g.shortFileName(path) for c in self.commanders_list: fn = g.os_path_normcase(c.fileName()) short_fn = g.shortFileName(fn) if fn == path or short_fn == short_path: return c return None