Exemple #1
0
 def replace_study_name(data: JSON) -> None:
     if isinstance(data, dict):
         for key, value in data.items():
             if isinstance(value, str) and value.startswith("file/"):
                 data[key] = value.replace(uuid, source_study_name)
             else:
                 replace_study_name(value)
    def save(self, data: JSON, url: Optional[List[str]] = None) -> None:
        if not self.config.path.exists():
            self.config.path.mkdir()

        if url:
            RawFileNode(config=self.config.next_file(url[0])).save(str(data))
        else:
            for file, content in data.items():
                RawFileNode(config=self.config.next_file(file)).save(
                    str(content))