Linux command line interface package
Project description
Bushi
This package contains functions to handle commands in a Linux based terminal. The main purpose of this package is to replace Shell Script with a simplier Python based functions.
Target
Version 1.0
Major
Terminal input and output formatting.(done since0.1.0
)Manage multiple sessions with. (done sincetmux
command0.3.0
)- Build a ROS based package with
colcon
command. - Manage a Git repository with
git
command. - Manage an APT package with
apt-get
command.
Minor
(aborted,cmd.run()
must preserve the output formating.cmd.run()
changes to not pipe output)
Changelogs
Version 0.3.0 (14/03/2020)
- Add
tmux
class that handle multiple session with the following functionalities:- Check existence of a session using
tmux.session_exist()
. - Kill a session using
tmux.session_kill()
. - Detach from current session using
tmux.detach()
. - Run a separate process with output on different session using
tmux.session_run()
with the following functionalities:- It will call
bushi-tmux-runner
that handle how the process is called and how it return the process returncode to the parent process. - It uses to replace
tmux.run()
where we want to do a process while viewing its output. - Process failed when the tmux session was detached.
- On keyboard interrupt, or when the process failed, it will continue with detaching the current session.
- It will call
- Check existence of a session using
- Modify functions in
io
as follow:- Change how a process thread is called, it will only be created when needed, else it will be destroyed.
- Call
io.process_stop()
instead of changingio.__process_text
to stop the process thread. - Add
io.press_enter()
function that try to wait forenter
key before continue the program. - Add
io.ask_yes_no()
function that will ask question that acceptyes
orno
input and return that value asTrue
andFalse
respectively. If the input is invalid, it will terminate the program.
- Modify a function in
cmd
as follow:- Change
cmd.run()
to callsubprocess.run()
instead ofsubprocess.pOpen()
that pipe the output to the parent process.
- Change
Version 0.2.0 (13/03/2020)
- Add
cmd
class that handle subprocess run with the following functionalities:run()
to run a subprocess with outputs.runmuted()
to run a subprocess without any outputs.
- Add
path
class that handle files and directories with the following functionalities:- Check existence of files and directories using
isfile()
, andisdir()
. - Get and change working directory using
getdir()
andchangedir()
respectively. - Some others functionality that also exist in the
os.path
.
- Check existence of files and directories using
- Modify functions in the
io
as follow:- Change how output should behave.
- Modify output format for the process command.
- Change how process symbol be animated.
- Output the duration in the process command.
Version 0.1.0 (12/03/2020)
- Add
io
class that handle terminal input and output with the following functionalities:- Output to the terminal using
info()
,warn()
,fail()
,succes()
,info_list()
,warn_list()
,fail_list()
,success_list()
, andprocess()
. - Input from the terminal using
ask()
, andask_secret()
. - Both input and output will emphasize a string between
*
. (ex:*here*
) - Exit current process using
terminate()
. With empty argument, this function will return0
. Else, it will output the arguments and return1
.
- Output to the terminal using
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bushi-0.3.0.tar.gz
(5.0 kB
view hashes)