forked from Skiller9090/Lucifer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8c6108
commit 336f1dd
Showing
795 changed files
with
123,805 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from .LuciferShell import Shell | ||
import argparse | ||
import sys | ||
import os | ||
|
||
|
||
class VAAETParser(argparse.ArgumentParser): | ||
def __init__(self, lucifer_manager, *args, **kwargs): | ||
super().__init__(args, kwargs) | ||
self.luciferManager = lucifer_manager | ||
|
||
def error_usage(self, message): | ||
sys.stderr.write('error: %s\n' % message) | ||
self.print_help() | ||
sys.exit(os.EX_USAGE) | ||
|
||
def check_args(self): | ||
if len(sys.argv) == 1: | ||
self.error_usage("No Arguments") | ||
|
||
def check_gui(self): | ||
if self.args.gui: | ||
self.luciferManager.gui = True | ||
print("Show GUI") | ||
else: | ||
self.luciferManager.main_shell = Shell(self.luciferManager.next_shell_id, self.luciferManager) | ||
self.luciferManager.next_shell_id += 1 | ||
self.luciferManager.main_shell.spawn() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
class LuciferManager: | ||
def __init__(self): | ||
self.main_shell = None | ||
self.alternative_shells = [] | ||
self.gui = False | ||
self.next_shell_id = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
from .utils import check_int | ||
|
||
|
||
class Shell: | ||
def __init__(self, ID, lucifer_manager): | ||
self.id = ID | ||
self.is_main = True if self.id == 0 else False | ||
self.luciferManager = lucifer_manager | ||
self.gui = False | ||
self.module = "" | ||
self.program_name = "Lucifer" | ||
self.shell_in = "" | ||
self.vars = {} | ||
self.help_menu = """help - Displays This Menu | ||
show - Shows options or modules based on input, EX: show <options/modules> | ||
use - Move into a module, EX: use <module> | ||
set - Sets a variable or option, EX: set <var> <data> | ||
reset - Resets Everything | ||
spawn_shell - Spawns a alternative shell | ||
open_shell - Open a shell by id EX: open_shell <id> | ||
show_shells - Show all shell ids and attached name | ||
set_name - Sets current shells name EX: set_name <name> | ||
set_name_id - Set a shells name by id EX: set_name_id <id> <name> | ||
close - Closes current shell | ||
id - Displays current shell's id | ||
exit - Exits the program, can also use quit to do the same | ||
name - Shows name of current shell""" | ||
self.name = "Shell " if not self.is_main else "Main Shell" | ||
|
||
def getIn(self): | ||
self.shell_in = input(f"{self.program_name}|{self.module}|> ") | ||
|
||
def print_id(self): | ||
print(f"Shell ID: {self.id}") | ||
|
||
def print_name(self): | ||
print(f"Shell Name: {self.name}") | ||
|
||
def set_name(self, name): | ||
self.name = name | ||
|
||
def set_name_id(self, ID, name): | ||
if ID == 0: | ||
self.luciferManager.main_shell.name = name | ||
print(f"{ID} => {name}") | ||
else: | ||
for index, shell in enumerate(self.luciferManager.alternative_shells): | ||
if shell.id == ID: | ||
self.luciferManager.alternative_shells[index].name = name | ||
print(f"{ID} => {name}") | ||
break | ||
else: | ||
print("Not a valid ID") | ||
return | ||
|
||
def parseShellIn(self): | ||
com_args = self.shell_in.split(" ") | ||
while "" in com_args: | ||
com_args.remove("") | ||
if len(com_args) == 0: | ||
return | ||
if len(com_args) == 1: | ||
command = com_args[0].lower() | ||
if command == "help" or command == "h": | ||
self.help() | ||
return | ||
com = com_args[0].lower().rstrip() | ||
if com == "set": | ||
com_args.pop(0) | ||
com_args = " ".join(com_args) | ||
self.command_set(com_args) | ||
return | ||
if com == "show": | ||
if len(com_args) > 1: | ||
if com_args[1].lower().strip() == "options" or com_args[1].lower().strip() == "vars": | ||
self.show_options() | ||
return | ||
else: | ||
print("Please enter a valid argument: options or modules") | ||
else: | ||
print("Please specify options or modules to show!") | ||
if com == "quit" or com == "exit": | ||
print("Thank you for using Lucifer, see you next time!") | ||
exit(0) | ||
if com == "id": | ||
self.print_id() | ||
return | ||
if com == "spawn_shell": | ||
self.spawn_shell() | ||
return | ||
if com == "open_shell": | ||
if len(com_args) > 1: | ||
openid = com_args[1].rstrip() | ||
if check_int(openid): | ||
openid = int(openid) | ||
if openid == 0: | ||
self.luciferManager.main_shell.spawn() | ||
return | ||
else: | ||
found = False | ||
for index, shell in enumerate(self.luciferManager.alternative_shells): | ||
if shell.id == openid: | ||
self.luciferManager.alternative_shells[index].spawn() | ||
return | ||
else: | ||
print("Please specify a valid ID") | ||
return | ||
else: | ||
print("Please specify a valid ID") | ||
return | ||
else: | ||
print("Please specify a valid ID") | ||
return | ||
if com == "close": | ||
return 7 | ||
if com == "show_shells": | ||
print("Main Shell => 0") | ||
for shell in self.luciferManager.alternative_shells: | ||
print(f"{shell.name} => {shell.id}") | ||
return | ||
if com == "name": | ||
self.print_name() | ||
return | ||
if com == "set_name": | ||
if len(com_args) > 1: | ||
com_args.pop(0) | ||
self.set_name(" ".join(com_args)) | ||
return | ||
if com == "set_name_id": | ||
if len(com_args) > 1: | ||
ID = com_args[1].rstrip() | ||
if check_int(ID): | ||
for i in range(2): | ||
com_args.pop(0) | ||
self.set_name_id(int(ID), " ".join(com_args)) | ||
else: | ||
print("Not a valid ID") | ||
else: | ||
print("Please add a valid ID") | ||
return | ||
|
||
def help(self): | ||
print(self.help_menu) | ||
|
||
def spawn(self): | ||
while True: | ||
self.getIn() | ||
signal = self.parseShellIn() | ||
if signal == 7: | ||
break | ||
|
||
def command_set(self, var_string): | ||
vsl = var_string.split(" ") | ||
var = vsl.pop(0).rstrip() | ||
if var != "": | ||
var_string = " ".join(vsl) | ||
self.vars[var] = var_string | ||
print(f"{var} => {var_string}") | ||
else: | ||
print("Please specify a variable to set") | ||
|
||
def spawn_shell(self): | ||
self.luciferManager.alternative_shells.append(Shell(self.luciferManager.next_shell_id, self.luciferManager)) | ||
self.luciferManager.next_shell_id += 1 | ||
self.luciferManager.alternative_shells[-1].name += str(self.luciferManager.next_shell_id-1) | ||
print(f"Opened New Shell With ID: {self.luciferManager.next_shell_id-1}") | ||
|
||
def show_options(self): | ||
print(self.vars) | ||
# help | ||
# show <options/modules> | ||
# use <module> | ||
# set <var> <string> | ||
# reset |
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
The argparse module makes it easy to write user friendly command line | ||
interfaces. | ||
|
||
The program defines what arguments it requires, and argparse will figure out | ||
how to parse those out of sys.argv. The argparse module also automatically | ||
generates help and usage messages and issues errors when users give the | ||
program invalid arguments. | ||
|
||
As of Python >= 2.7 and >= 3.2, the argparse module is maintained within the | ||
Python standard library. For users who still need to support Python < 2.7 or | ||
< 3.2, it is also provided as a separate package, which tries to stay | ||
compatible with the module in the standard library, but also supports older | ||
Python versions. | ||
|
||
Also, we can fix bugs here for users who are stuck on some non-current python | ||
version, like e.g. 3.2.3 (which has bugs that were fixed in a later 3.2.x | ||
release). | ||
|
||
argparse is licensed under the Python license, for details see LICENSE.txt. | ||
|
||
|
||
Compatibility | ||
------------- | ||
|
||
argparse should work on Python >= 2.3, it was tested on: | ||
|
||
* 2.3, 2.4, 2.5, 2.6 and 2.7 | ||
* 3.1, 3.2, 3.3, 3.4 | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
Try one of these: | ||
|
||
python setup.py install | ||
|
||
easy_install argparse | ||
|
||
pip install argparse | ||
|
||
putting argparse.py in some directory listed in sys.path should also work | ||
|
||
|
||
Bugs | ||
---- | ||
|
||
If you find a bug in argparse (pypi), please try to reproduce it with latest | ||
python 2.7 and 3.4 (and use argparse from stdlib). | ||
|
||
If it happens there also, please file a bug in the python.org issue tracker. | ||
If it does not happen there, file a bug in the argparse package issue tracker. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
Metadata-Version: 2.0 | ||
Name: argparse | ||
Version: 1.4.0 | ||
Summary: Python command-line parsing library | ||
Home-page: https://github.com/ThomasWaldmann/argparse/ | ||
Author: Thomas Waldmann | ||
Author-email: tw@waldmann-edv.de | ||
License: Python Software Foundation License | ||
Keywords: argparse command line parser parsing | ||
Platform: any | ||
Classifier: Development Status :: 5 - Production/Stable | ||
Classifier: Environment :: Console | ||
Classifier: Intended Audience :: Developers | ||
Classifier: License :: OSI Approved :: Python Software Foundation License | ||
Classifier: Operating System :: OS Independent | ||
Classifier: Programming Language :: Python | ||
Classifier: Programming Language :: Python :: 2 | ||
Classifier: Programming Language :: Python :: 3 | ||
Classifier: Programming Language :: Python :: 2.3 | ||
Classifier: Programming Language :: Python :: 2.4 | ||
Classifier: Programming Language :: Python :: 2.5 | ||
Classifier: Programming Language :: Python :: 2.6 | ||
Classifier: Programming Language :: Python :: 2.7 | ||
Classifier: Programming Language :: Python :: 3.0 | ||
Classifier: Programming Language :: Python :: 3.1 | ||
Classifier: Programming Language :: Python :: 3.2 | ||
Classifier: Programming Language :: Python :: 3.3 | ||
Classifier: Programming Language :: Python :: 3.4 | ||
Classifier: Topic :: Software Development | ||
|
||
The argparse module makes it easy to write user friendly command line | ||
interfaces. | ||
|
||
The program defines what arguments it requires, and argparse will figure out | ||
how to parse those out of sys.argv. The argparse module also automatically | ||
generates help and usage messages and issues errors when users give the | ||
program invalid arguments. | ||
|
||
As of Python >= 2.7 and >= 3.2, the argparse module is maintained within the | ||
Python standard library. For users who still need to support Python < 2.7 or | ||
< 3.2, it is also provided as a separate package, which tries to stay | ||
compatible with the module in the standard library, but also supports older | ||
Python versions. | ||
|
||
Also, we can fix bugs here for users who are stuck on some non-current python | ||
version, like e.g. 3.2.3 (which has bugs that were fixed in a later 3.2.x | ||
release). | ||
|
||
argparse is licensed under the Python license, for details see LICENSE.txt. | ||
|
||
|
||
Compatibility | ||
------------- | ||
|
||
argparse should work on Python >= 2.3, it was tested on: | ||
|
||
* 2.3, 2.4, 2.5, 2.6 and 2.7 | ||
* 3.1, 3.2, 3.3, 3.4 | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
Try one of these: | ||
|
||
python setup.py install | ||
|
||
easy_install argparse | ||
|
||
pip install argparse | ||
|
||
putting argparse.py in some directory listed in sys.path should also work | ||
|
||
|
||
Bugs | ||
---- | ||
|
||
If you find a bug in argparse (pypi), please try to reproduce it with latest | ||
python 2.7 and 3.4 (and use argparse from stdlib). | ||
|
||
If it happens there also, please file a bug in the python.org issue tracker. | ||
If it does not happen there, file a bug in the argparse package issue tracker. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
__pycache__/argparse.cpython-38.pyc,, | ||
argparse-1.4.0.dist-info/DESCRIPTION.rst,sha256=_wSTTIamPdyREfSSHUtRDgL0u1f2cU-fG3tufgwj928,1540 | ||
argparse-1.4.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 | ||
argparse-1.4.0.dist-info/METADATA,sha256=OVnr-7fAoUh5C7TqU-N_xmXD03JcaNjN31Q-wUitpN8,2792 | ||
argparse-1.4.0.dist-info/RECORD,, | ||
argparse-1.4.0.dist-info/WHEEL,sha256=AvR0WeTpDaxT645bl5FQxUK6NPsTls2ttpcGJg3j1Xg,110 | ||
argparse-1.4.0.dist-info/metadata.json,sha256=6BBrwOpKwMyufJMx0uLeBk18dogzU8O2YgTUSJHYlXA,1326 | ||
argparse-1.4.0.dist-info/top_level.txt,sha256=TgiWrQsF0mKWwqS2KHLORD0ZtqYHPRGdCAAzKwtVvJ4,9 | ||
argparse.py,sha256=0ksYqisQDQvhoiuo19JERCSpg51tc641GFJIx7pTA0g,89214 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Wheel-Version: 1.0 | ||
Generator: bdist_wheel (0.24.0) | ||
Root-Is-Purelib: true | ||
Tag: py2-none-any | ||
Tag: py3-none-any | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"license": "Python Software Foundation License", "name": "argparse", "metadata_version": "2.0", "generator": "bdist_wheel (0.24.0)", "summary": "Python command-line parsing library", "platform": "any", "version": "1.4.0", "extensions": {"python.details": {"project_urls": {"Home": "https://github.com/ThomasWaldmann/argparse/"}, "document_names": {"description": "DESCRIPTION.rst"}, "contacts": [{"role": "author", "email": "tw@waldmann-edv.de", "name": "Thomas Waldmann"}]}}, "keywords": ["argparse", "command", "line", "parser", "parsing"], "classifiers": ["Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: Python Software Foundation License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Programming Language :: Python :: 2.3", "Programming Language :: Python :: 2.4", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
argparse |
Oops, something went wrong.