comparison COBRAxy/utils/general_utils.py @ 340:da4f5f4a9046 draft

Uploaded
author luca_milaz
date Thu, 04 Sep 2025 12:51:12 +0000
parents 1fd4e4e93c85
children fe87d6fd7884
comparison
equal deleted inserted replaced
339:1fd4e4e93c85 340:da4f5f4a9046
80 """ 80 """
81 # If we have an original extension stored (for compressed files), use it 81 # If we have an original extension stored (for compressed files), use it
82 if hasattr(self, '_original_extension') and self._original_extension: 82 if hasattr(self, '_original_extension') and self._original_extension:
83 return self._original_extension 83 return self._original_extension
84 84
85 # TODO: fix, it's the dumb pickle thing keep this behaviour if we are not dealing with XML or JSON 85 # For XML and JSON without original extension, use the base extension
86 if self == FileFormat.XML:
87 return "xml"
88 elif self == FileFormat.JSON:
89 return "json"
90
86 return self.value[-1] 91 return self.value[-1]
87 92
88 class FilePath(): 93 class FilePath():
89 """ 94 """
90 Represents a file path. View this as an attempt to standardize file-related operations by expecting 95 Represents a file path. View this as an attempt to standardize file-related operations by expecting