def GetTreeStatus(url=None):
    "Fetches the tree status and returns either 'open', 'closed',\n  'unknown' or 'unset'."
    url = (url or settings.GetTreeStatusUrl(error_ok=True))
    if url:
        status = urllib2.urlopen(url).read().lower()
        if ((status.find('closed') != (- 1)) or (status == '0')):
            return 'closed'
        elif ((status.find('open') != (- 1)) or (status == '1')):
            return 'open'
        return 'unknown'
    return 'unset'
Fetches the tree status and returns either 'open', 'closed',
'unknown' or 'unset'.
def GetTreeStatus(url=None):
    "Fetches the tree status and returns either 'open', 'closed',\n  'unknown' or 'unset'."
    url = (url or settings.GetTreeStatusUrl(error_ok=True))
    if url:
        status = urllib2.urlopen(url).read().lower()
        if ((status.find('closed') != (- 1)) or (status == '0')):
            return 'closed'
        elif ((status.find('open') != (- 1)) or (status == '1')):
            return 'open'
        return 'unknown'
    return 'unset'