mylinux package¶
Subpackages¶
Submodules¶
mylinux.Controller module¶
-
class
mylinux.Controller.
Controller
(filesPath)[source]¶ Bases:
object
Main MVC controller of the package.
Parameters: filesPath (str) – Path to the file where main data is located.
Variables: - _Controller__inited (boo) – If False class was not inited yet.
- Files (ins) – Files instance.
Raises: AppErr.developer
– If singletone was allready inited.Note
This class is singletone which checks
__inited
, if instance was allready created.-
execute
(ACTION, CONFIG=False, PACKAGE_NAMES=None)[source]¶ Executing actions on packages.
Parameters: - ACTION (str) – Execute action on packages.
- CONFIG (boo) – If action will be made on package config too.
- PACKAGE_NAMES (arr-str) – Name of package folder.
Other Parameters: - Start TUI if you want to select packages.
- Create checks if action is allowed for all selected packages.
- Execute action on packages.
- Make report of executing.
-
create
(PACKAGE_NAME)[source]¶ Guide to create new package.
Parameters: PACKAGE_NAME (str) – Package to be created.
Other Parameters: - Get existing packages.
- Check if candidate already exist.
- Start TUI for input package info.
- Make file structure for package.
-
logs
(PACKAGE_NAME)[source]¶ Show logs
Parameters: PACKAGE_NAME (str) – Package name Other Parameters: Start TUI for logs
-
script
(SCRIPT_NAME)[source]¶ Execute main mylinux scripts
Parameters: SCRIPT_NAME (str) – Name of the script that is located in base scripts folder
Other Parameters: - Get info from the script.
- Execute script line by line.
- Print report
-
test
()[source]¶ Make tests on already installed packages.
Other Parameters: - Get installed packages.
- Execute test script for each package.
- Make report.
-
check
()[source]¶ Check for errors for installed packages.
Other Parameters: - Check config/package state for every installed package.
- Make report.
-
_Controller__executeSelected
(PACKAGE_NAMES)¶ Execute selected packages
Parameters: PACKAGE_NAMES (arg-str) – Execute selected package names.
Other Parameters: - Make execute decisions for packages.
- Execute package scripts with executor.
- Update package info data in installed.
- Override installed data.
- If user want to exit wait for data to be writen.
- If user wants really to exit raise user error.
-
_Controller__inited
= False¶
-
_Controller__postExecuteReport
(PACKAGE_NAMES)¶ Post execute report for packages
Parameters: PACKAGE_NAMES (arg-str) – Package names to be subject of reporting.
Other Parameters: - Get packages states.
- Report all packages states and if they pass
-
_Controller__postSelectCheck
(ACTION, CONFIG, PACKAGE_NAMES)¶ Post check after selection.
Parameters: - ACTION (str) – Action that were executed.
- CONFIG (boo) – Were action done ono config too?
- PACKAGE_NAMES (arr-str) – Action were done on these packages.
Other Parameters: - Check existance of packages in package folder.
- Check existance in installed and permissions of executing action.
- If checks fails show user error report.
- Override selected package installed flags for them to be executed.
-
_Controller__tuiCreate
(PACKAGE_NAME)¶ Start TUI for package creation.
Parameters: PACKAGE_NAME (str) – Package to be created.
Returns: Dic object similar to argument
modelValues
. For more info see source.Other Parameters: - Start TUI for creation.
- Return all info obout the new package.
-
_Controller__tuiLogs
(PACKAGE_NAME)¶ Start TUI for package log.
Parameters: PACKAGE_NAME (str) – Name of the installed package.
Other Parameters: - Get ``stderr`` and ``stdout`` info from package in installed.
- Start logs TUI.
-
_Controller__tuiSelect
(ACTION, CONFIG)¶ Start TUI for selecting packages.
Parameters: - ACTION (str) – Joust for user visualization in TUI.
- CONFIG (str) – Joust for user vis. in TUI
Returns: Arr-str of selected packages names.
Other Parameters: - Get packages base on action and config.
- Start TUI for selecting packages.
Module contents¶
Module will not import any other packages/modules only what is needed for setup.py and docs. configuration.
Other Parameters: | |
---|---|
|
Entry points¶
Main text user interface for application.
Main file for all entry points for this project.
-
mylinux.__main__.
main
(ARGV=None, TESTING=False)[source]¶ Main mylinux entry point method.
Parameters: - ARGV (arr) – User defined sys.argv array.
- TESTING (boo) – If true reset all singletones for possible rerun.
Raises: AppErr.model
– If controller produce error obout mylinux models.AppErr.user
– If user make error.AppErr.developer
– If developer makes mistake.Exception
– If unknown error is produced by controller.
Other Parameters: - If testing reset singletones.
- Init main controller.
- Call controller
- Send exit codes to shell.
Note
Method will produce at the end of the executing
exit code
that will be passed to the shell.