Package raspdev.handlers

Source Code of raspdev.handlers.ExecuteSetup

package raspdev.handlers;

import java.io.File;
import java.io.IOException;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;

import raspdev.ParsConf;

public class ExecuteSetup extends AbstractHandler{

  public ExecuteSetup() {
    // TODO Auto-generated constructor stub
  }

  @Override
  public Object execute(ExecutionEvent arg0) throws ExecutionException {
    // TODO Auto-generated method stub
    Runtime run = Runtime.getRuntime();
      File fscript=new File(ParsConf.getConfig()+File.separatorChar+"pyscript"+File.separatorChar);
      ParsConf pc = new ParsConf();
    pc.generatePars();
    String pathProject = ParsConf.getPathProject();

          Process pr;
        try {
          pr = run.exec("python automakesetup.py "+pathProject+"config"+File.separatorChar+"raspManifest.xml "+pathProject+File.separatorChar, null,fscript);
          pr.waitFor();
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        } catch (InterruptedException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
    return null;
  }

}
TOP

Related Classes of raspdev.handlers.ExecuteSetup

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.