def encryptedRoot(self, hostname=None): """ Return a string representing the HTTPS URL which is at the root of this site. @param hostname: An optional unicode string which, if specified, will be used as the hostname in the resulting URL, regardless of the C{hostname} attribute of this item. """ warnings.warn( "Use ISiteURLGenerator.rootURL instead of WebSite.encryptedRoot.", category=DeprecationWarning, stacklevel=2) if self.store.parent is not None: generator = ISiteURLGenerator(self.store.parent) else: generator = ISiteURLGenerator(self.store) return generator.encryptedRoot(hostname)
def maybeEncryptedRoot(self, hostname=None): """ Returning a string representing the HTTPS URL which is at the root of this site, falling back to HTTP if HTTPS service is not available. @param hostname: An optional unicode string which, if specified, will be used as the hostname in the resulting URL, regardless of the C{hostname} attribute of this item. """ warnings.warn( "Use ISiteURLGenerator.rootURL instead of " "WebSite.maybeEncryptedRoot", category=DeprecationWarning, stacklevel=2) if self.store.parent is not None: generator = ISiteURLGenerator(self.store.parent) else: generator = ISiteURLGenerator(self.store) root = generator.encryptedRoot(hostname) if root is None: root = generator.cleartextRoot(hostname) return root