Added syscmd.py
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
rm -rf ~/.local/share/profanity/plugins/*
|
rm -rf ~/.local/share/profanity/plugins/*
|
||||||
|
|
||||||
cp ascii.py ~/.local/share/profanity/plugins/.
|
cp ascii.py ~/.local/share/profanity/plugins/.
|
||||||
|
cp syscmd.py ~/.local/share/profanity/plugins/.
|
||||||
cp browser.py ~/.local/share/profanity/plugins/.
|
cp browser.py ~/.local/share/profanity/plugins/.
|
||||||
cp platform-info.py ~/.local/share/profanity/plugins/.
|
cp platform-info.py ~/.local/share/profanity/plugins/.
|
||||||
cp say.py ~/.local/share/profanity/plugins/.
|
cp say.py ~/.local/share/profanity/plugins/.
|
||||||
|
|||||||
19
syscmd.py
Normal file
19
syscmd.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import prof
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
def _cmd_system(text):
|
||||||
|
result = subprocess.Popen(text, shell=True, stdout=subprocess.PIPE).stdout.read()
|
||||||
|
split = result.splitlines()
|
||||||
|
for s in split:
|
||||||
|
prof.cons_show(s)
|
||||||
|
|
||||||
|
def prof_init(version, status):
|
||||||
|
synopsis = [ "/system <command>" ]
|
||||||
|
description = "Run a system command."
|
||||||
|
args = [
|
||||||
|
[ "<command>", "The command" ]
|
||||||
|
]
|
||||||
|
examples = [
|
||||||
|
"/system \"ls -l\""
|
||||||
|
]
|
||||||
|
prof.register_command("/system", 1, 1, synopsis, description, args, examples, _cmd_system)
|
||||||
Reference in New Issue
Block a user