mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 07:57:07 +00:00
Make P1 imports not fail if called needlessly.
If their respective configuration keys are not defined in a survey configuration, the import routines will print an informational message and exit successfully.
This commit is contained in:
@@ -30,7 +30,12 @@ if __name__ == '__main__':
|
||||
|
||||
db.set_survey(survey["schema"])
|
||||
|
||||
final_p111 = survey["final"]["p111"]
|
||||
try:
|
||||
final_p111 = survey["final"]["p111"]
|
||||
except KeyError:
|
||||
print("No final P1/11 configuration")
|
||||
exit(0)
|
||||
|
||||
pattern = final_p111["pattern"]
|
||||
rx = re.compile(pattern["regex"])
|
||||
|
||||
|
||||
@@ -30,7 +30,12 @@ if __name__ == '__main__':
|
||||
|
||||
db.set_survey(survey["schema"])
|
||||
|
||||
final_p190 = survey["final"]["p190"]
|
||||
try:
|
||||
final_p190 = survey["final"]["p190"]
|
||||
except KeyError:
|
||||
print("No final P1/90 configuration")
|
||||
exit(0)
|
||||
|
||||
pattern = final_p190["pattern"]
|
||||
rx = re.compile(pattern["regex"])
|
||||
|
||||
|
||||
@@ -30,7 +30,12 @@ if __name__ == '__main__':
|
||||
|
||||
db.set_survey(survey["schema"])
|
||||
|
||||
raw_p111 = survey["raw"]["p111"]
|
||||
try:
|
||||
raw_p111 = survey["raw"]["p111"]
|
||||
except KeyError:
|
||||
print("No raw P1/11 configuration")
|
||||
exit(0)
|
||||
|
||||
pattern = raw_p111["pattern"]
|
||||
rx = re.compile(pattern["regex"])
|
||||
|
||||
|
||||
@@ -30,7 +30,12 @@ if __name__ == '__main__':
|
||||
|
||||
db.set_survey(survey["schema"])
|
||||
|
||||
raw_p190 = survey["raw"]["p190"]
|
||||
try:
|
||||
raw_p190 = survey["raw"]["p190"]
|
||||
except KeyError:
|
||||
print("No raw P1/90 configuration")
|
||||
exit(0)
|
||||
|
||||
pattern = raw_p190["pattern"]
|
||||
rx = re.compile(pattern["regex"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user