ProjectPyramid/Project.py

changeset 58
6acbfbba1e9d
parent 57
e654970c913e
child 63
f249a66da0d5
equal deleted inserted replaced
57:e654970c913e 58:6acbfbba1e9d
47 """ 47 """
48 Class transforming the call arguments in case of gnome-terminal. 48 Class transforming the call arguments in case of gnome-terminal.
49 """ 49 """
50 def start(self, cmd, args=[], mode=QProcessPyQt.ReadWrite): 50 def start(self, cmd, args=[], mode=QProcessPyQt.ReadWrite):
51 """ 51 """
52 Starts the given program (cmd) in a new process, if none is already 52 Public method to start the given program (cmd) in a new process, if
53 running, passing the command line arguments in argss. 53 none is already running, passing the command line arguments in args.
54 54
55 @param cmd start the given program cmd (string) 55 @param cmd start the given program cmd (string)
56 @keyparam args list of parameters (list of strings) 56 @keyparam args list of parameters (list of strings)
57 @keyparam mode access mode (QIODevice.OpenMode) 57 @keyparam mode access mode (QIODevice.OpenMode)
58 """ 58 """
62 super(QProcess, self).start(cmd, args, mode) 62 super(QProcess, self).start(cmd, args, mode)
63 63
64 @staticmethod 64 @staticmethod
65 def startDetached(cmd, args=[], path=''): 65 def startDetached(cmd, args=[], path=''):
66 """ 66 """
67 Starts the given program (cmd) in a new process, if none is already 67 Static method to start the given program (cmd) in a new process, if
68 running, passing the command line arguments in argss. 68 none is already running, passing the command line arguments in args.
69 69
70 @param cmd start the given program cmd (string) 70 @param cmd start the given program cmd (string)
71 @keyparam args list of parameters (list of strings) 71 @keyparam args list of parameters (list of strings)
72 @keyparam path new working directory (string) 72 @keyparam path new working directory (string)
73 @return tuple of successful start and process id (boolean, integer) 73 @return tuple of successful start and process id (boolean, integer)
519 E5MessageBox.critical( 519 E5MessageBox.critical(
520 self.__ui, 520 self.__ui,
521 self.trUtf8("New Form"), 521 self.trUtf8("New Form"),
522 self.trUtf8("<p>The new form file <b>{0}</b> could" 522 self.trUtf8("<p>The new form file <b>{0}</b> could"
523 " not be created.<br/> Problem: {1}</p>") 523 " not be created.<br/> Problem: {1}</p>")
524 .format(fname, e)) 524 .format(fname, e))
525 return 525 return
526 526
527 self.__e5project.appendFile(fname) 527 self.__e5project.appendFile(fname)
528 self.__formsBrowser.sourceFile.emit(fname) 528 self.__formsBrowser.sourceFile.emit(fname)
529 529
608 except (IOError, OSError): 608 except (IOError, OSError):
609 l0 = "" 609 l0 = ""
610 if variant.lower() in l0.lower() or \ 610 if variant.lower() in l0.lower() or \
611 "{0}.".format(variant[-1]) in l0 or \ 611 "{0}.".format(variant[-1]) in l0 or \
612 (variant == "Python2" and 612 (variant == "Python2" and
613 "python3" not in l0.lower() and 613 "python3" not in l0.lower() and
614 "python" in l0.lower()): 614 "python" in l0.lower()):
615 variants.append(variant) 615 variants.append(variant)
616 break 616 break
617 617
618 return variants 618 return variants
619 619
620 def __getVirtualEnvironment(self, language=""): 620 def __getVirtualEnvironment(self, language=""):
621 """ 621 """
1380 config = configparser.ConfigParser() 1380 config = configparser.ConfigParser()
1381 config.read(os.path.join(projectPath, "setup.cfg")) 1381 config.read(os.path.join(projectPath, "setup.cfg"))
1382 try: 1382 try:
1383 potFile = config.get("extract_messages", "output_file") 1383 potFile = config.get("extract_messages", "output_file")
1384 except configparser.NoSectionError: 1384 except configparser.NoSectionError:
1385 E5MessageBox.warning(self.__ui, 1385 E5MessageBox.warning(
1386 self.__ui,
1386 title, 1387 title,
1387 self.trUtf8('No setup.cfg found or no "extract_messages"' 1388 self.trUtf8('No setup.cfg found or no "extract_messages"'
1388 ' section found in setup.cfg.')) 1389 ' section found in setup.cfg.'))
1389 return 1390 return
1390 except configparser.NoOptionError: 1391 except configparser.NoOptionError:
1391 E5MessageBox.warning(self.__ui, 1392 E5MessageBox.warning(
1393 self.__ui,
1392 title, 1394 title,
1393 self.trUtf8('No "output_file" option found in setup.cfg.')) 1395 self.trUtf8('No "output_file" option found in setup.cfg.'))
1394 return 1396 return
1395 1397
1396 try: 1398 try:

eric ide

mercurial