Commit 0260177415a5af65ef74021a8f724f1805aa4abe

Authored by Alain Klotz
1 parent 78ec8c2b
Exists in master

add method fonctexts_human

Showing 1 changed file with 15 additions and 0 deletions   Show diff stats
src/guitastro/filenames.py
... ... @@ -2882,6 +2882,21 @@ class FileNames(FileNamesException, GuitastroTools):
2882 2882 self.extension = fn.extension
2883 2883 self._context_set("default")
2884 2884  
  2885 + def fcontexts_human(self) -> str:
  2886 + """Return a human reading description of all file contexts. Each file context is described in one line.
  2887 +
  2888 + Returns:
  2889 +
  2890 + Each file context is described in one line.
  2891 + """
  2892 + text = ""
  2893 + fcname0 = self.fcontext
  2894 + for fcname in self.fcontexts:
  2895 + self.fcontext = fcname
  2896 + text += f"{fcname} : {self.fdescription} {self.rootdir}/[{self.pathing()}]/[{self.naming()}]{self.extension}\n"
  2897 + self.fcontext = fcname0
  2898 + return text
  2899 +
2885 2900 # =============================================
2886 2901 # Managing filenames
2887 2902 # =============================================
... ...