Skip to content

Commit

Permalink
Create temp directory into output directory and download there (#73)
Browse files Browse the repository at this point in the history
Create temp directory into output directory and download there
  • Loading branch information
rannick authored Oct 4, 2024
1 parent 0bf0097 commit db6c60e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 5 additions & 6 deletions fusion_report/common/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,11 @@ def get_mitelman(self, return_err: List[str]) -> None:

@staticmethod
def clean():
"""Remove all files except *db."""
for temp in glob.glob("*/"):
shutil.rmtree(temp)
for temp in glob.glob("*[!.db]"):
if not os.path.isdir(temp):
os.remove(temp)
"""Remove all files except *db and move to output dir."""
for temp in glob.glob("*.db"):
shutil.copy(temp, "../")
os.chdir("../")
shutil.rmtree("tmp_dir")

@staticmethod
def timestamp():
Expand Down
5 changes: 4 additions & 1 deletion fusion_report/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def download_all(self, params: Namespace) -> None:

"""Download all databases."""
return_err: List[str] = []
os.chdir(params.output)
tmp_dir = os.path.join(params.output, "tmp_dir")
if not os.path.exists(tmp_dir):
os.mkdir(tmp_dir)
os.chdir(tmp_dir)

if not params.no_mitelman:
# MITELMAN
Expand Down

0 comments on commit db6c60e

Please sign in to comment.