def acceptedUser(self, logType):
from urllib2 import urlopen, URLError, HTTPError<EOL>import json<EOL>isApproved = False<EOL>userName = str(self.logui.userName.text())<EOL>if userName == "<STR_LIT>":<EOL><INDENT>return False  <EOL><DEDENT>if logType == "<STR_LIT>":<EOL><INDENT>networkFault = False<EOL>data = []<EOL>log_url = "<STR_LIT>" + userName<EOL>try:<EOL><INDENT>data = urlopen(log_url, None, <NUM_LIT:5>).read()<EOL>data = json.loads(data)<EOL><DEDENT>except URLError as error:<EOL><INDENT>print("<STR_LIT>" + str(error.reason))<EOL>networkFault = True<EOL><DEDENT>except HTTPError as error:<EOL><INDENT>print("<STR_LIT>" + str(error.reason))<EOL>networkFault = True<EOL><DEDENT>if networkFault:<EOL><INDENT>msgBox = QMessageBox()<EOL>msgBox.setText("<STR_LIT>")<EOL>msgBox.setInformativeText("<STR_LIT>")<EOL>msgBox.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)<EOL>msgBox.setDefaultButton(QMessageBox.Ok)<EOL>if msgBox.exec_() == QMessageBox.Ok:<EOL><INDENT>isApproved = True<EOL><DEDENT><DEDENT>if data != [] and (data is not None):<EOL><INDENT>isApproved = True<EOL><DEDENT><DEDENT>else:<EOL><INDENT>isApproved = True<EOL><DEDENT>return isApproved<EOL>
Verify enetered user name is on accepted MCC logbook list.