forked from Bensch97/backend-copy-special-assessment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopyspecial.py
executable file
·57 lines (41 loc) · 1.46 KB
/
copyspecial.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Copyspecial Assignment"""
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# give credits
__author__ = "???"
import re
import os
import sys
import shutil
import subprocess
import argparse
def get_special_paths(dirname):
"""Given a dirname, returns a list of all its special files."""
# your code here
return
def copy_to(path_list, dest_dir):
# your code here
return
def zip_to(path_list, dest_zip):
# your code here
return
def main(args):
"""Main driver code for copyspecial."""
# This snippet will help you get started with the argparse module.
parser = argparse.ArgumentParser()
parser.add_argument('--todir', help='dest dir for special files')
parser.add_argument('--tozip', help='dest zipfile for special files')
# TODO: add one more argument definition to parse the 'from_dir' argument
ns = parser.parse_args(args)
# TODO: you must write your own code to get the command line args.
# Read the docs and examples for the argparse module about how to do this.
# Parsing command line arguments is a must-have skill.
# This is input data validation. If something is wrong (or missing) with
# any required args, the general rule is to print a usage message and
# exit(1).
# Your code here: Invoke (call) your functions
if __name__ == "__main__":
main(sys.argv[1:])