-
Notifications
You must be signed in to change notification settings - Fork 1
/
comline.py
28 lines (26 loc) · 960 Bytes
/
comline.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
import argparse
class ComLine():
'Class for implementing command line argument parsing'
#points = "crb_sites_selected.shp"
#streams = "crb_streams.shp"
def __init__(self, args):
parser = argparse.ArgumentParser()
parser.add_argument("-s", "--streams",
dest='streams',
default="crb_streams.shp",
help="Specify an ESRI shapefile containing connected stream segments (lines)"
)
parser.add_argument("-p", "--points",
dest='points',
default="crb_sites_selected.shp",
help="Specify an ESRI shapefile containing sampling localities (points)"
)
parser.add_argument("-c", "--code",
dest='code',
default="CODE",
help="Specify the name of the field in the attribute table of your points layer that contains sample site names"
)
self.args = parser.parse_args()
print self.args.streams
print self.args.points
print self.args.code