def post(self, app_id):
    global location_tree
    app_ind = getAppIndex(app_id)

    set_wukong_status("Start deploying")
    applications[app_ind].status = "    "
    if SIMULATION==1:
      from wkpf.xml2java.translator import generateJava
      from wkpf.codegen import generateCode
      generateCode(applications[app_ind])
      generateJava(applications[app_ind])
      set_wukong_status("")
      applications[app_ind].status = ""
    else:
      if app_ind == None:
        self.content_type = 'application/json'
        self.write({'status':1, 'mesg': 'Cannot find the application'})
      else:
        platforms = ['avr_mega2560']
        # signal deploy in other greenlet task
        wusignal.signal_deploy(platforms)
        set_active_application_index(app_ind)
             
        self.content_type = 'application/json'
        self.write({'status':0, 'version': applications[app_ind].version})
Exemple #2
0
  def post(self, app_id):
    app_ind = getAppIndex(app_id)

    wkpf.globals.set_wukong_status("Deploying")
    if app_ind == None:
      self.content_type = 'application/json'
      self.write({'status':1, 'mesg': 'Cannot find the application'})
    else:
      platforms = ['avr_mega2560']
      # signal deploy in other greenlet task
      wusignal.signal_deploy(platforms)
      wkpf.globals.set_active_application_index(app_ind)
         
      self.content_type = 'application/json'
      self.write({
        'status':0,
        'version': wkpf.globals.applications[app_ind].version})
  def post(self, app_id):
    app_ind = getAppIndex(app_id)

    wkpf.globals.set_wukong_status("Deploying")
    if app_ind == None:
      self.content_type = 'application/json'
      self.write({'status':1, 'mesg': 'Cannot find the application'})
    else:
      platforms = ['avr_mega2560']
      # signal deploy in other greenlet task
      wusignal.signal_deploy(platforms)
      wkpf.globals.set_active_application_index(app_ind)
         
      self.content_type = 'application/json'
      self.write({
        'status':0,
        'version': wkpf.globals.applications[app_ind].version})