def _move_files(infile, destination):
    file_ops.move_files(infile, destination)
    """
def _move_files(filenames, destination):
    file_ops.move_files(filenames, destination)
Ejemplo n.º 3
0
def _move_files(filename, destination):
    filelist = glob.glob(filename)
    file_ops.move_files(files=filelist, destination=destination)
        "-f","--file",
        nargs="+",
        metavar="File Name",
        required=True,
        help="Name or names of file(s) to be deleted")

#    delete_parser.add_argument(
#        "-d","--directory",
#        metavar="Directory where file(s) are to be deleted",
#        required=True,
#        help="Directory in which file(s) are to be deleted")

    return parser.parse_args()

if __name__ == '__main__':
    program_arguments = process_user_input()

    if program_arguments.command == 'copy':
        file_ops.copy_files(
            program_arguments.infile,
            program_arguments.destination)

    if program_arguments.command == 'move':
        file_ops.move_files (
            program_arguments.infile,
            program_arguments.destination)

    if program_arguments.command == 'delete':
        file_ops.delete_files (
            program_arguments.file)
Ejemplo n.º 5
0
                               required=True,
                               help="Names of files to delete.")

    rename_parser = subcommand_parsers.add_parser(name='rename',
                                                  help="Rename Files")
    rename_parser.add_argument("-f",
                               "--filenames",
                               nargs="+",
                               metavar="FILENAME",
                               required=True,
                               help="Names of files to rename.")
    rename_parser.add_argument("-n",
                               "--new-filenames",
                               nargs="+",
                               metavar="NEW_FILENAME",
                               required=True,
                               help="New names for files.")

    return parser.parse_args()


if __name__ == '__main__':
    program_arguments = process_user_input()

    if program_arguments.command == 'copy':
        file_ops.copy_files(files=program_arguments.filenames,
                            destination=program_arguments.destination)
    elif program_arguments.command == 'move':
        file_ops.move_files(filenames=program_arguments.filenames,
                            destination=program_arguments.destination)
Ejemplo n.º 6
0
        "-d", "--destination",
        dest="output_path",
        required=True,
        metavar="OUTPUT_PATH",
        help="New name for file."
    )

    return parser.parse_args()


if __name__ == '__main__':
    program_arguments = _extract_arguments()

    # noinspection PyInterpreter
    if program_arguments.command == 'copy':
        file_ops.copy_files(
            program_arguments.input_filenames,
            program_arguments.output_path
        )
    elif program_arguments.command == 'move':
        file_ops.move_files(
            program_arguments.input_filenames,
            program_arguments.output_path
        )
    elif program_arguments.command == "rename":
        file_ops.rename_file(
            program_arguments.input_filename,
            program_arguments.output_path
        )
        pass
        help='Location to copy files to.')

    # Copy Command Subparser
    copy_parser = subcommand_parsers.add_parser(
        name='copy', parents=[common_arguments],
        help="Copy Files")

    # Move Command Subparser
    move_parser = subcommand_parsers.add_parser(
        name='move', parents=[common_arguments],
        help="Move Files")

    return parser.parse_args()


if __name__ == '__main__':
    program_arguments = process_user_input()

    if program_arguments.command == 'copy':
        file_ops.copy_files(
            files=program_arguments.filenames,
            destination=program_arguments.destination)
    elif program_arguments.command == 'move':
        file_ops.move_files(
            filenames=program_arguments.filenames,
            destination=program_arguments.destination)




    delete_parser.add_argument("-f",
                               "--file",
                               nargs="+",
                               metavar="File Name",
                               required=True,
                               help="Name or names of file(s) to be deleted")

    #    delete_parser.add_argument(
    #        "-d","--directory",
    #        metavar="Directory where file(s) are to be deleted",
    #        required=True,
    #        help="Directory in which file(s) are to be deleted")

    return parser.parse_args()


if __name__ == '__main__':
    program_arguments = process_user_input()

    if program_arguments.command == 'copy':
        file_ops.copy_files(program_arguments.infile,
                            program_arguments.destination)

    if program_arguments.command == 'move':
        file_ops.move_files(program_arguments.infile,
                            program_arguments.destination)

    if program_arguments.command == 'delete':
        file_ops.delete_files(program_arguments.file)
def _move_files(filenames, destination):
    file_ops.move_files(filenames, destination)
                             required=True,
                             help="Destination for file(s)")

    # move command
    move_parser = subcommand_parsers.add_parser(name="move",
                                                help="Move files.")

    move_parser.add_argument("-f",
                             "--filenames",
                             nargs="+",
                             metavar="filename",
                             required=True,
                             help="Name(s) of file(s) to move")
    move_parser.add_argument("-d",
                             "--destination",
                             required=True,
                             help="Destination for file(s)")

    return parser.parse_args()


if __name__ == '__main__':
    command_arguments = _extract_arguments()

    if command_arguments.command == "copy":
        file_ops.copy_files(command_arguments.filenames,
                            command_arguments.destination)
    elif command_arguments.command == "move":
        file_ops.move_files(command_arguments.filenames,
                            command_arguments.destination)
def _move_files(filename,destination):
    filelist = glob.glob(filename)
    file_ops.move_files(
        files = filelist,
        destination=destination)
Ejemplo n.º 12
0
def _move_files(filename, destination):
    file_ops.move_files(**locals())
def move_keyword(filename, destination):
    for file in filename:
        file_ops.move_files(file, destination)
def move_positional(filename, destination):
    for file in filename:
        file_ops.move_files(file, destination)