mirror of
https://github.com/kiviktnm/decman.git
synced 2026-09-19 12:08:28 +00:00
Add CLI
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# from import is ok for importing classes and functions
|
||||
# just remember to not import variables this way
|
||||
from decman import Module, sh
|
||||
|
||||
import decman
|
||||
|
||||
|
||||
class MyModule(Module):
|
||||
|
||||
def __init__(self):
|
||||
self.pkgs = ["rust"]
|
||||
super().__init__("Example module", True, "1")
|
||||
|
||||
def enable_my_custom_feature(self, b: bool):
|
||||
if b:
|
||||
self.pkgs = ["rustup"]
|
||||
|
||||
def pacman_packages(self) -> list[str]:
|
||||
return self.pkgs
|
||||
@@ -0,0 +1,9 @@
|
||||
import decman
|
||||
from my_module import MyModule
|
||||
|
||||
my_own_mod = MyModule()
|
||||
|
||||
my_own_mod.enable_my_custom_feature(True)
|
||||
|
||||
decman.packages += ["python", "python"]
|
||||
decman.modules += [my_own_mod]
|
||||
Reference in New Issue
Block a user