Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 5 commits
  • 20 files changed
  • 0 comments
  • 3 contributors
6 ninja_ide/core/settings.py
@@ -28,8 +28,6 @@
28 28
29 29 # Use this flags instead of sys.platform spreaded in the source code
30 30 IS_WINDOWS = False
31   -IS_MAC = False
32   -IS_LINUX = True
33 31
34 32 OS_KEY = "Ctrl"
35 33
@@ -42,13 +40,11 @@
42 40 FONT_FAMILY = 'Monaco'
43 41 FONT_SIZE = 11
44 42 OS_KEY = QKeySequence(Qt.CTRL).toString(QKeySequence.NativeText)
45   - IS_MAC = True
46   - IS_LINUX = False
  43 + EOL_DEFAULT = 'Mac'
47 44 elif sys.platform == "win32":
48 45 FONT_FAMILY = 'Courier'
49 46 FONT_SIZE = 10
50 47 IS_WINDOWS = True
51   - IS_LINUX = False
52 48
53 49 ###############################################################################
54 50 # IDE
8 ninja_ide/gui/actions.py
@@ -464,7 +464,7 @@ def _add_file_to_project(self, path):
464 464 editorWidget._file_saved()
465 465 except file_manager.NinjaFileExistsException as ex:
466 466 QMessageBox.information(self, self.tr("File Already Exists"),
467   - self.tr("Invalid Path: the file '%s' already exists." %
  467 + (self.tr("Invalid Path: the file '%s' already exists.") %
468 468 ex.filename))
469 469
470 470 def add_project_to_console(self, projectFolder):
@@ -561,10 +561,10 @@ def count_file_code_lines(self):
561 561 blanks = re.findall('(^\n)|(^(\s+)?#)|(^( +)?($|\n))',
562 562 editorWidget.get_text(), re.M)
563 563 blanks_count = len(blanks)
564   - resume = self.tr("Lines code: %s\n" % (block_count - blanks_count))
565   - resume += self.tr("Blanks and commented lines: %s\n\n" %
  564 + resume = self.tr("Lines code: %s\n") % (block_count - blanks_count)
  565 + resume += (self.tr("Blanks and commented lines: %s\n\n") %
566 566 blanks_count)
567   - resume += self.tr("Total lines: %s" % block_count)
  567 + resume += self.tr("Total lines: %s") % block_count
568 568 msgBox = QMessageBox(QMessageBox.Information,
569 569 self.tr("Summary of lines"), resume,
570 570 QMessageBox.Ok, editorWidget)
4 ninja_ide/gui/central_widget.py
@@ -217,11 +217,11 @@ def __init__(self, explorer):
217 217 self.style().standardPixmap(self.style().SP_TrashIcon))
218 218 self.combo.setToolTip(self.trUtf8("Select the item from the Paste "
219 219 "Historial list.\nYou can Copy items into this list with: "
220   - "%s\nor Paste them using: %s" %
  220 + "%s\nor Paste them using: %s") %
221 221 (resources.get_shortcut("History-Copy").toString(
222 222 QKeySequence.NativeText),
223 223 resources.get_shortcut("History-Paste").toString(
224   - QKeySequence.NativeText))))
  224 + QKeySequence.NativeText)))
