0% found this document useful (0 votes)
13 views5 pages

Dismod Update and Module Management

The document is a Python script for a command-line interface tool named 'dismod' that allows users to manage modules and configurations. It includes features such as checking for updates, loading modules, setting variables, and displaying help commands. The script also incorporates error handling and dependency management for plugins.

Uploaded by

pipboypopov
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views5 pages

Dismod Update and Module Management

The document is a Python script for a command-line interface tool named 'dismod' that allows users to manage modules and configurations. It includes features such as checking for updates, loading modules, setting variables, and displaying help commands. The script also incorporates error handling and dependency management for plugins.

Uploaded by

pipboypopov
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

import os

import time
import subprocess
import random
import sys
import json
import glob
import readline
import requests
## CODED BY 81L1NM1Y0R from Qairex Studio
[Link]("clear")
version = "0.3"
banner =[f"""
.... . .x+=:. ..
.xH888888Hx. @88> z` ^% dF
.H8888888888888: %8P . <88888X '?8 ''888E` x88: `)8b. X888
888X '888> 888R I888> beWE "888L
`:..:`888888> 8> 888E 8888N=*8888 X888 888X '888> 888R I888> 888E
888E
`"*88 X 888E %8" R88 X888 888X '888> 888R I888> 888E
888E
.xHHhx.." ! 888E @8Wou 9% X888 888X '888> u8888cJ888 888E
888F
X88888888hx. ..! 888& .888888P` "*88%""*88" '888!` "*888*P" .888N..888
! "*888888888" R888" ` ^"F `~ " `"` 'Y" `"888*""
^"***"` "" ""
TEST VERSION v.{version}

"""]
path = ""
def checking_update():
[Link]()
[Link]("Checking Update...")
[Link]()
req = [Link]("[Link]
main/[Link]")
if [Link]('version = "{0}"'.format(version)) == -1:
while True:
[Link]("\rDo you want to update dismod? [Y/N]:")
[Link]()
upda = input().lower()
if "y" in upda or [Link]("y"):
[Link]("\rUpdating package...")
[Link]()
test = [Link]("which git")
[Link]("clear")
[Link]("\rUpdating package...")
[Link]()
if test != 0:
[Link]()
[Link]("\rError! Install git package...")
[Link]()
break
return
[Link](1)
break
return
if "n" in upda or [Link]("n"):
[Link]()
[Link]("\rUpdate canceled!")
[Link]()
[Link](1)
break
return
[Link]()
[Link]("\rWrong answer!")
[Link](1)
[Link]("\rNothing to update!")
[Link](1)
[Link]("clear")

def start_animation():
for t in [Link](banner):
[Link](0.00114)
print(t, end='')
def main():
global path, plug
commands, keys, com, plug_com, config, ats, asa, bass, c, yasa, j, z, bam =
[], [], 0, [], {}, [""], [], [], 1, [], 0, 0, []
plugins = [Link]([Link](), "modules")
for i in [Link](plugins):
if not [Link](i):
[Link](i)
plugin_command = {"run": "Execute script", "set": "Set variable",
"restart": "Reset config", "config": "Show config"}
for l in plugin_command.keys():
plug_com.append(l)
komut = {"load": "Load module", "help": "Show this help menu", "clear":
"clear screen", "back": "Return from module", "banner": "Show random banner",
"exit": "Exit the dismod", "restart": "Reset all configs", "modules": "Show all
modules", "update": "Update dismod"}
for t in [Link]():
[Link](t)
command = input(str(path) + ">>>")
if len(path) > 0:
if plug_com[0] in [Link]():
if not [Link](plugins + "/" + str(plug) + "/" +
"[Link]"):
[Link]("Checking dependencies file...")
[Link]()
contin = False
try:
with open(plugins + "/" + str(plug) + "/" +
"[Link]", "r") as test:
best = [Link]().splitlines()
if not [Link](plugins + "/" + str(plug) + "/" +
"[Link]"):
[Link]("\rNot found dependencies file!")
contin = True
if not contin:
[Link]("\rChecking dependencies...")
[Link]()
[Link]("Installing Dependencies...")
[Link]()
for t in best:
[Link]("pip install {0}".format(t))
[Link]("\r Installed Dependencies!")
with open(plugins + "/" + str(plug) + "/" +
"[Link]", "w") as test:
[Link]("1")
except:
print("something went wrong")
print("Please install dependencies with manually!")
for t in best:
print(t)
[Link]()
[Link]("\rLoading module...")
with open(plugins + "/" + str(plug) + "/" + "[Link]", "r") as
test:
best = [Link]([Link]())
for b in [Link]():
[Link](b)
c += 1
for k in range(0, c, 2):
[Link](asa[:k])
for atmaca in bass:
if len(atmaca) == 0:
continue
[Link](atmaca[z][1])
z += 2
[Link]("python3 " + plugins + "/" + str(plug) + "/" + "[Link]
{}".format(' '.join(bam)))
print("Loaded module!")
c, z = 1, 0
[Link]()
[Link]()
return
if plug_com[1] in [Link]():
data = [Link]().split()
for t in data:
if len(t) == 0:
[Link](t)
if len(data) < 3:
print("""USAGE:
set variable value""")
return
with open(str(plugins) + "/" + str(plug) + "/" + "[Link]",
"r") as con:
tata = [Link]([Link]())
for t in [Link]():
[Link](t)
c += 1
for k in range(0, c, 2):
[Link](bass[:k])
for lan in bam:
if len(lan) == 0:
continue
[Link](lan[len(lan) -2][0])
att = []
for t in asa:
if t in data:
comma = [Link]("set", "", 1).replace(t, "",
1).strip()
tata[t] = comma
[Link](True)
else:
[Link](False)
if not True in att:
print("Variable not found!")
return
with open(str(plugins) + "/" + str(plug) + "/" + "[Link]",
"w") as test:
[Link]([Link](tata))
return
if plug_com[2] in [Link]():
with open(str(plugins) + "/" + str(plug) + "/" + "[Link]",
"r") as best:
bat = [Link]([Link]())
for t in bat:
if [Link]() == "description":
continue
bat[t] = ""
kata = [Link](bat)
with open(str(plugins) + "/" + str(plug) + "/" + "[Link]",
"w") as test:
[Link](kata)
return
if plug_com[3] in [Link]():
with open(str(plugins) + "/" + str(plug) + "/" + "[Link]",
"r") as get:
tata = [Link]([Link]())
for b in [Link]():
[Link](b)
c += 1
for k in range(0, c, 2):
[Link](asa[:k])
for t in bass:
if len(t) == 0:
continue
j += 2
ats[0] = """
===== VARIABLE =========== VALUE ============= DESCRIPTION ======
-----------------------------------------------------------------
{0} {1} {2}
""".format(t[z][0], t[z][1], t[len(t) -1][1])
print(ats[0])
z += 2
print()
print(asa[j][1])
print()
return
try:
com = [Link]([Link](), stderr=[Link])
except:
pass
if keys[0] in [Link]():
ham = False
for t in commands:
if t in [Link]():
plug = str(t)
path = "module > " + str(t) + " "
ham = True
if not ham:
print("Not found module!")
return
return
if keys[1] in [Link]():
for help in [Link]():
print("""----------------------->>
{0}: {1}
""".format(help[0], help[1]))
return
if keys[2] in [Link]():
[Link]("clear")
print([Link](banner))
return
if keys[3] in [Link]():
path = ""
return
if keys[4] in [Link]():
print([Link](banner))
return
if keys[5] in [Link]():
print("Bye! Bye! :)")
exit()
if keys[6] in [Link]():
for t in [Link]("modules/*"):
if [Link](t):
with open(str(t) + "/" + "[Link]", "r") as test:
tata = [Link]([Link]())
c = 1
for item in [Link]():
[Link](item)
c += 1
for i in range(0, c, 2):
[Link](bam[:i])
for l in bass:
if len(l) == 0:
continue
tata[l[len(l) -2][0]] = ""
with open(str(t) + "/" + "[Link]", "w") as wri:
[Link]([Link](tata))
[Link]()
[Link]()
return
if not [Link]() in keys and com != 0:
print("Wrong command. Type help to see the list of commands!")
return
if keys[7] in [Link]():
print(" Module list:")
for t in commands:
print(t)
return
if keys[8] in [Link]():
checking_update()

if not [Link]() == 0:
print("You \033[4;49;91mMust\033[0m be \033[1;49;37mroot!\033[0m")
else:
start_animation()
while True:
main()

You might also like