PrEditor 0.6.0__py2.py3-none-any.whl → 0.7.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of PrEditor might be problematic. Click here for more details.

@@ -35,15 +35,15 @@ class CodeHighlighter(QSyntaxHighlighter):
35
35
  # stylesheets
36
36
  parent = self.parent()
37
37
  if parent and hasattr(parent, 'commentColor'):
38
- return parent.commentColor()
38
+ return parent.commentColor
39
39
  return self._commentColor
40
40
 
41
41
  def setCommentColor(self, color):
42
42
  # set the color for the parent if possible because this doesn't support
43
43
  # stylesheets
44
44
  parent = self.parent()
45
- if parent and hasattr(parent, 'setCommentColor'):
46
- parent.setCommentColor(color)
45
+ if parent and hasattr(parent, 'commentColor'):
46
+ parent.commentColor = color
47
47
  self._commentColor = color
48
48
 
49
49
  def commentFormat(self):
@@ -127,15 +127,15 @@ class CodeHighlighter(QSyntaxHighlighter):
127
127
  # stylesheets
128
128
  parent = self.parent()
129
129
  if parent and hasattr(parent, 'keywordColor'):
130
- return parent.keywordColor()
130
+ return parent.keywordColor
131
131
  return self._keywordColor
132
132
 
133
133
  def setKeywordColor(self, color):
134
134
  # set the color for the parent if possible because this doesn't support
135
135
  # stylesheets
136
136
  parent = self.parent()
137
- if parent and hasattr(parent, 'setKeywordColor'):
138
- parent.setKeywordColor(color)
137
+ if parent and hasattr(parent, 'keywordColor'):
138
+ parent.keywordColor = color
139
139
  self._keywordColor = color
140
140
 
141
141
  def keywordFormat(self):
@@ -150,15 +150,15 @@ class CodeHighlighter(QSyntaxHighlighter):
150
150
  # stylesheets
151
151
  parent = self.parent()
152
152
  if parent and hasattr(parent, 'resultColor'):
153
- return parent.resultColor()
153
+ return parent.resultColor
154
154
  return self._resultColor
155
155
 
156
156
  def setResultColor(self, color):
157
157
  # set the color for the parent if possible because this doesn't support
158
158
  # stylesheets
159
159
  parent = self.parent()
160
- if parent and hasattr(parent, 'setResultColor'):
161
- parent.setResultColor(color)
160
+ if parent and hasattr(parent, 'resultColor'):
161
+ parent.resultColor = color
162
162
  self._resultColor = color
163
163
 
164
164
  def resultFormat(self):
@@ -191,15 +191,15 @@ class CodeHighlighter(QSyntaxHighlighter):
191
191
  # stylesheets
192
192
  parent = self.parent()
193
193
  if parent and hasattr(parent, 'stringColor'):
194
- return parent.stringColor()
194
+ return parent.stringColor
195
195
  return self._stringColor
196
196
 
197
197
  def setStringColor(self, color):
198
198
  # set the color for the parent if possible because this doesn't support
199
199
  # stylesheets
200
200
  parent = self.parent()
201
- if parent and hasattr(parent, 'setStringColor'):
202
- parent.setStringColor(color)
201
+ if parent and hasattr(parent, 'stringColor'):
202
+ parent.stringColor = color
203
203
  self._stringColor = color
204
204
 
205
205
  def stringFormat(self):
preditor/gui/console.py CHANGED
@@ -20,6 +20,7 @@ from Qt.QtWidgets import QAbstractItemView, QAction, QApplication, QTextEdit
20
20
 
21
21
  from .. import debug, settings, stream
22
22
  from ..streamhandler_helper import StreamHandlerHelper
23
+ from . import QtPropertyInit
23
24
  from .codehighlighter import CodeHighlighter
24
25
  from .completer import PythonCompleter
25
26
  from .suggest_path_quotes_dialog import SuggestPathQuotesDialog
@@ -28,8 +29,14 @@ from .suggest_path_quotes_dialog import SuggestPathQuotesDialog
28
29
  class ConsolePrEdit(QTextEdit):
29
30
  # Ensure the error prompt only shows up once.
30
31
  _errorPrompted = False
31
- # the color error messages are displayed in, can be set by stylesheets
32
- _errorMessageColor = QColor(Qt.red)
32
+
33
+ # These Qt Properties can be customized using style sheets.
34
+ commentColor = QtPropertyInit('_commentColor', QColor(0, 206, 52))
35
+ errorMessageColor = QtPropertyInit('_errorMessageColor', QColor(Qt.red))
36
+ keywordColor = QtPropertyInit('_keywordColor', QColor(17, 154, 255))
37
+ resultColor = QtPropertyInit('_resultColor', QColor(128, 128, 128))
38
+ stdoutColor = QtPropertyInit('_stdoutColor', QColor(17, 154, 255))
39
+ stringColor = QtPropertyInit('_stringColor', QColor(255, 128, 0))
33
40
 
34
41
  def __init__(self, parent):
35
42
  super(ConsolePrEdit, self).__init__(parent)
@@ -39,12 +46,6 @@ class ConsolePrEdit(QTextEdit):
39
46
  # If populated, also write to this interface
40
47
  self.outputPipe = None
41
48
 
42
- self._stdoutColor = QColor(17, 154, 255)
43
- self._commentColor = QColor(0, 206, 52)
44
- self._keywordColor = QColor(17, 154, 255)
45
- self._stringColor = QColor(255, 128, 0)
46
- self._resultColor = QColor(128, 128, 128)
47
-
48
49
  self._consolePrompt = '>>> '
49
50
  # Note: Changing _outputPrompt may require updating resource\lang\python.xml
50
51
  # If still using a #
@@ -356,28 +357,10 @@ class ConsolePrEdit(QTextEdit):
356
357
  # Restore the cursor position to its original location
357
358
  self.setTextCursor(currentCursor)
358
359
 
359
- def commentColor(self):
360
- return self._commentColor
361
-
362
- def setCommentColor(self, color):
363
- self._commentColor = color
364
-
365
360
  def completer(self):
366
361
  """returns the completer instance that is associated with this editor"""
367
362
  return self._completer
368
363
 
369
- def errorMessageColor(self):
370
- return self.__class__._errorMessageColor
371
-
372
- def setErrorMessageColor(self, color):
373
- self.__class__._errorMessageColor = color
374
-
375
- def foregroundColor(self):
376
- return self._foregroundColor
377
-
378
- def setForegroundColor(self, color):
379
- self._foregroundColor = color
380
-
381
364
  def executeString(self, commandText, filename='<ConsolePrEdit>', extraPrint=True):
382
365
  if self.clearExecutionTime is not None:
383
366
  self.clearExecutionTime()
@@ -687,12 +670,6 @@ class ConsolePrEdit(QTextEdit):
687
670
  completer.wasCompletingCounter = 0
688
671
  completer.wasCompleting = False
689
672
 
690
- def keywordColor(self):
691
- return self._keywordColor
692
-
693
- def setKeywordColor(self, color):
694
- self._keywordColor = color
695
-
696
673
  def moveToHome(self):
697
674
  """moves the cursor to the home location"""
698
675
  mode = QTextCursor.MoveAnchor
@@ -718,12 +695,6 @@ class ConsolePrEdit(QTextEdit):
718
695
  def prompt(self):
719
696
  return self._consolePrompt
720
697
 
721
- def resultColor(self):
722
- return self._resultColor
723
-
724
- def setResultColor(self, color):
725
- self._resultColor = color
726
-
727
698
  def setCompleter(self, completer):
728
699
  """sets the completer instance for this widget"""
729
700
  if completer:
@@ -773,18 +744,6 @@ class ConsolePrEdit(QTextEdit):
773
744
  """Create a new line to show output text."""
774
745
  self.startPrompt(self._outputPrompt)
775
746
 
776
- def stdoutColor(self):
777
- return self._stdoutColor
778
-
779
- def setStdoutColor(self, color):
780
- self._stdoutColor = color
781
-
782
- def stringColor(self):
783
- return self._stringColor
784
-
785
- def setStringColor(self, color):
786
- self._stringColor = color
787
-
788
747
  def removeCurrentLine(self):
789
748
  self.moveCursor(QTextCursor.End, QTextCursor.MoveAnchor)
790
749
  self.moveCursor(QTextCursor.StartOfLine, QTextCursor.MoveAnchor)
@@ -833,9 +792,9 @@ class ConsolePrEdit(QTextEdit):
833
792
 
834
793
  charFormat = QTextCharFormat()
835
794
  if not error:
836
- charFormat.setForeground(self.stdoutColor())
795
+ charFormat.setForeground(self.stdoutColor)
837
796
  else:
838
- charFormat.setForeground(self.errorMessageColor())
797
+ charFormat.setForeground(self.errorMessageColor)
839
798
  self.setCurrentCharFormat(charFormat)
840
799
 
841
800
  # If showing Error Hyperlinks... Sometimes (when a syntax error, at least),
@@ -5,16 +5,19 @@ import os
5
5
  import traceback
6
6
 
7
7
  from Qt.QtCore import Qt
8
- from Qt.QtGui import QPixmap
8
+ from Qt.QtGui import QColor, QPixmap
9
9
  from Qt.QtWidgets import QDialog
10
10
  from redminelib.exceptions import ImpersonateError
11
11
 
12
12
  from .. import __file__ as pfile
13
- from . import Dialog, loadUi
13
+ from . import Dialog, QtPropertyInit, loadUi
14
14
  from .redmine_login_dialog import RedmineLoginDialog
15
15
 
16
16
 
17
17
  class ErrorDialog(Dialog):
18
+ # These Qt Properties can be customized using style sheets.
19
+ errorMessageColor = QtPropertyInit('_errorMessageColor', QColor(Qt.GlobalColor.red))
20
+
18
21
  def __init__(self, parent):
19
22
  super(ErrorDialog, self).__init__(parent)
20
23
 
@@ -40,8 +43,6 @@ class ErrorDialog(Dialog):
40
43
  self.ignoreButton.clicked.connect(self.close)
41
44
 
42
45
  def setText(self, exc_info):
43
- from .console import ConsolePrEdit
44
-
45
46
  self.traceback_msg = "".join(traceback.format_exception(*exc_info))
46
47
  msg = (
47
48
  'The following error has occurred:<br>'
@@ -51,7 +52,7 @@ class ErrorDialog(Dialog):
51
52
  msg
52
53
  % {
53
54
  'text': self.traceback_msg.split('\n')[-2],
54
- 'color': ConsolePrEdit._errorMessageColor.name(),
55
+ 'color': self.errorMessageColor.name(),
55
56
  }
56
57
  )
57
58
 
@@ -1,6 +1,6 @@
1
1
  from __future__ import absolute_import, print_function
2
2
 
3
- from Qt.QtCore import Qt
3
+ from Qt.QtCore import Qt, Slot
4
4
  from Qt.QtGui import QIcon, QKeySequence
5
5
  from Qt.QtWidgets import QApplication, QShortcut, QWidget
6
6
 
@@ -54,6 +54,7 @@ class FindFiles(QWidget):
54
54
  self.show()
55
55
  self.uiFindTXT.setFocus()
56
56
 
57
+ @Slot()
57
58
  def find(self):
58
59
  find_text = self.uiFindTXT.text()
59
60
  context = self.uiContextSPN.value()
@@ -50,7 +50,16 @@ DocumentEditor {
50
50
  qproperty-paperDecorator: "white";
51
51
  }
52
52
 
53
- ConsolePrEdit{
53
+ ConsolePrEdit, ErrorDialog {
54
+ qproperty-errorMessageColor: rgb(255, 0, 0);
55
+ }
56
+
57
+ ConsolePrEdit {
54
58
  color: rgb(0,0,0);
55
59
  background-color: rgb(255,255,255);
60
+ qproperty-commentColor: rgb(0, 206, 52);
61
+ qproperty-keywordColor: rgb(17, 154, 255);
62
+ qproperty-resultColor: rgb(128, 128, 128);
63
+ qproperty-stdoutColor: rgb(17, 154, 255);
64
+ qproperty-stringColor: rgb(255, 128, 0);
56
65
  }
@@ -184,7 +184,16 @@ DocumentEditor {
184
184
  }
185
185
 
186
186
 
187
+ ConsolePrEdit, ErrorDialog {
188
+ qproperty-errorMessageColor: rgb(255, 0, 0);
189
+ }
190
+
187
191
  ConsolePrEdit {
188
192
  color: rgb(255, 255, 255);
189
193
  background-color: rgb(70, 70, 73);
194
+ qproperty-commentColor: rgb(0, 206, 52);
195
+ qproperty-keywordColor: rgb(17, 154, 255);
196
+ qproperty-resultColor: rgb(128, 128, 128);
197
+ qproperty-stdoutColor: rgb(17, 154, 255);
198
+ qproperty-stringColor: rgb(255, 128, 0);
190
199
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PrEditor
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: A python REPL and Editor and console based on Qt.
5
5
  Home-page: https://github.com/blurstudio/PrEditor.git
6
6
  Author: Blur Studio
@@ -11,7 +11,6 @@ preditor/plugins.py,sha256=W3DfdDEE5DtEXOXioEyIe4tuIVV1V-RLcV8LoZJWpWU,1916
11
11
  preditor/prefs.py,sha256=BPtSsdv2yuiRpIaqEml9fxlVYKHNfqQ77hp5YIQRDBg,2172
12
12
  preditor/settings.py,sha256=DV9_DbJorEnhdIvW15E7h7PswlQUsy0UlA8bXUYN0og,2206
13
13
  preditor/streamhandler_helper.py,sha256=kiU6T9WqJ3JKTTKCa7IUU8brwK7zO5UUpEzLhEfKe44,1788
14
- preditor/version.py,sha256=EkMSrLesUk3YwILml18un292fCmaA26avBUvLZyjx5Y,142
15
14
  preditor/weakref.py,sha256=b--KomFAHcMWr3DEAIN2j3XxRhjDWKw0WABXyn1nxDg,12177
16
15
  preditor/cores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
16
  preditor/cores/core.py,sha256=ZXB4bts05DMQtc-dtkk81chIWNqYXImMuWCYuUHwLdA,2389
@@ -21,14 +20,14 @@ preditor/delayable_engine/__init__.py,sha256=7GNnc2996zCzBtkB3U9Ic0EcXToVYrlewSM
21
20
  preditor/delayable_engine/delayables.py,sha256=GWxv4iTcqFeo7703SMrtotKx4cfq1ujJMNdpmtawPqc,2708
22
21
  preditor/gui/__init__.py,sha256=vie2aDVpGjrDYxK1H2pTVIgFjIk6B8nNf6rWNwCVJ3Y,3132
23
22
  preditor/gui/app.py,sha256=RRiaDpUdWYoVkCFThMfsSSFG63jRt7LKx2QOx8lSdK4,5810
24
- preditor/gui/codehighlighter.py,sha256=fYrEi2qzKmZcTOCv3qRymGAqC7z4bRzO9IGa6cn-LF4,7199
23
+ preditor/gui/codehighlighter.py,sha256=3JxXZpZqN3KVZbQgSmO-JldSlf4zFQ0PojWwucTsy5U,7171
25
24
  preditor/gui/completer.py,sha256=T6fl_4xGVjVtGNuR6ajD1ngjEhrKR6tZ9zPJDYoKn8E,7379
26
- preditor/gui/console.py,sha256=jl-Sp65Qw6ZgZNxrKCkVI1jkryPbHjxx3fxDwRs1QAA,35712
25
+ preditor/gui/console.py,sha256=qjr1OtAQ0dAUv4_u_j3Tz8XGRMwkdBAw3JYt46FzlwI,34876
27
26
  preditor/gui/dialog.py,sha256=Vw8Wflb2P3TngO8b-2suWP6JKHBVHdbGgYiRDKzYRlQ,7488
28
27
  preditor/gui/drag_tab_bar.py,sha256=5J-BSKQzS6_WuYxxGqmnUJr6AriTAvwfVK7Q3p7knrM,7933
29
28
  preditor/gui/editor_chooser.py,sha256=lv1eY0UJOulX1l-P-ZQEoneYz6BNX2VkXEbg3GUu1ag,1991
30
- preditor/gui/errordialog.py,sha256=FZzSykNtqgTZ-CKEsLFXfcw_k8zwx7g_aMaHbpnq2xI,3110
31
- preditor/gui/find_files.py,sha256=vh19jY571Z4E9IWSL4VyYcNJWYXzwxBHzBOzxWjI9QM,4223
29
+ preditor/gui/errordialog.py,sha256=Re-rc4r24bwfUL3YkZGELNhAJD9B220xznbDcXC6EEg,3234
30
+ preditor/gui/find_files.py,sha256=8_b0oQgL6u8U2FqpR2RzMChME9eYdJq3c3bgXXDeceY,4241
32
31
  preditor/gui/level_buttons.py,sha256=yPFIWKc0bgKLrP2XHyBqNuvvTnXZqGdtN_p27jSb1Og,11925
33
32
  preditor/gui/logger_window_handler.py,sha256=VTNhaoFUnConE3NHj9KaDZlVoifix8xCbCuN5Ozjz0M,1482
34
33
  preditor/gui/loggerwindow.py,sha256=zOIzq12ffLF0xp3oChP0bc7KB_4BJ8kK5Oy0gQSGRuI,51303
@@ -105,8 +104,8 @@ preditor/resource/img/subdirectory-arrow-right.png,sha256=PXmp15L0nBHgq_YJlG4WLd
105
104
  preditor/resource/img/text-search-variant.png,sha256=98uwrqOgxmraS1DJ8kJskr9_J7cF3e-niwVuBDqYinA,718
106
105
  preditor/resource/img/warning-big.png,sha256=z5QKX3DNLo_UDRKdjwtELbXL_JLf2zOwhkMPnIeu3vw,1065
107
106
  preditor/resource/lang/python.json,sha256=CXiQh0jcgd-OCrM-s9IF7s4o-g5WRA4vDaAyTRAxAQo,316
108
- preditor/resource/stylesheet/Bright.css,sha256=wxzpkhcOC9GzALb0NYAMASnZmXEe9urZBniHNImwTc4,2186
109
- preditor/resource/stylesheet/Dark.css,sha256=l3n9Z89JNlVDWKDtMTlipQkSSVPSJXbKd0tOMWnx7PQ,5085
107
+ preditor/resource/stylesheet/Bright.css,sha256=SfnPRBqfqEL4IF8RGt9PpLX_cSiGpfG9Q2hE1F9uTsk,2480
108
+ preditor/resource/stylesheet/Dark.css,sha256=Sige7beBhRyfav9_mXvn-LhksxbX0_WEgpZSKhmPavc,5384
110
109
  preditor/scintilla/__init__.py,sha256=AoUc-fcp2D3F10FDFsp_ZzUr4zioDH0mvdubSF7sRG0,523
111
110
  preditor/scintilla/documenteditor.py,sha256=6EfqJLcG2ZqzDUxvdtIrHyuVSF47goWpGrVEBMJN3pw,77919
112
111
  preditor/scintilla/finddialog.py,sha256=vcYPj74LbCy4KXdh0eJyOb8i31pJKgOZitKpgW4zhBM,2346
@@ -149,9 +148,9 @@ preditor/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
149
148
  preditor/utils/cute.py,sha256=LfF8gXMAkkQAdo4mm6J9aVkDLwWZbE6prQ0moDbtCys,1045
150
149
  preditor/utils/stylesheets.py,sha256=EVWZNq3WnaRiyUPoYMKQo_dLEwbRyKu26b03I1JDA-s,1622
151
150
  preditor/utils/text_search.py,sha256=21kuSDTpLIPUcriB81WP1kWfzuDBuP13ZtHUtypP5jE,14218
152
- preditor-0.6.0.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
153
- preditor-0.6.0.dist-info/METADATA,sha256=od__v42wWO_m7_ZSETaUIOJvup_rF_7czhcVDbd__AA,9278
154
- preditor-0.6.0.dist-info/WHEEL,sha256=joeZ_q2kZqPjVkNy_YbjGrynLS6bxmBj74YkvIORXVI,109
155
- preditor-0.6.0.dist-info/entry_points.txt,sha256=mpe0HFD_oIEBNPTJNyUEbmMV6Ivrp4EuYyZ34C5d_PU,519
156
- preditor-0.6.0.dist-info/top_level.txt,sha256=iX1_mrUOky_BQr2oG0l_MbEUYF6idyjiWSzu9z3irIw,9
157
- preditor-0.6.0.dist-info/RECORD,,
151
+ preditor-0.7.0.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
152
+ preditor-0.7.0.dist-info/METADATA,sha256=DXT7s09fyqqvGN51fnGnuNpUfgTEbK_eTo26Vg9sIjU,9278
153
+ preditor-0.7.0.dist-info/WHEEL,sha256=egKm5cKfE6OqlHwodY8Jjp4yqZDBXgsj09UsV5ojd_U,109
154
+ preditor-0.7.0.dist-info/entry_points.txt,sha256=mpe0HFD_oIEBNPTJNyUEbmMV6Ivrp4EuYyZ34C5d_PU,519
155
+ preditor-0.7.0.dist-info/top_level.txt,sha256=iX1_mrUOky_BQr2oG0l_MbEUYF6idyjiWSzu9z3irIw,9
156
+ preditor-0.7.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.4.0)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any
preditor/version.py DELETED
@@ -1,5 +0,0 @@
1
- # coding: utf-8
2
- # file generated by setuptools_scm
3
- # don't change, don't track in version control
4
- version = '0.6.0'
5
- version_tuple = (0, 6, 0)