def initStats(self):
url = "<STR_LIT>" % (self._proto, self._host, self._port, <EOL>self._statuspath)<EOL>response = util.get_url(url, self._user, self._password)<EOL>self._statusDict = {}<EOL>for line in response.splitlines():<EOL><INDENT>mobj = re.match('<STR_LIT>', line)<EOL>if mobj:<EOL><INDENT>idx = <NUM_LIT:0><EOL>for key in ('<STR_LIT>','<STR_LIT>','<STR_LIT>'):<EOL><INDENT>idx += <NUM_LIT:1><EOL>self._statusDict[key] = util.parse_value(mobj.group(idx))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for (key,val) in re.findall('<STR_LIT>', line):<EOL><INDENT>self._statusDict[key.lower()] = util.parse_value(val)<EOL><DEDENT><DEDENT><DEDENT>
Query and parse Nginx Web Server Status Page.