Code: Alles auswählen
# check if pecularities already exist
req = urllib2.Request(....)
if not test_run:
response = json.loads(opener.open(req).read())
if test_run or not response['data']:
# data clearing active
post_data = json.dumps({
"name": seg_name,
"subKey": seg_key,
"description": seg_desc,})
req = urllib2.Request(....)
print_request(req)
if not test_run:
response = json.loads(opener.open(req).read())
print "created object: " + str(response)
else:
print_request(req)
else:.......