Exemple #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")
Exemple #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.")
Exemple #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.")
Exemple #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")
Exemple #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))
Exemple #6
0
 def exit(self):
     logger.info("Bye!")
     exit()
Exemple #7
0
 def do_help(self, *args):
     logger.info(messages.help())
Exemple #8
0
 def do_gwen(self, *args):
     logger.info("Starting G.W.E.N") #TODO: Add the personal assistent