225 225 self.combo.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
226 226 hbox.addWidget(self.combo)
227 227 vbox.addLayout(hbox)
10 ninja_ide/gui/dialogs/about_ninja.py
@@ -65,17 +65,17 @@ def __init__(self, parent=None):
65 65 to build Python Applications.
66 66 NINJA-IDE provides tools to simplify the Python-software development
67 67 and handles all kinds of situations thanks to its rich extensibility.""")))
68   - vbox.addWidget(QLabel(self.tr("Version: %s" % ninja_ide.__version__)))
  68 + vbox.addWidget(QLabel(self.tr("Version: %s") % ninja_ide.__version__))
69 69 link_ninja = QLabel(
70 70 self.tr('Website: <a href="%s"><span style=" '
71 71 'text-decoration: underline; color:#ff9e21;">'
72   - '%s</span></a>' %
73   - (ninja_ide.__url__, ninja_ide.__url__)))
  72 + '%s</span></a>') %
  73 + (ninja_ide.__url__, ninja_ide.__url__))
74 74 vbox.addWidget(link_ninja)
75 75 link_source = QLabel(
76 76 self.tr('Source Code: <a href="%s"><span style=" '
77   - 'text-decoration: underline; color:#ff9e21;">%s</span></a>' %
78   - (ninja_ide.__source__, ninja_ide.__source__)))
  77 + 'text-decoration: underline; color:#ff9e21;">%s</span></a>') %
  78 + (ninja_ide.__source__, ninja_ide.__source__))
79 79 vbox.addWidget(link_source)
80 80
81 81 self.connect(link_ninja, SIGNAL("linkActivated(QString)"),
94 ninja_ide/gui/dialogs/preferences.py
@@ -955,51 +955,55 @@ class EditorConfiguration(QWidget):
955 955
956 956 def __init__(self):
957 957 QWidget.__init__(self)
958   - grid = QGridLayout(self)
  958 + vbox = QVBoxLayout(self)
959 959
960 960 #Indentation
961 961 groupBoxFeatures = QGroupBox(self.tr("Features:"))
962   - grid.addWidget(groupBoxFeatures, 0, 0, alignment=Qt.AlignTop)
963   - grid.addWidget(QLabel(
  962 + formFeatures = QGridLayout(groupBoxFeatures)
  963 + formFeatures.addWidget(QLabel(
964 964 self.tr("Indentation Length:")), 1, 0, Qt.AlignRight)
965 965 self._spin = QSpinBox()
966 966 self._spin.setAlignment(Qt.AlignRight)
967 967 self._spin.setMinimum(1)
968 968 self._spin.setValue(settings.INDENT)
969   - grid.addWidget(self._spin, 1, 1, alignment=Qt.AlignTop)
  969 + formFeatures.addWidget(self._spin, 1, 1, alignment=Qt.AlignTop)
970 970 self._checkUseTabs = QCheckBox(
971 971 self.tr("Use Tabs."))
972 972 self._checkUseTabs.setChecked(settings.USE_TABS)
973 973 self.connect(self._checkUseTabs, SIGNAL("stateChanged(int)"),
974 974 self._change_tab_spaces)
975   - grid.addWidget(self._checkUseTabs, 1, 2, alignment=Qt.AlignTop)
  975 + formFeatures.addWidget(self._checkUseTabs, 1, 2, alignment=Qt.AlignTop)
976 976 if settings.USE_TABS:
977 977 self._spin.setSuffix(self.tr(" (tab size)"))
978 978 else:
979 979 self._spin.setSuffix(self.tr(" (spaces)"))
980 980 #Margin Line
981   - grid.addWidget(QLabel(self.tr("Margin Line:")), 2, 0, Qt.AlignRight)
  981 + formFeatures.addWidget(QLabel(self.tr("Margin Line:")), 2, 0,
  982 + Qt.AlignRight)
982 983 self._spinMargin = QSpinBox()
983 984 self._spinMargin.setMaximum(200)
984 985 self._spinMargin.setValue(settings.MARGIN_LINE)
985   - grid.addWidget(self._spinMargin, 2, 1, alignment=Qt.AlignTop)
  986 + formFeatures.addWidget(self._spinMargin, 2, 1, alignment=Qt.AlignTop)
986 987 self._checkShowMargin = QCheckBox(self.tr("Show Margin Line"))
987 988 self._checkShowMargin.setChecked(settings.SHOW_MARGIN_LINE)
988   - grid.addWidget(self._checkShowMargin, 2, 2, alignment=Qt.AlignTop)
  989 + formFeatures.addWidget(self._checkShowMargin, 2, 2,
  990 + alignment=Qt.AlignTop)
989 991 #End of line
990 992 self._checkEndOfLine = QCheckBox(self.tr("Use Platform End of Line"))
991 993 self._checkEndOfLine.setChecked(settings.USE_PLATFORM_END_OF_LINE)
992   - grid.addWidget(self._checkEndOfLine, 3, 1, alignment=Qt.AlignTop)
  994 + formFeatures.addWidget(self._checkEndOfLine, 3, 1,
  995 + alignment=Qt.AlignTop)
993 996 #Find Errors
994 997 self._checkHighlightLine = QCheckBox(
995 998 self.tr("Check: Highlight errors using Underline\n"
996 999 "Uncheck: Highlight errors using Background"))
997 1000 self._checkHighlightLine.setChecked(settings.UNDERLINE_NOT_BACKGROUND)
998   - grid.addWidget(self._checkHighlightLine, 4, 1, 1, 2,
  1001 + formFeatures.addWidget(self._checkHighlightLine, 4, 1, 1, 2,
999 1002 alignment=Qt.AlignTop)
1000 1003 self._checkErrors = QCheckBox(self.tr("Find and Show Errors."))
1001 1004 self._checkErrors.setChecked(settings.FIND_ERRORS)
1002   - grid.addWidget(self._checkErrors, 5, 1, 1, 2, alignment=Qt.AlignTop)
  1005 + formFeatures.addWidget(self._checkErrors, 5, 1, 1, 2,
  1006 + alignment=Qt.AlignTop)
1003 1007 self.connect(self._checkErrors, SIGNAL("stateChanged(int)"),
1004 1008 self._disable_show_errors)
1005 1009 self._showErrorsOnLine = QCheckBox(
@@ -1007,12 +1011,13 @@ def __init__(self):
1007 1011 self._showErrorsOnLine.setChecked(settings.ERRORS_HIGHLIGHT_LINE)
1008 1012 self.connect(self._showErrorsOnLine, SIGNAL("stateChanged(int)"),
1009 1013 self._enable_errors_inline)
1010   - grid.addWidget(self._showErrorsOnLine, 6, 2, 1, 1, Qt.AlignTop)
  1014 + formFeatures.addWidget(self._showErrorsOnLine, 6, 2, 1, 1, Qt.AlignTop)
1011 1015 #Find Check Style
1012 1016 self._checkStyle = QCheckBox(
1013 1017 self.tr("Find and Show Check Style errors."))
1014 1018 self._checkStyle.setChecked(settings.CHECK_STYLE)
1015   - grid.addWidget(self._checkStyle, 7, 1, 1, 2, alignment=Qt.AlignTop)
  1019 + formFeatures.addWidget(self._checkStyle, 7, 1, 1, 2,
  1020 + alignment=Qt.AlignTop)
1016 1021 self.connect(self._checkStyle, SIGNAL("stateChanged(int)"),
1017 1022 self._disable_check_style)
1018 1023 self._checkStyleOnLine = QCheckBox(
@@ -1020,37 +1025,44 @@ def __init__(self):
1020 1025 self._checkStyleOnLine.setChecked(settings.CHECK_HIGHLIGHT_LINE)
1021 1026 self.connect(self._checkStyleOnLine, SIGNAL("stateChanged(int)"),
1022 1027 self._enable_check_inline)
1023   - grid.addWidget(self._checkStyleOnLine, 8, 2, 1, 1, Qt.AlignTop)
  1028 + formFeatures.addWidget(self._checkStyleOnLine, 8, 2, 1, 1, Qt.AlignTop)
1024 1029 # Python3 Migration
1025 1030 self._showMigrationTips = QCheckBox(
1026 1031 self.tr("Show Python3 Migration Tips."))
1027 1032 self._showMigrationTips.setChecked(settings.SHOW_MIGRATION_TIPS)
1028   - grid.addWidget(self._showMigrationTips, 9, 1, 1, 2, Qt.AlignTop)
  1033 + formFeatures.addWidget(self._showMigrationTips, 9, 1, 1, 2,
  1034 + Qt.AlignTop)
1029 1035 #Center On Scroll
1030 1036 self._checkCenterScroll = QCheckBox(
1031 1037 self.tr("Center on Scroll."))
1032 1038 self._checkCenterScroll.setChecked(settings.CENTER_ON_SCROLL)
1033   - grid.addWidget(self._checkCenterScroll, 10, 1, 1, 2,
  1039 + formFeatures.addWidget(self._checkCenterScroll, 10, 1, 1, 2,
1034 1040 alignment=Qt.AlignTop)
1035 1041 #Remove Trailing Spaces add Last empty line automatically
1036 1042 self._checkTrailing = QCheckBox(self.tr(
1037 1043 "Remove Trailing Spaces and\nadd Last Line automatically."))
1038 1044 self._checkTrailing.setChecked(settings.REMOVE_TRAILING_SPACES)
1039   - grid.addWidget(self._checkTrailing, 11, 1, 1, 2, alignment=Qt.AlignTop)
  1045 + formFeatures.addWidget(self._checkTrailing, 11, 1, 1, 2,
  1046 + alignment=Qt.AlignTop)
1040 1047 #Show Tabs and Spaces
1041 1048 self._checkShowSpaces = QCheckBox(self.tr("Show Tabs and Spaces."))
1042 1049 self._checkShowSpaces.setChecked(settings.SHOW_TABS_AND_SPACES)
1043   - grid.addWidget(self._checkShowSpaces, 12, 1, 1, 2,
  1050 + formFeatures.addWidget(self._checkShowSpaces, 12, 1, 1, 2,
1044 1051 alignment=Qt.AlignTop)
1045 1052 self._allowWordWrap = QCheckBox(self.tr("Allow Word Wrap."))
1046 1053 self._allowWordWrap.setChecked(settings.ALLOW_WORD_WRAP)
1047   - grid.addWidget(self._allowWordWrap, 13, 1, 1, 2, alignment=Qt.AlignTop)
  1054 + formFeatures.addWidget(self._allowWordWrap, 13, 1, 1, 2,
  1055 + alignment=Qt.AlignTop)
1048 1056 self._checkForDocstrings = QCheckBox(
1049 1057 self.tr("Check for Docstrings in Classes and Functions."))
1050 1058 self._checkForDocstrings.setChecked(settings.CHECK_FOR_DOCSTRINGS)
1051   - grid.addWidget(self._checkForDocstrings, 14, 1, 1, 2,
  1059 + formFeatures.addWidget(self._checkForDocstrings, 14, 1, 1, 2,
1052 1060 alignment=Qt.AlignTop)
1053 1061
  1062 + vbox.addWidget(groupBoxFeatures)
  1063 + vbox.addItem(QSpacerItem(0, 10, QSizePolicy.Expanding,
  1064 + QSizePolicy.Expanding))
  1065 +
1054 1066 def _enable_check_inline(self, val):
1055 1067 if val == Qt.Checked:
1056 1068 self._checkStyle.setChecked(True)
@@ -1137,10 +1149,10 @@ class EditorCompletion(QWidget):
1137 1149
1138 1150 def __init__(self):
1139 1151 QWidget.__init__(self)
1140   - grid = QGridLayout(self)
  1152 + vbox = QVBoxLayout(self)
1141 1153
1142 1154 groupBoxClose = QGroupBox(self.tr("Complete:"))
1143   - grid.addWidget(groupBoxClose, 0, 0, alignment=Qt.AlignTop)
  1155 + formClose = QGridLayout(groupBoxClose)
1144 1156 self._checkParentheses = QCheckBox(self.tr("Parentheses: ()"))
1145 1157 self._checkParentheses.setChecked('(' in settings.BRACES)
1146 1158 self._checkKeys = QCheckBox(self.tr("Keys: {}"))
@@ -1153,27 +1165,33 @@ def __init__(self):
1153 1165 self._checkDoubleQuotes.setChecked('"' in settings.QUOTES)
1154 1166 self._checkCompleteDeclarations = QCheckBox(
1155 1167 self.tr("Complete Declarations\n"
1156   - "(execute the opposite action with: %s)." %
  1168 + "(execute the opposite action with: %s).") %
1157 1169 resources.get_shortcut("Complete-Declarations").toString(
1158   - QKeySequence.NativeText)))
  1170 + QKeySequence.NativeText))
1159 1171 self._checkCompleteDeclarations.setChecked(
1160 1172 settings.COMPLETE_DECLARATIONS)
1161   - grid.addWidget(self._checkParentheses, 1, 1, alignment=Qt.AlignTop)
1162   - grid.addWidget(self._checkKeys, 1, 2, alignment=Qt.AlignTop)
1163   - grid.addWidget(self._checkBrackets, 2, 1, alignment=Qt.AlignTop)
1164   - grid.addWidget(self._checkSimpleQuotes, 2, 2, alignment=Qt.AlignTop)
1165   - grid.addWidget(self._checkDoubleQuotes, 3, 1, alignment=Qt.AlignTop)
  1173 + formClose.addWidget(self._checkParentheses, 1, 1,
  1174 + alignment=Qt.AlignTop)
  1175 + formClose.addWidget(self._checkKeys, 1, 2, alignment=Qt.AlignTop)
  1176 + formClose.addWidget(self._checkBrackets, 2, 1, alignment=Qt.AlignTop)
  1177 + formClose.addWidget(self._checkSimpleQuotes, 2, 2,
  1178 + alignment=Qt.AlignTop)
  1179 + formClose.addWidget(self._checkDoubleQuotes, 3, 1,
  1180 + alignment=Qt.AlignTop)
  1181 + vbox.addWidget(groupBoxClose)
1166 1182
1167 1183 groupBoxCode = QGroupBox(self.tr("Code Completion:"))
1168   - grid.addWidget(groupBoxCode, 4, 0, alignment=Qt.AlignTop)
  1184 + formCode = QGridLayout(groupBoxCode)
1169 1185 self._checkCodeDot = QCheckBox(
1170 1186 self.tr("Activate Code Completion with: \".\""))
1171 1187 self._checkCodeDot.setChecked(settings.CODE_COMPLETION)
1172   - grid.addWidget(self._checkCompleteDeclarations, 5, 1,
  1188 + formCode.addWidget(self._checkCompleteDeclarations, 5, 1,
1173 1189 alignment=Qt.AlignTop)
1174   - grid.addWidget(self._checkCodeDot, 6, 1, alignment=Qt.AlignTop)
1175   - grid.addItem(QSpacerItem(0, 10, QSizePolicy.Expanding,
1176   - QSizePolicy.Expanding), 7, 0)
  1190 +
  1191 + formCode.addWidget(self._checkCodeDot, 6, 1, alignment=Qt.AlignTop)
  1192 + vbox.addWidget(groupBoxCode)
  1193 + vbox.addItem(QSpacerItem(0, 10, QSizePolicy.Expanding,
  1194 + QSizePolicy.Expanding))
1177 1195
1178 1196 def save(self):
1179 1197 qsettings = QSettings()
@@ -1680,7 +1698,7 @@ def save_scheme(self):
1680 1698 if file_manager.file_exists(fileName):
1681 1699 answer = QMessageBox.question(self,
1682 1700 self.tr("Scheme already exists"),
1683   - self.tr("Do you want to override the file: %s?" % fileName),
  1701 + (self.tr("Do you want to override the file: %s?") % fileName),
1684 1702 QMessageBox.Yes, QMessageBox.No)
1685 1703
1686 1704 if name != '' and answer in (QMessageBox.Yes, True):
@@ -1692,7 +1710,7 @@ def save_scheme(self):
1692 1710 self.original_style = copy.copy(scheme)
1693 1711 json_manager.save_editor_skins(fileName, scheme)
1694 1712 QMessageBox.information(self, self.tr("Scheme Saved"),
1695   - self.tr("The scheme has been saved at: %s." % fileName))
  1713 + (self.tr("The scheme has been saved at: %s.") % fileName))
1696 1714 elif answer == QMessageBox.Yes:
1697 1715 QMessageBox.information(self, self.tr("Scheme Not Saved"),
1698 1716 self.tr("The name probably is invalid."))
@@ -1861,9 +1879,9 @@ def save_stylesheet(self):
1861 1879 content = self.edit_qss.toPlainText()
1862 1880 file_manager.store_file_content(file_name, content, newFile=True)
1863 1881 QMessageBox.information(self, self.tr("Style Sheet Saved"),
1864   - self.tr("Theme saved at: '%s'." % file_name))
  1882 + (self.tr("Theme saved at: '%s'." % file_name)))
1865 1883 self.edit_qss.document().setModified(False)
1866 1884 except file_manager.NinjaFileExistsException as ex:
1867 1885 QMessageBox.information(self, self.tr("File Already Exists"),
1868   - self.tr("Invalid File Name: the file '%s' already exists." %
  1886 + (self.tr("Invalid File Name: the file '%s' already exists.") %
1869 1887 ex.filename))
2  ninja_ide/gui/dialogs/project_properties_widget.py
@@ -101,7 +101,7 @@ def save_properties(self):
101 101 self._item.pythonPath = self.projectExecution.txtPythonPath.text()
102 102 self._item.PYTHONPATH = self.projectExecution.PYTHONPATH.toPlainText()
103 103 self._item.additional_builtins = filter(
104   - lambda e: e, # remove empty names
  104 + lambda e: e, # remove empty names
105 105 self.projectExecution.additional_builtins.text().split(' '))
106 106 self._item.preExecScript = self.projectExecution.txtPreExec.text()
107 107 self._item.postExecScript = self.projectExecution.txtPostExec.text()
10 ninja_ide/gui/explorer/tree_projects_widget.py
@@ -442,7 +442,7 @@ def _add_new_file(self):
442 442 mainContainer.open_file(fileName)
443 443 except file_manager.NinjaFileExistsException as ex:
444 444 QMessageBox.information(self, self.tr("File Already Exists"),
445   - self.tr("Invalid Path: the file '%s' already exists." %
  445 + (self.tr("Invalid Path: the file '%s' already exists.") %
446 446 ex.filename))
447 447
448 448 def add_existing_file(self, path):
@@ -537,7 +537,7 @@ def _rename_file(self):
537 537 subitem.parent().takeChild(index)
538 538 except file_manager.NinjaFileExistsException as ex:
539 539 QMessageBox.information(self, self.tr("File Already Exists"),
540   - self.tr("Invalid Path: the file '%s' already exists." %
  540 + (self.tr("Invalid Path: the file '%s' already exists.") %
541 541 ex.filename))
542 542
543 543 def _copy_file(self):
@@ -566,7 +566,7 @@ def _copy_file(self):
566 566 self.add_existing_file(path)
567 567 except file_manager.NinjaFileExistsException as ex:
568 568 QMessageBox.information(self, self.tr("File Already Exists"),
569   - self.tr("Invalid Path: the file '%s' already exists." %
  569 + (self.tr("Invalid Path: the file '%s' already exists.") %
570 570 ex.filename))
571 571
572 572 def _move_file(self):
@@ -592,7 +592,7 @@ def _move_file(self):
592 592 self.add_existing_file(path)
593 593 except file_manager.NinjaFileExistsException as ex:
594 594 QMessageBox.information(self, self.tr("File Already Exists"),
595   - self.tr("Invalid Path: the file '%s' already exists." %
  595 + (self.tr("Invalid Path: the file '%s' already exists.") %
596 596 ex.filename))
597 597
598 598 def _edit_ui_file(self):
@@ -883,4 +883,4 @@ def _unfold_all_projects(self):
883 883 """
884 884 Unfold all project
885 885 """
886   - self._tree.expandAll()
  886 + self._tree.expandAll()
2  ninja_ide/gui/ide.py
@@ -447,7 +447,7 @@ def closeEvent(self, event):
447 447 txt = '\n'.join(unsaved_files)
448 448 val = QMessageBox.question(self,
449 449 self.tr("Some changes were not saved"),
450   - self.tr("%s\n\nDo you want to save them?" % txt),
  450 + (self.tr("%s\n\nDo you want to save them?") % txt),
451 451 QMessageBox.Yes, QMessageBox.No, QMessageBox.Cancel)
452 452 if val == QMessageBox.Yes:
453 453 #Saves all open files
6 ninja_ide/gui/main_panel/main_container.py
@@ -619,7 +619,7 @@ def save_file(self, editorWidget=None):
619 619 encoding = file_manager.get_file_encoding(content)
620 620 editorWidget.encoding = encoding
621 621 self.emit(SIGNAL("fileSaved(QString)"),
622   - self.tr("File Saved: %s" % fileName))
  622 + (self.tr("File Saved: %s") % fileName))
623 623 editorWidget._file_saved()
624 624 return True
625 625 except Exception as reason:
@@ -661,7 +661,7 @@ def save_file_as(self):
661 661 self.remove_standalone_watcher(editorWidget.ID)
662 662 editorWidget.ID = fileName
663 663 self.emit(SIGNAL("fileSaved(QString)"),
664   - self.tr("File Saved: %s" % fileName))
  664 + (self.tr("File Saved: %s") % fileName))
665 665 self.emit(SIGNAL("currentTabChanged(QString)"), fileName)
666 666 editorWidget._file_saved()
667 667 self.add_standalone_watcher(fileName)
@@ -670,7 +670,7 @@ def save_file_as(self):
670 670 except file_manager.NinjaFileExistsException as ex:
671 671 editorWidget.just_saved = False
672 672 QMessageBox.information(self, self.tr("File Already Exists"),
673   - self.tr("Invalid Path: the file '%s' already exists." %
  673 + (self.tr("Invalid Path: the file '%s' already exists.") %
674 674 ex.filename))
675 675 except Exception as reason:
676 676 editorWidget.just_saved = False
6 ninja_ide/gui/main_panel/tab_widget.py
@@ -183,7 +183,7 @@ def _prompt_reload(self, editorWidget, change):
183 183 editorWidget.just_saved = False
184 184 return
185 185 val = QMessageBox.question(self, 'The file has changed on disc!',
186   - self.tr("%s\nDo you want to reload it?" % editorWidget.ID),
  186 + (self.tr("%s\nDo you want to reload it?") % editorWidget.ID),
187 187 QMessageBox.Yes, QMessageBox.No)
188 188 if val == QMessageBox.Yes:
189 189 self.emit(SIGNAL("reloadFile(QWidget)"), editorWidget)
@@ -193,7 +193,7 @@ def _prompt_reload(self, editorWidget, change):
193 193 elif change == DELETED:
194 194 val = QMessageBox.information(self,
195 195 'The file has deleted from disc!',
196   - self.tr("%s\n" % editorWidget.ID),
  196 + (self.tr("%s\n") % editorWidget.ID),
197 197 QMessageBox.Yes)
198 198 self.question_already_open = False
199 199
@@ -272,7 +272,7 @@ def removeTab(self, index):
272 272 if widget.textModified and not self.follow_mode:
273 273 fileName = self.tabBar().tabText(self.currentIndex())
274 274 val = QMessageBox.question(
275   - self, self.tr('The file %s was not saved' %
  275 + self, (self.tr('The file %s was not saved') %
276 276 fileName),
277 277 self.tr("Do you want to save before closing?"),
278 278 QMessageBox.Yes | QMessageBox.No |
4 ninja_ide/gui/menus/menu_about.py
@@ -33,8 +33,8 @@ def __init__(self, menuAbout):
33 33 QObject.__init__(self)
34 34
35 35 startPageAction = menuAbout.addAction(self.tr("Show Start Page"))
36   - helpAction = menuAbout.addAction(self.tr("Python Help (%s)" %
37   - resources.get_shortcut("Help").toString(QKeySequence.NativeText)))
  36 + helpAction = menuAbout.addAction(self.tr("Python Help (%s)") %
  37 + resources.get_shortcut("Help").toString(QKeySequence.NativeText))
38 38 menuAbout.addSeparator()
39 39 reportBugAction = menuAbout.addAction(self.tr("Report Bugs!"))
40 40 pluginsDocAction = menuAbout.addAction(
20 ninja_ide/gui/menus/menu_edit.py
@@ -36,35 +36,35 @@ def __init__(self, menuEdit, toolbar):
36 36 QObject.__init__(self)
37 37
38 38 undoAction = menuEdit.addAction(QIcon(resources.IMAGES['undo']),
39   - self.trUtf8("Undo (%s+Z)" % settings.OS_KEY))
  39 + (self.trUtf8("Undo (%s+Z)") % settings.OS_KEY))
40 40 redoAction = menuEdit.addAction(QIcon(resources.IMAGES['redo']),
41   - self.trUtf8("Redo (%s)" % resources.get_shortcut("Redo").toString(
  41 + (self.trUtf8("Redo (%s)") % resources.get_shortcut("Redo").toString(
42 42 QKeySequence.NativeText)))
43 43 cutAction = menuEdit.addAction(QIcon(resources.IMAGES['cut']),
44   - self.trUtf8("&Cut (%s+X)" % settings.OS_KEY))
  44 + (self.trUtf8("&Cut (%s+X)") % settings.OS_KEY))
45 45 copyAction = menuEdit.addAction(QIcon(resources.IMAGES['copy']),
46   - self.trUtf8("&Copy (%s+C)" % settings.OS_KEY))
  46 + (self.trUtf8("&Copy (%s+C)") % settings.OS_KEY))
47 47 pasteAction = menuEdit.addAction(QIcon(resources.IMAGES['paste']),
48   - self.trUtf8("&Paste (%s+V)" % settings.OS_KEY))
  48 + (self.trUtf8("&Paste (%s+V)") % settings.OS_KEY))
49 49 menuEdit.addSeparator()
50 50 findAction = menuEdit.addAction(QIcon(resources.IMAGES['find']),
51   - self.trUtf8("Find (%s)" % resources.get_shortcut("Find").toString(
  51 + (self.trUtf8("Find (%s)") % resources.get_shortcut("Find").toString(
52 52 QKeySequence.NativeText)))
53 53 findReplaceAction = menuEdit.addAction(
54 54 QIcon(resources.IMAGES['findReplace']),
55   - self.trUtf8("Find/Replace (%s)" %
  55 + (self.trUtf8("Find/Replace (%s)") %
56 56 resources.get_shortcut("Find-replace").toString(
57 57 QKeySequence.NativeText)))
58 58 findWithWordAction = menuEdit.addAction(
59   - self.trUtf8("Find using word under cursor (%s)" %
  59 + (self.trUtf8("Find using word under cursor (%s)") %
60 60 resources.get_shortcut("Find-with-word").toString(
61 61 QKeySequence.NativeText)))
62 62 findInFilesAction = menuEdit.addAction(QIcon(resources.IMAGES['find']),
63   - self.trUtf8("Find in Files (%s)" %
  63 + (self.trUtf8("Find in Files (%s)") %
64 64 resources.get_shortcut("Find-in-files").toString(
65 65 QKeySequence.NativeText)))
66 66 locatorAction = menuEdit.addAction(QIcon(resources.IMAGES['locator']),
67   - self.trUtf8("Code Locator (%s)" %
  67 + (self.trUtf8("Code Locator (%s)") %
68 68 resources.get_shortcut("Code-locator").toString(
69 69 QKeySequence.NativeText)))
70 70 menuEdit.addSeparator()
18 ninja_ide/gui/menus/menu_file.py
@@ -39,17 +39,17 @@ def __init__(self, menuFile, toolbar, ide):
39 39 QObject.__init__(self)
40 40
41 41 newAction = menuFile.addAction(QIcon(resources.IMAGES['new']),
42   - self.trUtf8("&New File (%s)" %
  42 + (self.trUtf8("&New File (%s)") %
43 43 resources.get_shortcut("New-file").toString(
44 44 QKeySequence.NativeText)))
45 45 newProjectAction = menuFile.addAction(
46 46 QIcon(resources.IMAGES['newProj']),
47   - self.trUtf8("New Pro&ject (%s)" %
  47 + (self.trUtf8("New Pro&ject (%s)") %
48 48 resources.get_shortcut("New-project").toString(
49 49 QKeySequence.NativeText)))
50 50 menuFile.addSeparator()
51 51 saveAction = menuFile.addAction(QIcon(resources.IMAGES['save']),
52   - self.trUtf8("&Save (%s)" %
  52 + (self.trUtf8("&Save (%s)") %
53 53 resources.get_shortcut("Save-file").toString(
54 54 QKeySequence.NativeText)))
55 55 saveAsAction = menuFile.addAction(QIcon(resources.IMAGES['saveAs']),
@@ -58,23 +58,23 @@ def __init__(self, menuFile, toolbar, ide):
58 58 self.trUtf8("Save All"))
59 59 saveProjectAction = menuFile.addAction(QIcon(
60 60 resources.IMAGES['saveAll']),
61   - self.trUtf8("Save Pro&ject (%s)" %
  61 + (self.trUtf8("Save Pro&ject (%s)") %
62 62 resources.get_shortcut("Save-project").toString(
63 63 QKeySequence.NativeText)))
64 64 menuFile.addSeparator()
65 65 reloadFileAction = menuFile.addAction(
66 66 QIcon(resources.IMAGES['reload-file']),
67   - self.trUtf8("Reload File (%s)" %
  67 + (self.trUtf8("Reload File (%s)") %
68 68 resources.get_shortcut("Reload-file").toString(
69 69 QKeySequence.NativeText)))
70 70 menuFile.addSeparator()
71 71 openAction = menuFile.addAction(QIcon(resources.IMAGES['open']),
72   - self.trUtf8("&Open (%s)" %
  72 + (self.trUtf8("&Open (%s)") %
73 73 resources.get_shortcut("Open-file").toString(
74 74 QKeySequence.NativeText)))
75 75 openProjectAction = menuFile.addAction(
76 76 QIcon(resources.IMAGES['openProj']),
77   - self.trUtf8("Open &Project (%s)" %
  77 + (self.trUtf8("Open &Project (%s)") %
78 78 resources.get_shortcut("Open-project").toString(
79 79 QKeySequence.NativeText)))
80 80 self.recent_files = menuFile.addMenu(self.trUtf8('Open Recent Files'))
@@ -87,12 +87,12 @@ def __init__(self, menuFile, toolbar, ide):
87 87 self.trUtf8("Deactivate Profile"))
88 88 menuFile.addSeparator()
89 89 printFile = menuFile.addAction(QIcon(resources.IMAGES['print']),
90   - self.trUtf8("Pr&int File (%s)" %
  90 + (self.trUtf8("Pr&int File (%s)") %
91 91 resources.get_shortcut("Print-file").toString(
92 92 QKeySequence.NativeText)))
93 93 closeAction = menuFile.addAction(
94 94 ide.style().standardIcon(QStyle.SP_DialogCloseButton),
95   - self.trUtf8("&Close Tab (%s)" %
  95 + (self.trUtf8("&Close Tab (%s)") %
96 96 resources.get_shortcut("Close-tab").toString(
97 97 QKeySequence.NativeText)))
98 98 closeProjectsAction = menuFile.addAction(
6 ninja_ide/gui/menus/menu_project.py
@@ -31,7 +31,7 @@ def __init__(self, menuProject, toolbar):
31 31 QObject.__init__(self)
32 32
33 33 runAction = menuProject.addAction(QIcon(resources.IMAGES['play']),
34   - self.trUtf8("Run Project (%s)" %
  34 + (self.trUtf8("Run Project (%s)") %
35 35 resources.get_shortcut("Run-project").toString(
36 36 QKeySequence.NativeText)))
37 37 # debugAction = menuProject.addAction(
@@ -41,11 +41,11 @@ def __init__(self, menuProject, toolbar):
41 41 # QKeySequence.NativeText)))
42 42 runFileAction = menuProject.addAction(
43 43 QIcon(resources.IMAGES['file-run']),
44   - self.trUtf8("Run File (%s)" %
  44 + (self.trUtf8("Run File (%s)") %
45 45 resources.get_shortcut("Run-file").toString(
46 46 QKeySequence.NativeText)))
47 47 stopAction = menuProject.addAction(QIcon(resources.IMAGES['stop']),
48   - self.trUtf8("Stop (%s)" %
  48 + (self.trUtf8("Stop (%s)") %
49 49 resources.get_shortcut("Stop-execution").toString(
50 50 QKeySequence.NativeText)))
51 51 menuProject.addSeparator()
24 ninja_ide/gui/menus/menu_source.py
@@ -34,30 +34,30 @@ def __init__(self, menuSource):
34 34
35 35 indentMoreAction = menuSource.addAction(
36 36 QIcon(resources.IMAGES['indent-more']),
37   - self.trUtf8("Indent More (%s)" %
  37 + (self.trUtf8("Indent More (%s)") %
38 38 QKeySequence(Qt.Key_Tab).toString(QKeySequence.NativeText)))
39 39 indentLessAction = menuSource.addAction(
40 40 QIcon(resources.IMAGES['indent-less']),
41   - self.trUtf8("Indent Less (%s)" %
  41 + (self.trUtf8("Indent Less (%s)") %
42 42 resources.get_shortcut("Indent-less").toString(
43 43 QKeySequence.NativeText)))
44 44 menuSource.addSeparator()
45 45 commentAction = menuSource.addAction(
46 46 QIcon(resources.IMAGES['comment-code']),
47   - self.trUtf8("Comment (%s)" %
  47 + (self.trUtf8("Comment (%s)") %
48 48 resources.get_shortcut("Comment").toString(
49 49 QKeySequence.NativeText)))
50 50 unCommentAction = menuSource.addAction(
51 51 QIcon(resources.IMAGES['uncomment-code']),
52   - self.trUtf8("Uncomment (%s)" %
  52 + (self.trUtf8("Uncomment (%s)") %
53 53 resources.get_shortcut("Uncomment").toString(
54 54 QKeySequence.NativeText)))
55 55 horizontalLineAction = menuSource.addAction(
56   - self.trUtf8("Insert Horizontal Line (%s)" %
  56 + (self.trUtf8("Insert Horizontal Line (%s)") %
57 57 resources.get_shortcut("Horizontal-line").toString(
58 58 QKeySequence.NativeText)))
59 59 titleCommentAction = menuSource.addAction(
60   - self.trUtf8("Insert Title Comment (%s)" %
  60 + (self.trUtf8("Insert Title Comment (%s)") %
61 61 resources.get_shortcut("Title-comment").toString(
62 62 QKeySequence.NativeText)))
63 63 countCodeLinesAction = menuSource.addAction(
@@ -68,13 +68,13 @@ def __init__(self, menuSource):
68 68 # tellTaleAction.setEnabled(False)
69 69 goToDefinitionAction = menuSource.addAction(
70 70 QIcon(resources.IMAGES['go-to-definition']),
71   - self.trUtf8("Go To Definition (%s or %s+Click)" %
  71 + (self.trUtf8("Go To Definition (%s or %s+Click)") %
72 72 (resources.get_shortcut("Go-to-definition").toString(
73 73 QKeySequence.NativeText),
74 74 settings.OS_KEY)))
75 75 insertImport = menuSource.addAction(
76 76 QIcon(resources.IMAGES['insert-import']),
77   - self.trUtf8("Insert &Import (%s)" %
  77 + (self.trUtf8("Insert &Import (%s)") %
78 78 resources.get_shortcut("Import").toString(
79 79 QKeySequence.NativeText)))
80 80 menu_debugging = menuSource.addMenu(self.trUtf8("Debugging Tricks"))
@@ -93,18 +93,18 @@ def __init__(self, menuSource):
93 93 self.trUtf8("&Remove Trailing Spaces"))
94 94 replaceTabsSpaces = menuSource.addAction(
95 95 self.trUtf8("Replace Tabs With &Spaces"))
96   - moveUp = menuSource.addAction(self.trUtf8("Move &Up (%s)" %
  96 + moveUp = menuSource.addAction((self.trUtf8("Move &Up (%s)") %
97 97 resources.get_shortcut("Move-up").toString(
98 98 QKeySequence.NativeText)))
99   - moveDown = menuSource.addAction(self.trUtf8("Move &Down (%s)" %
  99 + moveDown = menuSource.addAction((self.trUtf8("Move &Down (%s)") %
100 100 resources.get_shortcut("Move-down").toString(
101 101 QKeySequence.NativeText)))
102 102 duplicate = menuSource.addAction(
103   - self.trUtf8("Duplica&te (%s)" %
  103 + (self.trUtf8("Duplica&te (%s)") %
104 104 resources.get_shortcut("Duplicate").toString(
105 105 QKeySequence.NativeText)))
106 106 remove = menuSource.addAction(
107   - self.trUtf8("&Remove Line (%s)" %
  107 + (self.trUtf8("&Remove Line (%s)") %
108 108 resources.get_shortcut("Remove-line").toString(
109 109 QKeySequence.NativeText)))
110 110
16 ninja_ide/gui/menus/menu_view.py
@@ -34,22 +34,22 @@ def __init__(self, menuView, toolbar, ide):
34 34 self.__ide = ide
35 35
36 36 self.hideConsoleAction = menuView.addAction(
37   - self.trUtf8("Show/Hide &Console (%s)" %
  37 + (self.trUtf8("Show/Hide &Console (%s)") %
38 38 resources.get_shortcut("Hide-misc").toString(
39 39 QKeySequence.NativeText)))
40 40 self.hideConsoleAction.setCheckable(True)
41 41 self.hideEditorAction = menuView.addAction(
42   - self.trUtf8("Show/Hide &Editor (%s)" %
  42 + (self.trUtf8("Show/Hide &Editor (%s)") %
43 43 resources.get_shortcut("Hide-editor").toString(
44 44 QKeySequence.NativeText)))
45 45 self.hideEditorAction.setCheckable(True)
46 46 self.hideAllAction = menuView.addAction(
47   - self.trUtf8("Show/Hide &All (%s)" %
  47 + (self.trUtf8("Show/Hide &All (%s)") %
48 48 resources.get_shortcut("Hide-all").toString(
49 49 QKeySequence.NativeText)))
50 50 self.hideAllAction.setCheckable(True)
51 51 self.hideExplorerAction = menuView.addAction(
52   - self.trUtf8("Show/Hide &Explorer (%s)" %
  52 + (self.trUtf8("Show/Hide &Explorer (%s)") %
53 53 resources.get_shortcut("Hide-explorer").toString(
54 54 QKeySequence.NativeText)))
55 55 self.hideExplorerAction.setCheckable(True)
@@ -58,23 +58,23 @@ def __init__(self, menuView, toolbar, ide):
58 58 self.hideToolbarAction.setCheckable(True)
59 59 self.fullscreenAction = menuView.addAction(
60 60 QIcon(resources.IMAGES['fullscreen']),
61   - self.trUtf8("Full Screen &Mode (%s)" %
  61 + (self.trUtf8("Full Screen &Mode (%s)") %
62 62 resources.get_shortcut("Full-screen").toString(
63 63 QKeySequence.NativeText)))
64 64 menuView.addSeparator()
65 65 splitTabHAction = menuView.addAction(
66 66 QIcon(resources.IMAGES['splitH']),
67   - self.trUtf8("Split Tabs Horizontally (%s)" %
  67 + (self.trUtf8("Split Tabs Horizontally (%s)") %
68 68 resources.get_shortcut("Split-horizontal").toString(
69 69 QKeySequence.NativeText)))
70 70 splitTabVAction = menuView.addAction(
71 71 QIcon(resources.IMAGES['splitV']),
72   - self.trUtf8("Split Tabs Vertically (%s)" %
  72 + (self.trUtf8("Split Tabs Vertically (%s)") %
73 73 resources.get_shortcut("Split-vertical").toString(
74 74 QKeySequence.NativeText)))
75 75 followModeAction = menuView.addAction(
76 76 QIcon(resources.IMAGES['follow']),
77   - self.trUtf8("Follow Mode (%s)" %
  77 + (self.trUtf8("Follow Mode (%s)") %
78 78 resources.get_shortcut("Follow-mode").toString(
79 79 QKeySequence.NativeText)))
80 80 groupTabsAction = menuView.addAction(
2  ninja_ide/gui/misc/run_widget.py
@@ -101,7 +101,7 @@ def process_error(self, error):
101 101 format_)
102 102 else:
103 103 self.output.textCursor().insertText(
104   - self.tr('Error during execution, QProcess error: %d' % error),
  104 + (self.tr('Error during execution, QProcess error: %d') % error),
105 105 format_)
106 106
107 107 def finish_execution(self, exitCode, exitStatus):
8 ninja_ide/gui/status_bar.py
@@ -260,14 +260,14 @@ def __init__(self, parent):
260 260 self._btnFind = QPushButton(QIcon(resources.IMAGES['find']), '')
261 261 self.btnPrevious = QPushButton(
262 262 self.style().standardIcon(QStyle.SP_ArrowLeft), '')
263   - self.btnPrevious.setToolTip(self.trUtf8("Press %s" %
  263 + self.btnPrevious.setToolTip(self.trUtf8("Press %s") %
264 264 resources.get_shortcut("Find-previous").toString(
265   - QKeySequence.NativeText)))
  265 + QKeySequence.NativeText))
266 266 self.btnNext = QPushButton(
267 267 self.style().standardIcon(QStyle.SP_ArrowRight), '')
268   - self.btnNext.setToolTip(self.trUtf8("Press %s" %
  268 + self.btnNext.setToolTip(self.trUtf8("Press %s") %
269 269 resources.get_shortcut("Find-next").toString(
270   - QKeySequence.NativeText)))
  270 + QKeySequence.NativeText))
271 271 hSearch.addWidget(self._btnClose)
272 272 hSearch.addWidget(self._line)
273 273 hSearch.addWidget(self._btnFind)
2  ninja_ide/gui/updates.py
@@ -59,7 +59,7 @@ def __init__(self, parent):
59 59 def setup_menu(self, show_downloads=False):
60 60 self.menu = QMenu()
61 61 if show_downloads:
62   - self.download = QAction(self.tr("Download Version: %s!" %
  62 + self.download = QAction((self.tr("Download Version: %s!") %
63 63 self.ide_version),
64 64 self, triggered=self._show_download)
65 65 self.menu.addAction(self.download)
10 ninja_ide/tools/ui_tools.py
@@ -106,10 +106,10 @@ def __init__(self):
106 106 def add_item_to_tree(self, folder, tree, item_type=None, parent=None):
107 107 if item_type is None:
108 108 item = QTreeWidgetItem()
109   - item.setText(0, self.tr(' LOADING: "%s"' % folder))
  109 + item.setText(0, (self.tr(' LOADING: "%s"') % folder))
110 110 else:
111 111 item = item_type(parent,
112   - self.tr(' LOADING: "%s"' % folder), folder)
  112 + (self.tr(' LOADING: "%s"') % folder), folder)
113 113 tree.addTopLevelItem(item)
114 114 tree.setItemWidget(item, 0, self)
115 115 return item
@@ -484,8 +484,8 @@ def save_profile(self):
484 484 if self.profileList.currentItem():
485 485 profileName = self.profileList.currentItem().text()
486 486 self.save_function(profileName)
487   - self.ide.show_status_message(self.tr("Profile %s Updated!" %
488   - profileName))
  487 + self.ide.show_status_message(self.tr("Profile %s Updated!") %
  488 + profileName)
489 489 self.load_profile_content()
490 490
491 491 def open_profile(self):
@@ -552,7 +552,7 @@ def __init__(self, lineEdit):
552 552 lineEdit.setTextMargins(0, 0, 60, 0)
553 553
554 554 def update_count(self, index, total, hasSearch=False):
555   - message = self.tr("%s of %s" % (index, total))
  555 + message = self.tr("%s of %s") % (index, total)
556 556 self.counter.setText(message)
557 557 self.counter.setStyleSheet("background: none;color: gray;")
558 558 if index == 0 and total == 0 and hasSearch:

No commit comments for this range

Something went wrong with that request. Please try again.