Esempio n. 1
0
    def delete_file(self):
        pathPattern()

        source = input("Insert the source path (including the file): ")

        if os.path.isfile(str(source)):
            os.remove(str(source))
            logger.info("File has been removed")
        else:
            logger.fatal("Inserted path is incorrect")
Esempio n. 2
0
    def copy_folder(self):
        pathPattern()

        source = input("Insert the source path: ")
        destination = input("Insert the destination path: ")
        try:
            shutil.copytree(str(source), str(destination))
            logger.info("Folder has been copied to {}".format(str(destination)))
        except:
            logger.fatal("Couldn't do the operation. Please check your inserted paths.")
Esempio n. 3
0
    def move(self):
        pathPattern()

        source = input("Insert the source path (including the file): ")
        destination = input("Insert the destination path: ")
        try:
            shutil.move(str(source), str(destination))
            logger.info("File has been moved to {}".format(str(destination)))
        except:
            logger.fatal("Couldn't do the operation. Please check your inserted paths.")
Esempio n. 4
0
    def delete_folder(self):
        pathPattern()

        source = input("Insert the source path: ")

        if os.path.isdir(str(source)):
            os.rmdir(str(source))
            logger.info("Folder has been removed")
        else:
            logger.fatal("Inserted path is incorrect")
Esempio n. 5
0
    def create_file(self):
        pathPattern()

        source = input("Insert a directory: ")
        extension = input("Insert the file type (extension): ")
        name = input("Insert the file name: ")

        file_name = source + '\\' + name + '.' + extension
        file = open(file_name, "w+")

        edit = input("Would you like to write something in the file?")
        if edit == 'yes' or 'y':
            content = input("Type your input: ")
            file = open(file_name, "a+")
            file.write(content)
            logger.info("{} has been created".format(file_name))
        else:
            logger.info("Ok, {} is an empty file for now".format(file_name))
Esempio n. 6
0
 def exit(self):
     logger.info("Bye!")
     exit()
Esempio n. 7
0
 def do_help(self, *args):
     logger.info(messages.help())
Esempio n. 8
0
 def do_gwen(self, *args):
     logger.info("Starting G.W.E.N") #TODO: Add the personal assistent