+if __name__ == '__main__':
+ options, config_opts = set_stuff_up()
+ while True:
+ try:
+ do_vend_server(options, config_opts)
+ except KeyboardInterrupt:
+ print "Killed by signal."
+ break
+ except SystemExit, e:
+ raise e
+ except:
+ (exc_type, exc_value, exc_traceback) = sys.exc_info()
+ print
+ print "Uh-oh, unhandled " + str(exc_type) + " exception"
+ print "Message: ", str(exc_value)
+ print
+ print_tb(exc_traceback)
+ del exc_traceback
+ print
+ print "This message should be considered a bug in the Vend Server."
+ print "Please report this to someone who can fix it."
+ sleep(10)
+ print
+ print "Trying again anyway (might not help, but hey...)"
+