ProjectDjango/DjangoCheckOptionsDialog.py

changeset 169
b8f263e05c39
parent 168
c6182aab51e9
child 172
ea7980ded4f3
equal deleted inserted replaced
168:c6182aab51e9 169:b8f263e05c39
38 @param deployMode flag indicating to activate the deployment mode 38 @param deployMode flag indicating to activate the deployment mode
39 @type bool 39 @type bool
40 @param parent reference to the parent widget 40 @param parent reference to the parent widget
41 @type QWidget 41 @type QWidget
42 """ 42 """
43 super(DjangoCheckOptionsDialog, self).__init__(parent) 43 super().__init__(parent)
44 self.setupUi(self) 44 self.setupUi(self)
45 45
46 self.settingsFileButton.setIcon(UI.PixmapCache.getIcon("open")) 46 self.settingsFileButton.setIcon(UI.PixmapCache.getIcon("open"))
47 47
48 self.__python = python 48 self.__python = python
89 @param path file path to be converted 89 @param path file path to be converted
90 @type str 90 @type str
91 @return module name 91 @return module name
92 @rtype str 92 @rtype str
93 """ 93 """
94 if self.__path.endswith(("/", "\\")): 94 start = (
95 # cope with a bug in eric 95 self.__path[:-1]
96 start = self.__path[:-1] 96 if self.__path.endswith(("/", "\\")) else
97 else: 97 self.__path
98 start = self.__path 98 )
99 relPath = Utilities.relativeUniversalPath(path, start) 99 relPath = Utilities.relativeUniversalPath(path, start)
100 mod = os.path.splitext(relPath)[0].replace("/", ".") 100 mod = os.path.splitext(relPath)[0].replace("/", ".")
101 return mod 101 return mod
102 102
103 def __moduleToPath(self, moduleName): 103 def __moduleToPath(self, moduleName):
144 144
145 proc = QProcess() 145 proc = QProcess()
146 if self.__path: 146 if self.__path:
147 proc.setWorkingDirectory(self.__path) 147 proc.setWorkingDirectory(self.__path)
148 proc.start(self.__python, args) 148 proc.start(self.__python, args)
149 if proc.waitForStarted(): 149 if proc.waitForStarted() and proc.waitForFinished():
150 if proc.waitForFinished(): 150 output = str(proc.readAllStandardOutput(),
151 output = str(proc.readAllStandardOutput(), 151 Preferences.getSystem("IOEncoding"), 'replace')
152 Preferences.getSystem("IOEncoding"), 'replace') 152 for line in output.splitlines():
153 for line in output.splitlines(): 153 self.tagsList.addItem(line.strip())
154 self.tagsList.addItem(line.strip())
155 154
156 # step 4: re-select tags 155 # step 4: re-select tags
157 for tag in selectedTags: 156 for tag in selectedTags:
158 items = self.tagsList.findItems(tag, Qt.MatchCaseSensitive) 157 items = self.tagsList.findItems(tag, Qt.MatchCaseSensitive)
159 if items: 158 if items:

eric ide

mercurial