@name 获取指定虚拟主机 @author lkq<2021-08-27> @param domain @return string
(self, domain)
| 888 | self.__TREE.write(self.__CONF_FILE, 'utf-8') |
| 889 | |
| 890 | def get_vhost(self, domain): |
| 891 | ''' |
| 892 | @name 获取指定虚拟主机 |
| 893 | @author lkq<2021-08-27> |
| 894 | @param domain<string> |
| 895 | @return string |
| 896 | ''' |
| 897 | try: |
| 898 | Hosts = self.__ENGINE.getchildren() |
| 899 | except: |
| 900 | Hosts = list(self.__ENGINE) |
| 901 | for host in Hosts: |
| 902 | if host.tag != 'Host': continue |
| 903 | if host.attrib['name'] == domain: |
| 904 | return host |
| 905 | return None |
| 906 | |
| 907 | def add_vhost(self, path, domain): |
| 908 | ''' |
no outgoing calls
no test coverage detected