Example #1
0
File: main.py Project: CatOw/CCUI
def main():

    commandsList = [
        "shutdown", "help", "help tool", "tool lightshot", "reboot"
    ]

    consoleInput = input("[CCUI/main]>>>")

    try:
        oldConsoleInput = consoleInput
        consoleInput = consoleInput.split()
        consoleInputLen = len(consoleInput)

        if consoleInputLen < 2 and consoleInput[0] in commandsList:
            eval(consoleInput[0] + "()")

        if consoleInputLen > 1 and oldConsoleInput in commandsList:
            if consoleInput[0] == "tool":
                tools.main(consoleInput[1])

            if consoleInput[0] == "help":
                helpCommand(consoleInput[1])

        elif consoleInputLen > 2 or oldConsoleInput not in commandsList:
            inputFail(oldConsoleInput)

    except IndexError:
        main()
Example #2
0
def loadFile(totalGenerated, executionTime, totalFound, totalDiscarded, totalDuplicated, successRate, linksList):
    dataLoad = input("Would you like to load (L) the links or delete (D)? ")
    if dataLoad.lower() == "d" or dataLoad.lower() == "delete":
        print("Deleting Links From Storage...")
        tools.main("lightshot")

    elif dataLoad.lower() != "l":
        print("Invalid Input")
        loadFile(totalGenerated, executionTime, totalFound, totalDiscarded, totalDuplicated, successRate, linksList)
    
    else:
        lineSplit = '\n'.join(linksList)
        print(lineSplit)

        error = True

        while error:
            saveData = input("Would you like to save the data into a lsLinkDB.txt (S) or delete (D)? ")

            if saveData.lower() == "d":
                error = False
                print("Deleting Data...")
                tools.main("lightshot")
            
            elif saveData.lower() == "s":
                print("Saving Data...")
                stats = [totalGenerated, executionTime, totalFound, totalDiscarded, totalDuplicated, successRate]
                error = False
                saveFile(lineSplit, stats)
            
            else:
                print("Invalid Input")
Example #3
0
def helpTool(tool):
    print(
        "\nFor more information about specific commands type 'help command-name'.\n"
    )

    if tool == "lightshot":
        print(
            "generate {number}     Generate a given amount of Lightshot Links to access images.\n"
        )
        tools.main("lightshot")
Example #4
0
def main():
	print(f"""
{Fore.GREEN}
===   ===
=  = =  =
=   =   =
=       = ANGA INDO
=       =  DOWNLOADER

https://github.com/greyxploiter

===========================================
{Style.RESET_ALL}
		""")
	tools.main()
Example #5
0
            key.delete()

    print('\n\n=== C S S ===')
    handle_scss(production)

    print('\n\n=== J S ===')
    handle_js(production)

    print('\n\n=== I M A G E S ===')
    image_src = f'{data["options"]["images"]}'
    image_dest = f'{data["options"]["prod"]}'

    local_images = os.path.expanduser(image_src)
    local_prod = os.path.expanduser(image_dest)
    print((f'linking {local_images} to {local_prod}...'), end='')
    subprocess.run(['ln', '-s', local_images, local_prod])
    print(' Done!')

    print('\n\n=== H T M L ===')
    tools.main(data['pagesets'], data['options'], s3, production)

    print('\n\n=== C O P Y   F I L E S ===')
    copy_files()

    if production:
        print('\n\n=== S T A T I C   F I L E S ===')
        tools.move_static('dist/static', s3, s3_bucket_name,
                          data['options']['prod'])
        print('\n\n=== Entire build done in',
              f'{round(float(time.time() - t1), 4)} seconds ===')
        else:
            raise ValueError("Invalid finder arg.")
        self.path = tk.StringVar()
        self.entry = ttk.Entry(self, textvariable = self.path)
        self.find_button = ttk.Button(self, text = "...", command = self.ask, width = 2)
        self.open_button = ttk.Button(self, text = action_text, command = self.callback)
        self.entry.grid(column = 0, row = 0, sticky = "we")
        self.find_button.grid(column = 1, row = 0)
        self.open_button.grid(column = 2, row = 0)
        self.grid_columnconfigure(0, weight = 1)
        return

    def ask(self):
        path = self.finder()
        if not path:
            return
        else:
            self.path.set(path)
            self.callback()

    def callback(self):
        path = self.path.get()
        if not path:
            self.ask()
        else:
            self.callback_(path = path, event = self.finder)


if __name__  ==  "__main__":
    main(__doc__)
Example #7
0
def saveFile(data, stats):
    print("save")
    tools.main("lightshot")
Example #8
0
"""PCPPPriceDropTracker main __init__ module."""

if __name__ == '__main__':
    from tools import main
    main(__doc__, itu=False)
Example #9
0
def hello_world():
    if request.method == 'POST':
        json_data = request.json
        tools.main(json_data)
Example #10
0
 def test_01_instantiate_class(self):
     tools.main()
     self.assertEqual(os.path.exists('tools.txt'), True)
Example #11
0
 def test_01_instantiate_class(self):
     tools.main()
     self.assertEqual(os.path.exists('tools.txt'), True)