示例#1
0
文件: basic.py 项目: Geulmaster/GWEN
    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")
示例#2
0
文件: basic.py 项目: Geulmaster/GWEN
    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.")
示例#3
0
文件: basic.py 项目: Geulmaster/GWEN
    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.")
示例#4
0
文件: basic.py 项目: Geulmaster/GWEN
    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")
示例#5
0
文件: basic.py 项目: Geulmaster/GWEN
    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))
示例#6
0
文件: basic.py 项目: Geulmaster/GWEN
 def exit(self):
     logger.info("Bye!")
     exit()
示例#7
0
 def do_help(self, *args):
     logger.info(messages.help())
示例#8
0
 def do_gwen(self, *args):
     logger.info("Starting G.W.E.N") #TODO: Add the personal assistent