-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathSiteManagerPlugin.py
More file actions
34 lines (25 loc) · 1010 Bytes
/
SiteManagerPlugin.py
File metadata and controls
34 lines (25 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from Config import config
from Plugin import PluginManager
from .DNSResolver import DNSResolver
allow_reload = False
@PluginManager.registerTo('SiteManager')
class SiteManagerPlugin:
_dns_resolver = None
@property
def dns_resolver(self):
if not self._dns_resolver:
nameservers = config.dns_nameservers
configure = config.dns_configure
self._dns_resolver = DNSResolver(
site_manager=self,
nameservers=nameservers,
configure=configure,
)
return self._dns_resolver
def load(self, *args, **kwargs):
super(SiteManagerPlugin, self).load(*args, **kwargs)
self.dns_resolver.load()
def isDomain(self, address):
return self.dns_resolver.isDomain(address) or super(SiteManagerPlugin, self).isDomain(address)
def resolveDomain(self, domain):
return self.dns_resolver.resolveDomain(domain) or super(SiteManagerPlugin, self).resolveDomain(domain)