def requestAccepted(self, token): self.loginChanged = True self.hasLogin = True response = requests.post(self.oauthTokenURL.replace("REPLACE", token)) oauthToken = response.json()['access_token'] refreshToken = response.json()['refresh_token'] response = requests.get( self.VALIDATE_URL, headers={"Authorization": "OAuth " + oauthToken}) self.nickname = response.json()['login'] SettingManager.saveSetting( SettingManager.LOGIN_FILE, [self.nickname, "oauth:" + oauthToken, refreshToken]) self.updateUsername()
def connect(self): SettingManager.saveSetting( SettingManager.DEFAULT_CHANNEL_FILE, [self.defaultChannelLineEdit.text().lower()]) self.accept()
def writeLoginFile(nickname, oauthToken, refreshToken): content = [] content.append(nickname) content.append("oauth:" + oauthToken) content.append(refreshToken) SettingManager.saveSetting(SettingManager.LOGIN_FILE, content)
def saveSetting(self): settings = [] settings.append(self.chatFont.text()) settings.append(self.chatFontSize.text()) settings.append(self.chatLineSpacing.text()) SettingManager.saveSetting(SettingManager.MAIN_SETTING_FILE, settings)