docs: def run_plugin(plugin,**kwargs):
      """
          Run a plugin
      """
     
      args = [sys.executable]
  
      #Get plugin executable
      home = os.path.expanduser('~')
      path_to_plugin = os.path.join(home, 'svn/HYDRA/HydraPlugins', plugin.location)
      args.append(path_to_plugin)
      
      #Parse plugin arguments into a string
      plugin_params = " "
      for p in plugin.params:
          param = "--%s=%s "%(p.name, p.value)
          args.append("--%s"%p.name)
          args.append(p.value)
          plugin_params = plugin_params + param
  
      log_dir = config.get('plugin', 'result_file')
      log_file = os.path.join(home, log_dir, plugin.name)
  
      #this reads all the logs so far. We're not interested in them
      #Everything after this is new content to the file
      try:
          f = open(log_file, 'r')
          f.read()
      except:
          f = open(log_file, 'w')
          f.close()
          f = open(log_file, 'r')
  
      pid = subprocess.Popen(args).pid
      #run plugin
      #os.system("%s %s"%(path_to_plugin, plugin_params))
      
      log.info("Process started! PID: %s", pid)
  
      return str(pid)