CustomShell (version 0.1.0)
index
customshell.py

This file implements a Custom Shell.

 
Modules
       
logging
os
ntpath
platform
sys

 
Classes
       
cmd.Cmd(builtins.object)
Shell

 
class Shell(cmd.Cmd)
    This class implement the custom shell.
 
 
Method resolution order:
Shell
cmd.Cmd
builtins.object

Methods defined here:
__init__(self)
Instantiate a line-oriented interpreter framework.
 
The optional argument 'completekey' is the readline name of a
completion key; it defaults to the Tab key. If completekey is
not None and the readline module is available, command completion
is done automatically. The optional arguments stdin and stdout
specify alternate input and output file objects; if not specified,
sys.stdin and sys.stdout are used.
check_config_file(self) -> bool
Check the config file and write it (with default config) if not exist.
complete_help(self, *args)
This function returns a empty list.
completedefault(self, text: str, line: str, begidx: str, endidx: str) -> List[str]
This function defines the default completion (files an directories).
completenames(self, line: str, state: str)
This function defines the default completion (files an directories).
default(self, arg: str) -> bool
Execute command line.
do_GetConfigFile(self, arg: str) -> bool
Command to get the configuration file path.
do_cd(self, arg: str) -> bool
Command cd to change the current directory.
do_configfile(self, arg: str) -> bool
Command to get the configuration file path.
do_exit(self, arg: str) -> bool
Command exit, quit and close the shell with error code 0.
do_help(self, arg: str) -> bool
Command help.
do_quit(self, arg: str) -> bool
Command exit, quit and close the shell with error code 0.
format(self, string: str) -> str
This fonction format string template.
get_config(self, section: str, value: str) -> ~Config
This function return config or None
get_last_command_state(self)
This function returns the status of the last command.
postcmd(self, stop: bool, arg: str) -> bool
This function re-write the prompt value.
postloop(self) -> None
This function print quit and change the Unix Shell Color.
precmd(self, arg: str) -> str
This function change ALIAS into real command.
preloop(self) -> None
This function print intro and change the Unix Shell Color.

Methods inherited from cmd.Cmd:
cmdloop(self, intro=None)
Repeatedly issue a prompt, accept input, parse an initial prefix
off the received input, and dispatch to action methods, passing them
the remainder of the line as argument.
columnize(self, list, displaywidth=80)
Display a list of strings as a compact set of columns.
 
Each column is only as wide as necessary.
Columns are separated by two spaces (one was not legible enough).
complete(self, text, state)
Return the next possible completion for 'text'.
 
If a command has not been entered, then complete against command list.
Otherwise try to call complete_<command> to get list of completions.
emptyline(self)
Called when an empty line is entered in response to the prompt.
 
If this method is not overridden, it repeats the last nonempty
command entered.
get_names(self)
onecmd(self, line)
Interpret the argument as though it had been typed in response
to the prompt.
 
This may be overridden, but should not normally need to be;
see the precmd() and postcmd() methods for useful execution hooks.
The return value is a flag indicating whether interpretation of
commands by the interpreter should stop.
parseline(self, line)
Parse the line into a command name and a string containing
the arguments.  Returns a tuple containing (command, args, line).
'command' and 'args' may be None if the line couldn't be parsed.
print_topics(self, header, cmds, cmdlen, maxcol)

Data descriptors inherited from cmd.Cmd:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from cmd.Cmd:
doc_header = 'Documented commands (type help <topic>):'
doc_leader = ''
identchars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'
intro = None
lastcmd = ''
misc_header = 'Miscellaneous help topics:'
nohelp = '*** No help on %s'
prompt = '(Cmd) '
ruler = '='
undoc_header = 'Undocumented commands:'
use_rawinput = 1

 
Functions
       
main()

 
Data
        CONFIG_VAR = {'{D}': <function <lambda>>, '{N}': <function node>, '{P}': <built-in function getcwd>, '{S}': <function system>, '{T}': <function <lambda>>, '{U}': <function getuser>, '{V}': <function version>, '{a}': <function <lambda>>, '{c}': <function <lambda>>, '{e}': <function <lambda>>, ...}
__all__ = ['Shell', 'CONFIG_VAR', 'main']
__annotations__ = {'logger': <class 'logging.Logger'>}
__author_email__ = 'mauricelambert434@gmail.com'
__copyright__ = '\nCustomShell Copyright (C) 2021 Maurice Lamber...ome to redistribute it\nunder certain conditions.\n'
__description__ = '\nThis package implements a Custom Shell.\n'
__license__ = 'GPL-3.0 License'
__maintainer__ = 'Maurice Lambert'
__maintainer_email__ = 'mauricelambert434@gmail.com'
__url__ = 'https://github.com/mauricelambert/CustomShell'

 
Author
        Maurice Lambert