1163 args = Utilities.parseOptionString(consoleCmd) |
1163 args = Utilities.parseOptionString(consoleCmd) |
1164 args[0] = Utilities.getExecutablePath(args[0]) |
1164 args[0] = Utilities.getExecutablePath(args[0]) |
1165 args.append(self.__getPythonExecutable()) |
1165 args.append(self.__getPythonExecutable()) |
1166 args.append("manage.py") |
1166 args.append("manage.py") |
1167 args.append("runserver") |
1167 args.append("runserver") |
|
1168 if self.__plugin.getPreferences("UseIPv6"): |
|
1169 args.append("--ipv6") |
1168 addr = self.__plugin.getPreferences("ServerAddress") |
1170 addr = self.__plugin.getPreferences("ServerAddress") |
1169 if addr: |
1171 if addr: |
1170 args.append(addr) |
1172 args.append(addr) |
1171 |
1173 |
1172 try: |
1174 try: |
1203 def __runBrowser(self): |
1205 def __runBrowser(self): |
1204 """ |
1206 """ |
1205 Private slot to start the default web browser with the server URL. |
1207 Private slot to start the default web browser with the server URL. |
1206 """ |
1208 """ |
1207 addr = self.__plugin.getPreferences("ServerAddress") |
1209 addr = self.__plugin.getPreferences("ServerAddress") |
|
1210 ipv6 = self.__plugin.getPreferences("UseIPv6") |
1208 if addr: |
1211 if addr: |
1209 if ':' in addr: |
1212 # test for an IPv6 and port address |
1210 port = addr.split(':')[1] |
1213 if ']:' in addr: |
|
1214 addr, port = addr.rsplit(':', 1) |
|
1215 elif ':' in addr: |
|
1216 addr, port = addr.split(':', 1) |
1211 else: |
1217 else: |
1212 port = addr |
1218 port = addr |
|
1219 if ipv6: |
|
1220 addr = "[::1]" |
|
1221 else: |
|
1222 addr = "127.0.0.1" |
1213 else: |
1223 else: |
1214 port = "8000" |
1224 port = "8000" |
1215 url = QUrl("http://127.0.0.1:{0}".format(port)) |
1225 if ipv6: |
|
1226 addr = "[::1]" |
|
1227 else: |
|
1228 addr = "127.0.0.1" |
|
1229 url = QUrl("http://{0}:{1}".format(addr, port)) |
1216 res = QDesktopServices.openUrl(url) |
1230 res = QDesktopServices.openUrl(url) |
1217 if not res: |
1231 if not res: |
1218 E5MessageBox.critical(None, |
1232 E5MessageBox.critical(None, |
1219 self.trUtf8('Run Web-Browser'), |
1233 self.trUtf8('Run Web-Browser'), |
1220 self.trUtf8('Could not start the web-browser for the url "{0}".')\ |
1234 self.trUtf8('Could not start the web-browser for the url "{0}".')\ |
1642 args = Utilities.parseOptionString(consoleCmd) |
1656 args = Utilities.parseOptionString(consoleCmd) |
1643 args[0] = Utilities.getExecutablePath(args[0]) |
1657 args[0] = Utilities.getExecutablePath(args[0]) |
1644 args.append(self.__getPythonExecutable()) |
1658 args.append(self.__getPythonExecutable()) |
1645 args.append("manage.py") |
1659 args.append("manage.py") |
1646 args.append("testserver") |
1660 args.append("testserver") |
|
1661 if self.__plugin.getPreferences("UseIPv6"): |
|
1662 args.append("--ipv6") |
1647 addr = self.__plugin.getPreferences("ServerAddress") |
1663 addr = self.__plugin.getPreferences("ServerAddress") |
1648 if addr: |
1664 if addr: |
1649 args.append("--addrport=%s" % addr) |
1665 args.append("--addrport=%s" % addr) |
1650 args += fixtures |
1666 args += fixtures |
1651 |
1667 |