eric6/Plugins/VcsPlugins/vcsMercurial/HgUserConfigDialog.py

branch
without_py2_and_pyqt4
changeset 7192
a22eee00b052
parent 7010
5d6f5a69a952
child 7229
53054eb5b15a
equal deleted inserted replaced
7191:960850ec284c 7192:a22eee00b052
8 """ 8 """
9 9
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11 11
12 import os 12 import os
13 from configparser import ConfigParser
13 14
14 from PyQt5.QtCore import pyqtSlot, Qt, QEvent 15 from PyQt5.QtCore import pyqtSlot, Qt, QEvent
15 from PyQt5.QtWidgets import QDialog, QTreeWidgetItem 16 from PyQt5.QtWidgets import QDialog, QTreeWidgetItem
16 17
17 from E5Gui.E5PathPicker import E5PathPickerModes 18 from E5Gui.E5PathPicker import E5PathPickerModes
18 from E5Gui import E5MessageBox 19 from E5Gui import E5MessageBox
19 20
20 import Globals 21 import Globals
21 from Globals.E5ConfigParser import E5ConfigParser
22 22
23 from .HgUtilities import getConfigPath 23 from .HgUtilities import getConfigPath
24 from .HgUserConfigHostFingerprintDialog import \ 24 from .HgUserConfigHostFingerprintDialog import \
25 HgUserConfigHostFingerprintDialog 25 HgUserConfigHostFingerprintDialog
26 from .HgUserConfigHostMinimumProtocolDialog import \ 26 from .HgUserConfigHostMinimumProtocolDialog import \
102 def writeUserConfig(self): 102 def writeUserConfig(self):
103 """ 103 """
104 Public method to write the user configuration file. 104 Public method to write the user configuration file.
105 """ 105 """
106 if self.__config is None: 106 if self.__config is None:
107 self.__config = E5ConfigParser() 107 self.__config = ConfigParser()
108 108
109 ################################################################### 109 ###################################################################
110 ## ui section 110 ## ui section
111 ################################################################### 111 ###################################################################
112 if "ui" not in self.__config: 112 if "ui" not in self.__config:
305 """ 305 """
306 Public method to read the user configuration file. 306 Public method to read the user configuration file.
307 """ 307 """
308 cfgFile = getConfigPath() 308 cfgFile = getConfigPath()
309 309
310 self.__config = E5ConfigParser(delimiters=("=",)) 310 self.__config = ConfigParser(delimiters=("=",))
311 if self.__config.read(cfgFile): 311 if self.__config.read(cfgFile):
312 # step 1: extract user name and email 312 # step 1: extract user name and email
313 try: 313 try:
314 username = self.__config["ui"]["username"].strip() 314 username = self.__config["ui"]["username"].strip()
315 if "<" in username and username.endswith(">"): 315 if "<" in username and username.endswith(">"):

eric ide

mercurial