620 |
620 |
621 # step 2: set a style sheet |
621 # step 2: set a style sheet |
622 styleSheetFile = Preferences.getUI("StyleSheet") |
622 styleSheetFile = Preferences.getUI("StyleSheet") |
623 if styleSheetFile: |
623 if styleSheetFile: |
624 try: |
624 try: |
625 f = open(styleSheetFile, "r") |
625 f = open(styleSheetFile, "r", encoding = "utf-8") |
626 styleSheet = f.read() |
626 styleSheet = f.read() |
627 f.close() |
627 f.close() |
628 except IOError as msg: |
628 except IOError as msg: |
629 QMessageBox.warning(None, |
629 QMessageBox.warning(None, |
630 self.trUtf8("Loading Style Sheet"), |
630 self.trUtf8("Loading Style Sheet"), |
2670 address = FeatureAddress |
2670 address = FeatureAddress |
2671 else: |
2671 else: |
2672 address = BugAddress |
2672 address = BugAddress |
2673 subject = "[eric5] " |
2673 subject = "[eric5] " |
2674 if attachFile is not None: |
2674 if attachFile is not None: |
2675 f = open(attachFile, "r") |
2675 f = open(attachFile, "r", encoding = "utf-8") |
2676 body = f.read() |
2676 body = f.read() |
2677 f.close() |
2677 f.close() |
2678 if deleteAttachFile: |
2678 if deleteAttachFile: |
2679 os.remove(attachFile) |
2679 os.remove(attachFile) |
2680 else: |
2680 else: |
2698 if os.path.exists(logFile): |
2698 if os.path.exists(logFile): |
2699 dlg = QMessageBox(QMessageBox.Question, self.trUtf8("Error log found"), |
2699 dlg = QMessageBox(QMessageBox.Question, self.trUtf8("Error log found"), |
2700 self.trUtf8("An error log file was found. " |
2700 self.trUtf8("An error log file was found. " |
2701 "What should be done with it?")) |
2701 "What should be done with it?")) |
2702 try: |
2702 try: |
2703 f = open(logFile, "r") |
2703 f = open(logFile, "r", encoding = "utf-8") |
2704 txt = f.read() |
2704 txt = f.read() |
2705 f.close() |
2705 f.close() |
2706 dlg.setDetailedText(txt) |
2706 dlg.setDetailedText(txt) |
2707 except IOError: |
2707 except IOError: |
2708 pass |
2708 pass |
3773 @param version indication for the requested version (Qt 4) (integer) |
3773 @param version indication for the requested version (Qt 4) (integer) |
3774 """ |
3774 """ |
3775 if fn is not None and version == 0: |
3775 if fn is not None and version == 0: |
3776 # determine version from file, if not specified |
3776 # determine version from file, if not specified |
3777 try: |
3777 try: |
3778 f = open(fn, "r") |
3778 f = open(fn, "r", encoding = "utf-8") |
3779 found = False |
3779 found = False |
3780 while not found: |
3780 while not found: |
3781 uiLine = f.readline() |
3781 uiLine = f.readline() |
3782 found = uiLine.lower().startswith("<ui ") |
3782 found = uiLine.lower().startswith("<ui ") |
3783 f.close() |
3783 f.close() |
4848 """ |
4848 """ |
4849 try: |
4849 try: |
4850 fn = os.path.join(Utilities.getConfigDir(), "eric5tasks.e4t") |
4850 fn = os.path.join(Utilities.getConfigDir(), "eric5tasks.e4t") |
4851 if not os.path.exists(fn): |
4851 if not os.path.exists(fn): |
4852 return |
4852 return |
4853 f = open(fn, "r") |
4853 f = open(fn, "r", encoding = "utf-8") |
4854 line = f.readline() |
4854 line = f.readline() |
4855 dtdLine = f.readline() |
4855 dtdLine = f.readline() |
4856 f.close() |
4856 f.close() |
4857 except IOError: |
4857 except IOError: |
4858 QMessageBox.critical(None, |
4858 QMessageBox.critical(None, |
4927 QMessageBox.critical(None, |
4927 QMessageBox.critical(None, |
4928 self.trUtf8("Read session"), |
4928 self.trUtf8("Read session"), |
4929 self.trUtf8("<p>The session file <b>{0}</b> could not be read.</p>")\ |
4929 self.trUtf8("<p>The session file <b>{0}</b> could not be read.</p>")\ |
4930 .format(fn)) |
4930 .format(fn)) |
4931 return |
4931 return |
4932 f = open(fn, "r") |
4932 f = open(fn, "r", encoding = "utf-8") |
4933 line = f.readline() |
4933 line = f.readline() |
4934 dtdLine = f.readline() |
4934 dtdLine = f.readline() |
4935 f.close() |
4935 f.close() |
4936 except IOError: |
4936 except IOError: |
4937 QMessageBox.critical(None, |
4937 QMessageBox.critical(None, |