-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreatereplica.py
42 lines (29 loc) · 968 Bytes
/
createreplica.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
import sys
import os
import replica
import gdb
# have not run this recently leaving here as ref
if __name__ == "__main__":
parentsdeconn = sys.argv[1]
childsdeconn = sys.argv[2]
replicaname = sys.argv[3].upper()
in_data = sys.argv[4]
os.environ['SDEFILE'] = parentsdeconn
parentgdb = gdb.Gdb()
os.environ['SDEFILE'] = childsdeconn
childgdb = gdb.Gdb()
# slow and steady so we can read it later
in_datalist = in_data.split(",")
featureclasslist = []
for featureclass in in_datalist:
featureclasslist.append(os.path.join(parentsdeconn
,featureclass))
babyreplica = replica.Replica(parentgdb
,childgdb
,replicaname)
retval = babyreplica.create(featureclasslist)
if retval == 'success':
exit(0)
else:
print(retval)
exit(1)