only import if layername is valid
This commit is contained in:
parent
9413bc4a7a
commit
a467d6b0af
1 changed files with 4 additions and 0 deletions
|
@ -542,6 +542,10 @@ class Client(object):
|
|||
item = args[0]
|
||||
layer = args[1]
|
||||
filename = args[2]
|
||||
layers = [l['id'] for l in self.api.site['layers']]
|
||||
if layer not in layers:
|
||||
print "invalid layer name, choices are: ", ', '.join(layers)
|
||||
sys.exit(1)
|
||||
for s in ox.srt.load(filename):
|
||||
self.api.addAnnotation({
|
||||
'item;': item,
|
||||
|
|
Loading…
Reference in a new issue