Preferences/ConfigurationPages/EmailPage.py

changeset 6823
55bda7c2404d
parent 6817
8fb29a716d1a
child 6825
e659bb96cdfa
equal deleted inserted replaced
6822:f34e48fdfd92 6823:55bda7c2404d
53 "<p>The credentials file is not present. Has the Gmail API" 53 "<p>The credentials file is not present. Has the Gmail API"
54 " been enabled?</p>")) 54 " been enabled?</p>"))
55 Preferences.setUser("UseGoogleMailOAuth2", False) 55 Preferences.setUser("UseGoogleMailOAuth2", False)
56 except ImportError: 56 except ImportError:
57 # missing libraries, disable Google Mail 57 # missing libraries, disable Google Mail
58 pipPackages = [
59 "google-api-python-client",
60 "google-auth-oauthlib",
61 ]
62 pipCommand = "pip install --upgrade {0}".format(
63 " ".join(pipPackages))
58 self.googleMailCheckBox.setChecked(False) 64 self.googleMailCheckBox.setChecked(False)
59 self.googleMailCheckBox.setEnabled(False) 65 self.googleMailCheckBox.setEnabled(False)
60 self.googleMailInfoLabel.setText(self.tr( 66 self.googleMailInfoLabel.setText(self.tr(
61 "<p>The Google Mail Client API is not installed." 67 "<p>The Google Mail Client API is not installed."
62 " Use <code>pip install --upgrade google-api-python-client" 68 " Use <code>{0}</code> to install it.</p>").format(pipCommand))
63 " google-auth-oauthlib</code> to install it.</p>"))
64 self.googleHelpButton.setEnabled(False) 69 self.googleHelpButton.setEnabled(False)
65 Preferences.setUser("UseGoogleMailOAuth2", False) 70 Preferences.setUser("UseGoogleMailOAuth2", False)
66 71
67 self.mailServerEdit.setText(Preferences.getUser("MailServer")) 72 self.mailServerEdit.setText(Preferences.getUser("MailServer"))
68 self.portSpin.setValue(Preferences.getUser("MailServerPort")) 73 self.portSpin.setValue(Preferences.getUser("MailServerPort"))

eric ide

mercurial