Skip to content
Snippets Groups Projects
Commit 9c241d08 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

add a command to organize structure files

parent c5c010d0
No related branches found
No related tags found
1 merge request!134Resolve "Table with all PDB files, to make them available to download"
Pipeline #118263 passed with stages
in 7 minutes and 33 seconds
import typer import typer
import sys import sys
import re
import shutil
from typing_extensions import Annotated from typing_extensions import Annotated
from typing import Optional, List from typing import Optional, List
from pathlib import Path from pathlib import Path
...@@ -72,3 +74,40 @@ def lint( ...@@ -72,3 +74,40 @@ def lint(
sys.exit(1) sys.exit(1)
else: else:
console.print("[green] Everything is alright") 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)
[tool.poetry] [tool.poetry]
name = "df-wiki-cli" name = "df-wiki-cli"
version = "0.1.1" version = "0.1.2"
description = "" description = ""
authors = ["Remi PLANEL <rplanel@pasteur.fr>"] authors = ["Remi PLANEL <rplanel@pasteur.fr>"]
readme = "README.md" readme = "README.md"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment