Skip to content

Commit

Permalink
refactor:: only import when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
kraanzu committed Mar 26, 2024
1 parent 052d971 commit 7d45130
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions smassh/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import click
from smassh.src.plugins.add_language import AddLanguage
from smassh.ui.tui import Smassh

PKG_VERSION = "3.1.3"

Expand All @@ -21,12 +19,16 @@ def main(ctx, version: bool) -> None:
return print(f"smassh - v{PKG_VERSION}")

if ctx.invoked_subcommand is None:
from smassh.ui.tui import Smassh

Smassh().run()


@main.command(help="Add a language to smassh")
@click.argument("name")
def add(name: str) -> None:
from smassh.src.plugins.add_language import AddLanguage

AddLanguage().add(name)


Expand Down
6 changes: 4 additions & 2 deletions smassh/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import click
from smassh.src.plugins.add_language import AddLanguage
from smassh.ui.tui import Smassh

PKG_VERSION = "3.1.3"

Expand All @@ -21,12 +19,16 @@ def main(ctx, version: bool) -> None:
return print(f"smassh - v{PKG_VERSION}")

if ctx.invoked_subcommand is None:
from smassh.ui.tui import Smassh

Smassh().run()


@main.command(help="Add a language to smassh")
@click.argument("name")
def add(name: str) -> None:
from smassh.src.plugins.add_language import AddLanguage

AddLanguage().add(name)


Expand Down

0 comments on commit 7d45130

Please sign in to comment.