Skip to content

Commit

Permalink
Lint check
Browse files Browse the repository at this point in the history
  • Loading branch information
Obijuan committed Jun 26, 2024
1 parent a4a01ba commit 42bfbac
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"type": "debugpy",
"request": "launch",
"program": "icm-run.py",
"args": ["install","iceK", "iceWires"],
"args": ["install","iceK", "iceWires", "--all"],
//"console": "internalConsole",
"console": "integratedTerminal",
"justMyCode": true,
Expand Down
7 changes: 5 additions & 2 deletions icm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ def info():
@click.option(
"-d", "--dev", is_flag=True, help="Install latest development version"
)
def install(coltag, dev):
@click.option(
"-a", "--all", is_flag=True, help="Install all stable collections"
)
def install(coltag, dev, all_):
"""Install collections"""

cmd_install.main(coltag, dev)
cmd_install.main(coltag, dev, all_)


@cli.command()
Expand Down
11 changes: 10 additions & 1 deletion icm/commands/cmd_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@

import click
from icm.commons import commons
from icm.commons import store


def main(coltags: tuple, dev: bool) -> None:
def main(coltags: tuple, dev: bool = False, all_: bool = False) -> None:
"""ENTRY POINT: Install collections
* coltag: tupla de nombres de la coleccion + tag opcional
Ex. (iceK, iceK@0.1.4)
* dev: Install development version
* all: Install ALL stable collections
"""

# -- Get context information
Expand All @@ -20,6 +22,13 @@ def main(coltags: tuple, dev: bool) -> None:

print()

# -- "--all" has the highest priority
# -- First check it!
if all_:
for coltag in store.COLLECTIONS["stable"]:
install_collection(collection, coltag, dev)
return

# -- Install the collections!
for coltag in coltags:
install_collection(collection, coltag, dev)
Expand Down
51 changes: 2 additions & 49 deletions icm/commands/cmd_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,7 @@

import click
from icm.commons import commons


# -- AVAILABLE collections
COLLECTION_STORE = {
"stable": [
"iceK",
"iceWires",
"iceIO",
"iceGates",
"iceMux",
"iceCoders",
"iceFF",
"iceRegs",
"iceSRegs",
],
"dev": [
"iceBoards",
"iceComp",
"iceArith",
"iceCounters",
"iceSignals",
"icePLL",
"iceLEDOscope",
"iceLEDs",
"iceHearts",
"iceInputs",
"iceRok",
"iceMachines",
"iceSerial",
"iceMem",
"iceMeassure",
"iceStack",
"iceFlash",
"iceBus",
"iceLCD",
"iceSynth",
"icecrystal",
"icebreaker",
"Collection-stdio",
"LOVE-FPGA-Collection",
"Collection-Jedi",
"CT11-collection",
"collection-generic",
"collection-logic",
"ice-chips-verilog",
"Icestudio-ArithmeticBlocks",
],
}
from icm.commons import store


def list_collections(
Expand All @@ -64,7 +17,7 @@ def list_collections(

click.secho(f"{'Name':<15} {'Version':<8} Description", fg=fg)
click.secho(f"{'─'*15:<15} {'─'*8:<8} {'─'*20}", fg=fg)
for name in COLLECTION_STORE[typec]:
for name in store.COLLECTIONS[typec]:

# Calculate the url for the collection package.json file
url = collection.package_url(name)
Expand Down
2 changes: 2 additions & 0 deletions icm/commons/store.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Collection store!: Available collections"""

COLLECTIONS = {
"stable": [
"iceK",
Expand Down

0 comments on commit 42bfbac

Please sign in to comment.