parameters: (siteName,sitePath)
return_statement: return path
docstring: @name 获取网站运行目录
          @author hwliang<2020-08-05>
          @param siteName(string) 网站名称
          @param sitePath(string) 网站根目录
          @return string
function: def get_site_run_path(siteName,sitePath):
      '''
          @name 获取网站运行目录
          @author hwliang<2020-08-05>
          @param siteName(string) 网站名称
          @param sitePath(string) 网站根目录
          @return string
      '''
      global webserver_type,setupPath
      if not webserver_type:
          webserver_type = public.get_webserver()
      path = None
      if webserver_type == 'nginx':
          filename = setupPath + '/panel/vhost/nginx/' + siteName + '.conf'
          if os.path.exists(filename):
              conf = public.readFile(filename)
              rep = r'\s*root\s+(.+);'
              tmp1 = re.search(rep,conf)
              if tmp1: path = tmp1.groups()[0]
  
      elif webserver_type == 'apache':
          filename = setupPath + '/panel/vhost/apache/' + siteName + '.conf'
          if os.path.exists(filename):
              conf = public.readFile(filename)
              rep = r'\s*DocumentRoot\s*"(.+)"\s*\n'
              tmp1 = re.search(rep,conf)
              if tmp1: path = tmp1.groups()[0]
      else:
          filename = setupPath + '/panel/vhost/openlitespeed/' + siteName + '.conf'
          if os.path.exists(filename):
              conf = public.readFile(filename)
              rep = r"vhRoot\s*(.*)"
              path = re.search(rep,conf)
              if not path:
                  path = None
              else:
                  path = path.groups()[0]
  
      if not path:
          path = sitePath
  
      return path
function_tokens: def get_site_run_path ( siteName , sitePath ) : global webserver_type , setupPath if not webserver_type : webserver_type = public . get_webserver ( ) path = None if webserver_type == 'nginx' : filename = setupPath + '/panel/vhost/nginx/' + siteName + '.conf' if os . path . exists ( filename ) : conf = public . readFile ( filename ) rep = r'\s*root\s+(.+);' tmp1 = re . search ( rep , conf ) if tmp1 : path = tmp1 . groups ( ) [ 0 ] elif webserver_type == 'apache' : filename = setupPath + '/panel/vhost/apache/' + siteName + '.conf' if os . path . exists ( filename ) : conf = public . readFile ( filename ) rep = r'\s*DocumentRoot\s*"(.+)"\s*\n' tmp1 = re . search ( rep , conf ) if tmp1 : path = tmp1 . groups ( ) [ 0 ] else : filename = setupPath + '/panel/vhost/openlitespeed/' + siteName + '.conf' if os . path . exists ( filename ) : conf = public . readFile ( filename ) rep = r"vhRoot\s*(.*)" path = re . search ( rep , conf ) if not path : path = None else : path = path . groups ( ) [ 0 ] if not path : path = sitePath return path