-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lunik <lunik@tiwabbit.fr>
- Loading branch information
Showing
5 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,7 @@ tasks: | |
PACKAGE: "{{ .NAME }}" | ||
sources: | ||
- setup.py | ||
- lib/**/* | ||
generates: | ||
- "{{ .VENV_DIR }}/*" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
""" | ||
Define the Virtualenv list module. | ||
This module is used to list virtualenv in the system. | ||
""" | ||
import os | ||
|
||
from laflem.log import console | ||
from laflem.collections.base.helloworld import HelloWorldModule | ||
|
||
from .const import VIRTUALENV_DEFAULT_FOLDER_NAME, PACKAGE_NAME | ||
|
||
|
||
class VirtualenvListModule(HelloWorldModule): | ||
""" | ||
The Virtualenv list module. | ||
""" | ||
|
||
name = "venv-list" | ||
description = "List Virtualenvs." | ||
version = "0.1.0" | ||
|
||
def _main(self, *_args, **_kwargs): | ||
""" | ||
Core the module. | ||
""" | ||
|
||
venv_path = f"{os.path.expanduser('~')}/.{PACKAGE_NAME}/python/{VIRTUALENV_DEFAULT_FOLDER_NAME}" | ||
|
||
for venv in os.listdir(venv_path): | ||
full_path = f"{venv_path}/{venv}" | ||
console.print(f"- [bold blue]{venv}[/] located at [green]{full_path}[/]") |