Skip to content
Snippets Groups Projects

Resolve "Table with all PDB files, to make them available to download"

Merged Remi PLANEL requested to merge table-structure-with-molstar into dev
Compare and Show latest version
2 files
+ 40
1
Compare changes
  • Side-by-side
  • Inline
Files
2
import typer
import sys
import re
import shutil
from typing_extensions import Annotated
from typing import Optional, List
from pathlib import Path
@@ -72,3 +74,40 @@ def lint(
sys.exit(1)
else:
console.print("[green] Everything is alright")
@app.command()
def structure(
dir: Annotated[
Path,
typer.Option(
exists=True,
file_okay=False,
dir_okay=True,
writable=False,
readable=True,
resolve_path=True,
),
],
output: Annotated[
Path,
typer.Option(
exists=True,
file_okay=False,
dir_okay=True,
writable=True,
readable=True,
resolve_path=True,
),
],
):
console.rule(f"[bold blue]{dir.name}", style="blue")
for f in dir.iterdir():
console.print(f"[green] {f.name}")
# get the system name
system = re.split("_|\.", f.name)[0].lower()
console.print(system)
systemDir = output / system
systemDir.mkdir(parents=True, exist_ok=True)
shutil.copy2(f, systemDir)