Пример #1
0
 def destroy_program(self, model):
     try:
         print "*** Destroy Program %s ***" % model.name
         model.status = "executing"
         model.messages = ""
         model.save()
         xt = XOSTosca(model.contents, parent_dir=currentdir)
         xt.destroy(model.owner)
         model.messages = "\n".join(xt.log_msgs)
         model.status = "complete"
     except:
         model.messages = traceback.format_exc()
         model.status = "exception"
         traceback.print_exc()
     model.command = None
     model.save()
Пример #2
0
 def run_program(self, model):
     try:
         print "*** Run Program %s ***" % model.name
         model.status = "executing"
         model.messages = ""
         model.save()
         xt = XOSTosca(model.contents, parent_dir=currentdir, log_to_console=True)
         xt.execute(model.owner)
         model.messages = "\n".join(xt.log_msgs)
         model.status = "complete"
     except:
         model.messages = traceback.format_exc()
         model.status = "exception"
         traceback.print_exc()
     model.command = None
     model.save()