MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / check_location

Method check_location

mod/project/java/server_proxy.py:153–162  ·  view source on GitHub ↗
(self, proxy_dir: str)

Source from the content-addressed store, hash-verified

151 return data
152
153 def check_location(self, proxy_dir: str) -> Optional[str]:
154 # 伪静态文件路径
155 rewrite_conf_path = "%s/vhost/rewrite/%s%s.conf" % (self.panel_path, self.config_prefix, self.site_name)
156
157 rep_location = re.compile(r"\s*location\s+(\^~\s*)?%s\s*{" % re.escape(proxy_dir))
158
159 for i in [rewrite_conf_path, self._ng_file]:
160 conf = read_file(i)
161 if isinstance(conf, str) and rep_location.search(conf):
162 return '伪静态/站点主配置文件已经存路径【{}】的配置'.format(proxy_dir)
163
164 @staticmethod
165 def _set_nginx_proxy_base():

Callers 2

create_proxyMethod · 0.95
modify_proxyMethod · 0.95

Calls 4

read_fileFunction · 0.90
escapeMethod · 0.45
searchMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected