PrEditor 0.5.0__py2.py3-none-any.whl → 0.6.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.

preditor/__init__.py CHANGED
@@ -113,6 +113,11 @@ def configure(name, parent_callback=None, excepthook=True, logging=True, streams
113
113
  preditor.debug.BlurExcepthook.install()
114
114
 
115
115
 
116
+ def get_core_name():
117
+ """Returns the configured core_name or DEFAULT_CORE_NAME."""
118
+ return _global_config.get('core_name', DEFAULT_CORE_NAME)
119
+
120
+
116
121
  def launch(run_workbox=False, app_id=None, name=None, standalone=False):
117
122
  """Launches the preditor gui creating the QApplication instance if not
118
123
  already created.
preditor/gui/console.py CHANGED
@@ -397,18 +397,27 @@ class ConsolePrEdit(QTextEdit):
397
397
  # exec which has no Return.
398
398
  wasEval = False
399
399
  startTime = time.time()
400
+
400
401
  try:
401
402
  compiled = compile(commandText, filename, 'eval')
402
403
  wasEval = True
403
404
  except Exception:
404
405
  compiled = compile(commandText, filename, 'exec')
405
- if wasEval:
406
- cmdresult = eval(compiled, __main__.__dict__, __main__.__dict__)
407
- else:
408
- exec(compiled, __main__.__dict__, __main__.__dict__)
406
+
407
+ # We wrap in try / finally so that elapsed time gets updated, even when an
408
+ # exception is raised.
409
+ try:
410
+ if wasEval:
411
+ cmdresult = eval(compiled, __main__.__dict__, __main__.__dict__)
412
+ else:
413
+ exec(compiled, __main__.__dict__, __main__.__dict__)
414
+ finally:
415
+ # Report the total time it took to execute this code.
416
+ if self.reportExecutionTime is not None:
417
+ delta = time.time() - startTime
418
+ self.reportExecutionTime((delta, commandText))
409
419
 
410
420
  # Provide user feedback when running long code execution.
411
- delta = time.time() - startTime
412
421
  if self.flash_window and self.flash_time and delta >= self.flash_time:
413
422
  if settings.OS_TYPE == "Windows":
414
423
  try:
@@ -420,9 +429,6 @@ class ConsolePrEdit(QTextEdit):
420
429
  hwnd = int(self.flash_window.winId())
421
430
  utils.flash_window(hwnd)
422
431
 
423
- # Report the total time it took to execute this code.
424
- if self.reportExecutionTime is not None:
425
- self.reportExecutionTime((delta, commandText))
426
432
  return cmdresult, wasEval
427
433
 
428
434
  def executeCommand(self):
@@ -758,6 +764,11 @@ class ConsolePrEdit(QTextEdit):
758
764
 
759
765
  self.insertPlainText(inputstr)
760
766
 
767
+ scroll = self.verticalScrollBar()
768
+ maximum = scroll.maximum()
769
+ if maximum is not None:
770
+ scroll.setValue(maximum)
771
+
761
772
  def startOutputLine(self):
762
773
  """Create a new line to show output text."""
763
774
  self.startPrompt(self._outputPrompt)
@@ -30,6 +30,7 @@ from .. import (
30
30
  about_preditor,
31
31
  core,
32
32
  debug,
33
+ get_core_name,
33
34
  osystem,
34
35
  plugins,
35
36
  prefs,
@@ -60,7 +61,7 @@ class LoggerWindow(Window):
60
61
 
61
62
  def __init__(self, parent, name=None, run_workbox=False, standalone=False):
62
63
  super(LoggerWindow, self).__init__(parent=parent)
63
- self.name = name if name else DEFAULT_CORE_NAME
64
+ self.name = name if name else get_core_name()
64
65
  self.aboutToClearPathsEnabled = False
65
66
  self._stylesheet = 'Bright'
66
67
 
@@ -519,7 +520,7 @@ class LoggerWindow(Window):
519
520
  delta = event.angleDelta().y()
520
521
 
521
522
  # convert delta to +1 or -1, depending
522
- delta = delta / abs(delta)
523
+ delta = delta // abs(delta)
523
524
  minSize = 5
524
525
  maxSize = 50
525
526
  font = self.console().font()
@@ -1,9 +1,10 @@
1
1
  from __future__ import absolute_import
2
2
 
3
3
  from collections import deque
4
+ from functools import partial
4
5
 
5
6
  from Qt.QtCore import QPoint, QTimer
6
- from Qt.QtWidgets import QInputDialog, QLabel, QMenu
7
+ from Qt.QtWidgets import QApplication, QInputDialog, QLabel, QMenu
7
8
 
8
9
 
9
10
  class StatusLabel(QLabel):
@@ -33,6 +34,10 @@ class StatusLabel(QLabel):
33
34
  if limit:
34
35
  self.setLimit(limit)
35
36
 
37
+ def copy_action_text(self, action):
38
+ """Copy the text of the provided action into the clipboard."""
39
+ QApplication.clipboard().setText(action.text())
40
+
36
41
  def mouseReleaseEvent(self, event):
37
42
  QTimer.singleShot(0, self.showMenu)
38
43
  super(StatusLabel, self).mouseReleaseEvent(event)
@@ -72,11 +77,15 @@ class StatusLabel(QLabel):
72
77
  cmd = "{} ...".format(cmds[0][:50])
73
78
  # Escape &'s so they dont' get turned into a shortcut'
74
79
  cmd = cmd.replace("&", "&&")
75
- menu.addAction("{}: {}".format(self.secondsText(secs), cmd))
80
+ act = menu.addAction("{}: {}".format(self.secondsText(secs), cmd))
81
+ # Selecting this action should copy the time it took to run
82
+ act.triggered.connect(partial(self.copy_action_text, act))
76
83
 
77
84
  menu.addSeparator()
78
85
  avg = sum(times) / len(times)
79
- menu.addAction("Average: {:0.04f}s".format(avg))
86
+ act = menu.addAction("Average: {:0.04f}s".format(avg))
87
+ act.triggered.connect(partial(self.copy_action_text, act))
88
+
80
89
  act = menu.addAction("Clear")
81
90
  act.triggered.connect(self.clearTimes)
82
91
 
preditor/version.py CHANGED
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
2
  # file generated by setuptools_scm
3
3
  # don't change, don't track in version control
4
- version = '0.5.0'
5
- version_tuple = (0, 5, 0)
4
+ version = '0.6.0'
5
+ version_tuple = (0, 6, 0)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: PrEditor
3
- Version: 0.5.0
3
+ Version: 0.6.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
@@ -39,6 +39,7 @@ Requires-Dist: pytest; extra == "dev"
39
39
  Requires-Dist: tox; extra == "dev"
40
40
  Provides-Extra: shortcut
41
41
  Requires-Dist: casement>=0.1.0; platform_system == "Windows" and extra == "shortcut"
42
+ Dynamic: license-file
42
43
 
43
44
  # PrEditor
44
45
 
@@ -1,4 +1,4 @@
1
- preditor/__init__.py,sha256=JlIK0Gp7g7DsKbyt1c5PMD9-3EyeE7q7wv1sJmhrlYc,10585
1
+ preditor/__init__.py,sha256=MDcjs6rNu92NDVu-fH3sZWgLtVKnWqDojREeIFU6fII,10735
2
2
  preditor/__main__.py,sha256=boRVSmxX6eF8EkzbePtCZbzdcaPseqVae4RPPLp3U1A,449
3
3
  preditor/about_module.py,sha256=KIvCxZrMLhm5TR6lYskM4Y9VctJ0QtSQD5Nu8Ip1CGY,5267
4
4
  preditor/cli.py,sha256=kyVr0V43KYSMLIEWXH54CA0ByFmPcpbFF-8cli6PVow,5300
@@ -11,7 +11,7 @@ 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=qOgp63DKbJUTEpeNFSC6-4Z4ggiiiujx7_nJvXchvEg,142
14
+ preditor/version.py,sha256=EkMSrLesUk3YwILml18un292fCmaA26avBUvLZyjx5Y,142
15
15
  preditor/weakref.py,sha256=b--KomFAHcMWr3DEAIN2j3XxRhjDWKw0WABXyn1nxDg,12177
16
16
  preditor/cores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  preditor/cores/core.py,sha256=ZXB4bts05DMQtc-dtkk81chIWNqYXImMuWCYuUHwLdA,2389
@@ -23,7 +23,7 @@ preditor/gui/__init__.py,sha256=vie2aDVpGjrDYxK1H2pTVIgFjIk6B8nNf6rWNwCVJ3Y,3132
23
23
  preditor/gui/app.py,sha256=RRiaDpUdWYoVkCFThMfsSSFG63jRt7LKx2QOx8lSdK4,5810
24
24
  preditor/gui/codehighlighter.py,sha256=fYrEi2qzKmZcTOCv3qRymGAqC7z4bRzO9IGa6cn-LF4,7199
25
25
  preditor/gui/completer.py,sha256=T6fl_4xGVjVtGNuR6ajD1ngjEhrKR6tZ9zPJDYoKn8E,7379
26
- preditor/gui/console.py,sha256=AW4FbiJ3kiw9w_mCJ-ZlwdTSRDpCsr4de3RT_ezN25U,35383
26
+ preditor/gui/console.py,sha256=jl-Sp65Qw6ZgZNxrKCkVI1jkryPbHjxx3fxDwRs1QAA,35712
27
27
  preditor/gui/dialog.py,sha256=Vw8Wflb2P3TngO8b-2suWP6JKHBVHdbGgYiRDKzYRlQ,7488
28
28
  preditor/gui/drag_tab_bar.py,sha256=5J-BSKQzS6_WuYxxGqmnUJr6AriTAvwfVK7Q3p7knrM,7933
29
29
  preditor/gui/editor_chooser.py,sha256=lv1eY0UJOulX1l-P-ZQEoneYz6BNX2VkXEbg3GUu1ag,1991
@@ -31,11 +31,11 @@ preditor/gui/errordialog.py,sha256=FZzSykNtqgTZ-CKEsLFXfcw_k8zwx7g_aMaHbpnq2xI,3
31
31
  preditor/gui/find_files.py,sha256=vh19jY571Z4E9IWSL4VyYcNJWYXzwxBHzBOzxWjI9QM,4223
32
32
  preditor/gui/level_buttons.py,sha256=yPFIWKc0bgKLrP2XHyBqNuvvTnXZqGdtN_p27jSb1Og,11925
33
33
  preditor/gui/logger_window_handler.py,sha256=VTNhaoFUnConE3NHj9KaDZlVoifix8xCbCuN5Ozjz0M,1482
34
- preditor/gui/loggerwindow.py,sha256=B4QjU1VjCD6YnbDAnatC-rvi7p_u_yHx9KwIwtF1mYE,51285
34
+ preditor/gui/loggerwindow.py,sha256=zOIzq12ffLF0xp3oChP0bc7KB_4BJ8kK5Oy0gQSGRuI,51303
35
35
  preditor/gui/newtabwidget.py,sha256=5aCWn9xAl5h1oZACqVuEsOAbzKTS2RegrLI41gROC8A,1971
36
36
  preditor/gui/redmine_login_dialog.py,sha256=cMPBuecSZD5yjycNkMwHa1AbdwgGoyHvX8anIvWjEFo,1893
37
37
  preditor/gui/set_text_editor_path_dialog.py,sha256=bTrYM0nU-pE2m8LIpeAUlmvP257wrcAvEdaoOURw9p8,2264
38
- preditor/gui/status_label.py,sha256=C0SNW7LQzNK-oL_iHs2FQcnAmzcOmM1CTvSo1wP1kiM,2873
38
+ preditor/gui/status_label.py,sha256=SlNRmPc28S4E2OFVmErv0DmZstk4011Q_7uLp43SF0A,3320
39
39
  preditor/gui/suggest_path_quotes_dialog.py,sha256=QUJf_9hs8wOO6bFOr8_Z2xnNhSA8TfKFMOzheUqUDnY,1822
40
40
  preditor/gui/window.py,sha256=bZAEKQDM6V4aew1nlSTPyq_tG-_IoSvyXHcZxrdFMaE,6924
41
41
  preditor/gui/workbox_mixin.py,sha256=kUVHtK-flyux3PZ9GkOYnjCJMLRcZESFJXipsgNgI0U,13851
@@ -149,9 +149,9 @@ preditor/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
149
149
  preditor/utils/cute.py,sha256=LfF8gXMAkkQAdo4mm6J9aVkDLwWZbE6prQ0moDbtCys,1045
150
150
  preditor/utils/stylesheets.py,sha256=EVWZNq3WnaRiyUPoYMKQo_dLEwbRyKu26b03I1JDA-s,1622
151
151
  preditor/utils/text_search.py,sha256=21kuSDTpLIPUcriB81WP1kWfzuDBuP13ZtHUtypP5jE,14218
152
- PrEditor-0.5.0.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
153
- PrEditor-0.5.0.dist-info/METADATA,sha256=WZmyP5dRi31mnNpq1L0nO-jSWRZv5CTDl9JtBN6ulXI,9256
154
- PrEditor-0.5.0.dist-info/WHEEL,sha256=M4n4zmFKzQZk4mLCcycNIzIXO7YPKE_b5Cw4PnhHEg8,109
155
- PrEditor-0.5.0.dist-info/entry_points.txt,sha256=mpe0HFD_oIEBNPTJNyUEbmMV6Ivrp4EuYyZ34C5d_PU,519
156
- PrEditor-0.5.0.dist-info/top_level.txt,sha256=iX1_mrUOky_BQr2oG0l_MbEUYF6idyjiWSzu9z3irIw,9
157
- PrEditor-0.5.0.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.2.0)
2
+ Generator: setuptools (80.4.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any