switch from PyQt6 to PySide6
PySide6 uses LGPL instead of GPL, which is much nicer to work with.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import math
|
import math
|
||||||
|
|
||||||
from PyQt6.QtWidgets import QScrollBar
|
from PySide6.QtWidgets import QScrollBar
|
||||||
from PyQt6.QtCore import pyqtSignal
|
from PySide6.QtCore import Signal
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
log = logging.getLogger("scaledScrollBar")
|
log = logging.getLogger("scaledScrollBar")
|
||||||
@@ -10,7 +10,7 @@ log = logging.getLogger("scaledScrollBar")
|
|||||||
class ScaledScrollBar(QScrollBar):
|
class ScaledScrollBar(QScrollBar):
|
||||||
is_huge = False
|
is_huge = False
|
||||||
|
|
||||||
valueChanged = pyqtSignal(str)
|
scaledValueChanged = Signal(str)
|
||||||
"""Signal emitted when the scroll bar value changes.
|
"""Signal emitted when the scroll bar value changes.
|
||||||
**Note**: The value is a string and must be parsed into an int.
|
**Note**: The value is a string and must be parsed into an int.
|
||||||
QT's signal api only supports 32bit integers. Ints larger
|
QT's signal api only supports 32bit integers. Ints larger
|
||||||
@@ -49,6 +49,6 @@ class ScaledScrollBar(QScrollBar):
|
|||||||
if self.is_huge:
|
if self.is_huge:
|
||||||
real_value = (value / self.maximum()) * self.real_maximum
|
real_value = (value / self.maximum()) * self.real_maximum
|
||||||
# print("scaled value changed: %d -> %d (%f)" % (value, real_value, value / self.maximum()))
|
# print("scaled value changed: %d -> %d (%f)" % (value, real_value, value / self.maximum()))
|
||||||
self.valueChanged.emit(str(int(real_value)))
|
self.scaledValueChanged.emit(str(int(real_value)))
|
||||||
else:
|
else:
|
||||||
self.valueChanged.emit(str(int(value)))
|
self.scaledValueChanged.emit(str(int(value)))
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
from PyQt6.QtCore import Qt
|
import PySide6
|
||||||
from PyQt6.QtGui import QFont, QPixmap
|
from PySide6.QtCore import Qt
|
||||||
from PyQt6.QtWidgets import *
|
from PySide6.QtGui import QFont, QPixmap
|
||||||
|
from PySide6.QtWidgets import *
|
||||||
|
|
||||||
import constants
|
import constants
|
||||||
from label import Label
|
from label import Label
|
||||||
@@ -33,7 +34,7 @@ class AboutDialog(QDialog):
|
|||||||
hbox = QHBoxLayout(heading)
|
hbox = QHBoxLayout(heading)
|
||||||
hbox.addWidget(app_icon)
|
hbox.addWidget(app_icon)
|
||||||
hbox.addWidget(VBox(heading_app_name, version))
|
hbox.addWidget(VBox(heading_app_name, version))
|
||||||
hbox.addSpacerItem(QSpacerItem(1, 1, hPolicy=QSizePolicy.Policy.Expanding))
|
hbox.addSpacerItem(QSpacerItem(1, 1, hData=QSizePolicy.Policy.Expanding))
|
||||||
|
|
||||||
heading.layout = hbox
|
heading.layout = hbox
|
||||||
self.layout.addWidget(heading)
|
self.layout.addWidget(heading)
|
||||||
@@ -54,20 +55,24 @@ class AboutDialog(QDialog):
|
|||||||
result.layout = QVBoxLayout(result)
|
result.layout = QVBoxLayout(result)
|
||||||
label = Label(self.tr(textwrap.dedent("""
|
label = Label(self.tr(textwrap.dedent("""
|
||||||
Log file viewer<br>
|
Log file viewer<br>
|
||||||
(c) 2021 Open Text Corporation<br>
|
(c) 2022 Open Text Corporation<br>
|
||||||
<a href="https://www.opentext.com/">License: GPL</a>""")))
|
<a href="https://www.opentext.com/">License: LGPL v3</a>""")))
|
||||||
result.layout.addWidget(label)
|
result.layout.addWidget(label)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def _license(self) -> QWidget:
|
def _license(self) -> QWidget:
|
||||||
|
dependencies = """
|
||||||
|
<ul>
|
||||||
|
<li>PySide6 {pyside} (LGPL v3) - <a href="https://doc.qt.io/qtforpython-6/">https://doc.qt.io/qtforpython-6/</a></li>
|
||||||
|
<li>Qt6 {qt} (LGPL v3) - <a href="https://code.qt.io/cgit/qt/qtbase.git/">https://code.qt.io/cgit/qt/qtbase.git/</a></li>
|
||||||
|
<li>urllib3 (MIT) - <a href="https://urllib3.readthedocs.io/en/stable/">https://urllib3.readthedocs.io/en/stable/</a></li>
|
||||||
|
<li>watchdog 2.16 (Apache 2.0) - <a href="https://github.com/gorakhargosh/watchdog">https://github.com/gorakhargosh/watchdog</a></li>
|
||||||
|
</ul>""".format(pyside=PySide6.__version__, qt=PySide6.QtCore.__version__)
|
||||||
|
label = self.tr(textwrap.dedent(dependencies))
|
||||||
|
|
||||||
result = QWidget()
|
result = QWidget()
|
||||||
result.layout = QVBoxLayout(result)
|
result.layout = QVBoxLayout(result)
|
||||||
result.layout.addWidget(Label(self.tr(textwrap.dedent("""
|
result.layout.addWidget(Label(label))
|
||||||
<ul>
|
|
||||||
<li>PyQt6 6.2.1 (GPL v3)</li>
|
|
||||||
<li>Qt6 6.2.1 (LGPL v3) - <a href="https://code.qt.io/cgit/qt/qtbase.git/">https://code.qt.io/cgit/qt/qtbase.git/</a></li>
|
|
||||||
<li>watchdog 2.16 (Apache 2.0)</li>
|
|
||||||
</ul>"""))))
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def _version(self):
|
def _version(self):
|
||||||
@@ -75,3 +80,4 @@ class AboutDialog(QDialog):
|
|||||||
line = f.readline()
|
line = f.readline()
|
||||||
version = line.strip()
|
version = line.strip()
|
||||||
return version
|
return version
|
||||||
|
|
||||||
|
|||||||
20
bigtext.py
20
bigtext.py
@@ -4,12 +4,12 @@ import math
|
|||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
from typing import Callable, List
|
from typing import Callable, List
|
||||||
from PyQt6 import QtGui
|
from PySide6 import QtGui
|
||||||
|
|
||||||
from PyQt6.QtCore import *
|
from PySide6.QtCore import *
|
||||||
from PyQt6.QtGui import *
|
from PySide6.QtGui import *
|
||||||
from PyQt6.QtGui import QMouseEvent
|
from PySide6.QtGui import QMouseEvent
|
||||||
from PyQt6.QtWidgets import *
|
from PySide6.QtWidgets import *
|
||||||
|
|
||||||
import constants
|
import constants
|
||||||
from ScaledScrollBar import ScaledScrollBar
|
from ScaledScrollBar import ScaledScrollBar
|
||||||
@@ -19,7 +19,7 @@ from highlighted_range import HighlightedRange
|
|||||||
from highlightingdialog import HighlightingDialog
|
from highlightingdialog import HighlightingDialog
|
||||||
from line import Line
|
from line import Line
|
||||||
from logFileModel import LogFileModel
|
from logFileModel import LogFileModel
|
||||||
|
from raven.pluginregistry import PluginRegistry
|
||||||
|
|
||||||
from ravenui import RavenUI
|
from ravenui import RavenUI
|
||||||
from settings import Settings
|
from settings import Settings
|
||||||
@@ -86,7 +86,7 @@ class BigText(QWidget):
|
|||||||
|
|
||||||
self.v_scroll_bar = ScaledScrollBar()
|
self.v_scroll_bar = ScaledScrollBar()
|
||||||
# self.v_scroll_bar.setPageStep(1)
|
# self.v_scroll_bar.setPageStep(1)
|
||||||
self.v_scroll_bar.valueChanged.connect(self.big_text.v_scroll_event)
|
self.v_scroll_bar.scaledValueChanged.connect(self.big_text.v_scroll_event)
|
||||||
|
|
||||||
self.grid.addWidget(self.big_text, 0, 0)
|
self.grid.addWidget(self.big_text, 0, 0)
|
||||||
self.grid.addWidget(self.h_scroll_bar, 1, 0)
|
self.grid.addWidget(self.h_scroll_bar, 1, 0)
|
||||||
@@ -271,11 +271,13 @@ class InnerBigText(QWidget):
|
|||||||
self._left_offset = self._left_offset + 2
|
self._left_offset = self._left_offset + 2
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
|
@Slot()
|
||||||
def h_scroll_event(self, left_offset: int):
|
def h_scroll_event(self, left_offset: int):
|
||||||
self._left_offset = left_offset
|
self._left_offset = left_offset
|
||||||
# print("left_offset: %d" % left_offset)
|
# print("left_offset: %d" % left_offset)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
|
@Slot()
|
||||||
def v_scroll_event(self, byte_offset: str):
|
def v_scroll_event(self, byte_offset: str):
|
||||||
self._byte_offset = int(byte_offset)
|
self._byte_offset = int(byte_offset)
|
||||||
self.update()
|
self.update()
|
||||||
@@ -354,13 +356,13 @@ class InnerBigText(QWidget):
|
|||||||
dialog = QFileDialog(self)
|
dialog = QFileDialog(self)
|
||||||
(selected_file, _filter) = dialog.getSaveFileName(
|
(selected_file, _filter) = dialog.getSaveFileName(
|
||||||
caption=self.tr("Save File"),
|
caption=self.tr("Save File"),
|
||||||
directory=os.path.dirname(self.model.get_file())
|
dir=os.path.dirname(self.model.get_file())
|
||||||
)
|
)
|
||||||
if selected_file:
|
if selected_file:
|
||||||
self.model.write_range(start, end, selected_file)
|
self.model.write_range(start, end, selected_file)
|
||||||
open_tab = self.model.settings.session.getboolean("general", "open_tab_on_save_as_file")
|
open_tab = self.model.settings.session.getboolean("general", "open_tab_on_save_as_file")
|
||||||
if open_tab:
|
if open_tab:
|
||||||
RavenUI.window.open_file(selected_file)
|
PluginRegistry.execute("open_file", selected_file)
|
||||||
|
|
||||||
def _select_all(self):
|
def _select_all(self):
|
||||||
self.selection_highlight.start_byte = 0
|
self.selection_highlight.start_byte = 0
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from PyQt6.QtGui import QColor, QPixmap, QIcon
|
from PySide6.QtGui import QColor, QPixmap, QIcon
|
||||||
from PyQt6.QtWidgets import QWidget, QHBoxLayout, QPushButton, QColorDialog, QSizePolicy, QComboBox
|
from PySide6.QtWidgets import QWidget, QHBoxLayout, QPushButton, QColorDialog, QSizePolicy, QComboBox
|
||||||
|
|
||||||
|
|
||||||
class ColorButton(QWidget):
|
class ColorButton(QWidget):
|
||||||
def __init__(self, color: str):
|
def __init__(self, color: str, parent=None):
|
||||||
super(QWidget, self).__init__()
|
super(ColorButton, self).__init__(parent)
|
||||||
|
|
||||||
self.setSizePolicy(QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed))
|
self.setSizePolicy(QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed))
|
||||||
self.layout = QHBoxLayout(self)
|
self.layout = QHBoxLayout(self)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from PyQt6.QtCore import QSettings
|
from PySide6.QtCore import QSettings
|
||||||
|
|
||||||
|
|
||||||
class CuteSettings:
|
class CuteSettings:
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import tempfile
|
|||||||
import threading
|
import threading
|
||||||
from typing import Optional, Callable
|
from typing import Optional, Callable
|
||||||
|
|
||||||
from PyQt6.QtCore import QRunnable, QThreadPool
|
from PySide6.QtCore import QRunnable, QThreadPool
|
||||||
from PyQt6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLineEdit, QCheckBox, QPushButton
|
from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QLineEdit, QCheckBox, QPushButton
|
||||||
|
|
||||||
from bigtext import BigText
|
from bigtext import BigText
|
||||||
from logFileModel import LogFileModel
|
from logFileModel import LogFileModel
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from PyQt6.QtWidgets import *
|
from PySide6.QtWidgets import *
|
||||||
from PyQt6.QtCore import *
|
from PySide6.QtCore import *
|
||||||
|
|
||||||
from bigtext import BigText
|
from bigtext import BigText
|
||||||
from filterviewsyncer import FilterViewSyncer
|
from filterviewsyncer import FilterViewSyncer
|
||||||
|
|||||||
2
hbox.py
2
hbox.py
@@ -1,4 +1,4 @@
|
|||||||
from PyQt6.QtWidgets import QWidget, QHBoxLayout
|
from PySide6.QtWidgets import QWidget, QHBoxLayout
|
||||||
|
|
||||||
|
|
||||||
class HBox(QWidget):
|
class HBox(QWidget):
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from typing import Optional
|
|||||||
from highlight import Highlight
|
from highlight import Highlight
|
||||||
from highlighted_range import HighlightedRange
|
from highlighted_range import HighlightedRange
|
||||||
from line import Line
|
from line import Line
|
||||||
from PyQt6.QtGui import *
|
from PySide6.QtGui import QBrush, QColor
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
import re
|
import re
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ from typing import Optional, List
|
|||||||
from highlight import Highlight
|
from highlight import Highlight
|
||||||
from highlighted_range import HighlightedRange
|
from highlighted_range import HighlightedRange
|
||||||
from line import Line
|
from line import Line
|
||||||
from PyQt6.QtCore import *
|
from PySide6.QtCore import Qt
|
||||||
from PyQt6.QtGui import *
|
from PySide6.QtGui import QBrush, QColor
|
||||||
|
|
||||||
from settings import Settings
|
from settings import Settings
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from PyQt6.QtCore import *
|
from PySide6.QtCore import Qt
|
||||||
from PyQt6.QtGui import *
|
from PySide6.QtGui import QBrush, QPen
|
||||||
|
|
||||||
|
|
||||||
class HighlightedRange:
|
class HighlightedRange:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from PyQt6.QtGui import QIcon
|
from PySide6.QtGui import QIcon
|
||||||
from PyQt6.QtWidgets import QDialog, QLineEdit, QLabel, QGridLayout, QCheckBox, QListWidget, QListWidgetItem, \
|
from PySide6.QtWidgets import QDialog, QLineEdit, QLabel, QGridLayout, QCheckBox, QListWidget, QListWidgetItem, \
|
||||||
QPushButton, QDialogButtonBox, QMessageBox, QSizePolicy
|
QPushButton, QDialogButtonBox, QMessageBox, QSizePolicy
|
||||||
|
|
||||||
from colorbutton import ColorButton
|
from colorbutton import ColorButton
|
||||||
|
|||||||
5
label.py
5
label.py
@@ -1,5 +1,5 @@
|
|||||||
from PyQt6.QtWidgets import QLabel
|
from PySide6.QtWidgets import QLabel
|
||||||
from PyQt6.QtCore import Qt
|
from PySide6.QtCore import Qt
|
||||||
|
|
||||||
|
|
||||||
class Label(QLabel):
|
class Label(QLabel):
|
||||||
@@ -7,4 +7,5 @@ class Label(QLabel):
|
|||||||
super(Label, self).__init__(text)
|
super(Label, self).__init__(text)
|
||||||
self.setTextInteractionFlags(Qt.TextInteractionFlag.TextBrowserInteraction)
|
self.setTextInteractionFlags(Qt.TextInteractionFlag.TextBrowserInteraction)
|
||||||
self.setTextInteractionFlags(Qt.TextInteractionFlag.LinksAccessibleByMouse)
|
self.setTextInteractionFlags(Qt.TextInteractionFlag.LinksAccessibleByMouse)
|
||||||
|
self.setTextInteractionFlags(Qt.TextInteractionFlag.TextSelectableByMouse)
|
||||||
self.setOpenExternalLinks(True)
|
self.setOpenExternalLinks(True)
|
||||||
|
|||||||
1
line.py
1
line.py
@@ -1,5 +1,4 @@
|
|||||||
import unicodedata
|
import unicodedata
|
||||||
from typing import Dict
|
|
||||||
|
|
||||||
import constants
|
import constants
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import math
|
import math
|
||||||
import re
|
import re
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
from PySide6.QtCore import Signal
|
||||||
from PyQt6.QtCore import pyqtSignal
|
|
||||||
|
|
||||||
from highlight_regex import HighlightRegex
|
from highlight_regex import HighlightRegex
|
||||||
from highlighting import Highlighting
|
from highlighting import Highlighting
|
||||||
from line import Line
|
from line import Line
|
||||||
@@ -14,7 +12,7 @@ from settings import Settings
|
|||||||
class LogFileModel:
|
class LogFileModel:
|
||||||
_query_highlight: Optional[HighlightRegex] = None
|
_query_highlight: Optional[HighlightRegex] = None
|
||||||
|
|
||||||
file_size_changed = pyqtSignal(str)
|
file_size_changed = Signal()
|
||||||
"""Fires when the file size changed. **Note:** uses strings,
|
"""Fires when the file size changed. **Note:** uses strings,
|
||||||
because int in Qt signal are limited to 32bit."""
|
because int in Qt signal are limited to 32bit."""
|
||||||
|
|
||||||
|
|||||||
9
main.py
9
main.py
@@ -2,17 +2,16 @@ import logging
|
|||||||
import signal
|
import signal
|
||||||
import ctypes
|
import ctypes
|
||||||
|
|
||||||
from PyQt6 import QtCore
|
from PySide6 import QtCore
|
||||||
from PyQt6.QtWidgets import *
|
from PySide6.QtWidgets import QApplication
|
||||||
from PyQt6.QtCore import *
|
from PySide6.QtCore import QTimer
|
||||||
from PyQt6.QtGui import *
|
from PySide6.QtGui import QIcon
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import constants
|
import constants
|
||||||
from raven.pluginregistry import PluginRegistry
|
from raven.pluginregistry import PluginRegistry
|
||||||
from ravenui import RavenUI
|
from ravenui import RavenUI
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.INFO)
|
||||||
log = logging.getLogger("main")
|
log = logging.getLogger("main")
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import glob
|
|
||||||
import os
|
|
||||||
|
|
||||||
from PyQt6.lupdate import lupdate
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
python_files = glob.glob(r"*.py")
|
|
||||||
print(python_files)
|
|
||||||
lupdate(python_files, ["messages_de.ts"])
|
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
import logging
|
import logging
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from PyQt6.QtWidgets import *
|
from PySide6.QtWidgets import *
|
||||||
from PyQt6.QtGui import *
|
from PySide6.QtGui import *
|
||||||
from PyQt6.QtCore import Qt
|
from PySide6.QtCore import Qt
|
||||||
|
|
||||||
import urlutils
|
import urlutils
|
||||||
from cutesettings import CuteSettings
|
from cutesettings import CuteSettings
|
||||||
from raven.pluginregistry import PluginRegistry
|
from raven.pluginregistry import PluginRegistry
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
from types import ModuleType
|
from types import ModuleType
|
||||||
from typing import Dict, Optional
|
from typing import Dict, Optional
|
||||||
from inspect import isclass
|
from inspect import isclass
|
||||||
from pkgutil import iter_modules
|
|
||||||
from pathlib import Path
|
|
||||||
from os.path import dirname
|
|
||||||
from importlib import import_module
|
from importlib import import_module
|
||||||
from inspect import signature
|
from inspect import signature
|
||||||
from raven.pluginbase import PluginBase
|
from raven.pluginbase import PluginBase
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import os.path
|
import os.path
|
||||||
from typing import Callable, Optional
|
from typing import Callable, Optional
|
||||||
|
|
||||||
from PyQt6.QtWidgets import QMessageBox
|
from PySide6.QtWidgets import QMessageBox
|
||||||
|
|
||||||
from fulltabwidget import FullTabWidget
|
from fulltabwidget import FullTabWidget
|
||||||
from logFileModel import LogFileModel
|
from logFileModel import LogFileModel
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from raven.plugins.ravenlog.Tab import Tab
|
from raven.plugins.ravenlog.Tab import Tab
|
||||||
from PyQt6.QtWidgets import *
|
from PySide6.QtWidgets import QTextEdit, QVBoxLayout
|
||||||
|
|
||||||
|
|
||||||
class NotesWidget(Tab):
|
class NotesWidget(Tab):
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from typing import Callable
|
from typing import Callable
|
||||||
|
|
||||||
from PyQt6.QtCore import Qt
|
from PySide6.QtCore import Qt
|
||||||
|
|
||||||
from raven.pluginbase import PluginBase
|
from raven.pluginbase import PluginBase
|
||||||
from raven.pluginregistry import PluginRegistry
|
from raven.pluginregistry import PluginRegistry
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from PyQt6.QtGui import QAction, QIcon
|
from PySide6.QtWidgets import QFileDialog
|
||||||
from PyQt6.QtWidgets import QMenu, QFileDialog
|
|
||||||
|
|
||||||
from raven.pluginbase import PluginBase
|
from raven.pluginbase import PluginBase
|
||||||
from raven.pluginregistry import PluginRegistry
|
from raven.pluginregistry import PluginRegistry
|
||||||
@@ -47,8 +46,9 @@ class OpenFilePlugin(PluginBase):
|
|||||||
dialog = QFileDialog()
|
dialog = QFileDialog()
|
||||||
(selected_file, _filter) = dialog.getOpenFileName(
|
(selected_file, _filter) = dialog.getOpenFileName(
|
||||||
caption=self.tr("Open File"),
|
caption=self.tr("Open File"),
|
||||||
directory=directory
|
dir=directory
|
||||||
)
|
)
|
||||||
|
# directory=directory
|
||||||
if selected_file:
|
if selected_file:
|
||||||
self.open_file(selected_file)
|
self.open_file(selected_file)
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ class OpenFilePlugin(PluginBase):
|
|||||||
files = self._get_recent_files()
|
files = self._get_recent_files()
|
||||||
for file in files:
|
for file in files:
|
||||||
action = RAction(os.path.basename(file))
|
action = RAction(os.path.basename(file))
|
||||||
action.set_action(lambda x, f=file: self.open_file(f))
|
action.set_action(lambda _="", f=file: self.open_file(f))
|
||||||
self._menu_recent_files.add_action(action)
|
self._menu_recent_files.add_action(action)
|
||||||
|
|
||||||
def _remember_recent_file(self, file: str):
|
def _remember_recent_file(self, file: str):
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
|
|
||||||
from PyQt6.QtWidgets import QWidget
|
from PySide6.QtWidgets import QWidget
|
||||||
|
|
||||||
|
|
||||||
class Tab(QWidget):
|
class Tab(QWidget):
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import sys
|
import sys
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from PyQt6.QtCore import Qt
|
from PySide6.QtCore import Qt
|
||||||
from PyQt6.QtWidgets import QDockWidget, QLabel
|
from PySide6.QtWidgets import QDockWidget
|
||||||
|
|
||||||
import constants
|
import constants
|
||||||
from aboutdialog import AboutDialog
|
from aboutdialog import AboutDialog
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
PyQt6==6.2.2
|
PySide6==6.2.2.1
|
||||||
PyQt6-Qt6==6.2.2
|
|
||||||
PyQt6-sip==13.2.0
|
|
||||||
six==1.16.0
|
six==1.16.0
|
||||||
urllib3==1.26.8
|
urllib3==1.26.8
|
||||||
watchdog==2.1.6
|
watchdog==2.1.6
|
||||||
|
|||||||
37
scribble.py
37
scribble.py
@@ -1,37 +1,10 @@
|
|||||||
# extract icons from dll on windows
|
# extract icons from dll on windows
|
||||||
# https://mail.python.org/pipermail/python-win32/2009-April/009078.html
|
# https://mail.python.org/pipermail/python-win32/2009-April/009078.html
|
||||||
import re
|
|
||||||
import time
|
|
||||||
|
|
||||||
from highlighted_range import HighlightedRange
|
import PySide6.QtCore
|
||||||
from line import Line
|
|
||||||
|
|
||||||
result = []
|
# Prints PySide6 version
|
||||||
|
print(PySide6.__version__)
|
||||||
|
|
||||||
byte_offset = 123
|
# Prints the Qt version used to compile PySide6
|
||||||
text = "2021-09-21 08:40:38,187 [catalina-exec-37] INFO c.r.c.s.l.SearchAdapter - Fetched 0 fields, 1 folders, 0 content requests for 1 documents; took 763ms (including 0ms to fetch field names). [project=axcelerate.lds_5m_review2, session=37891bc0-a67e-4c43-90c0-c20da567f491, user=r-162] [kttsjx2h.48z.9ls] 2021-09-21 08:47:16,529 [BravaJobHandler-12] INFO c.r.b.c.f.i.DoneNotifierRunnable - CORE job for 'complete document request with output format xdl (source n.pdf)' complete. Notifying Brava server about completion for numId=LDS_001:00095883.. Extracting and moving XDL and SVG/Thumbs took 31ms (from remote stream from 172.28.60.208:51048,com.recommind.rmi.ssl.SslRmiExporter$CheckedSslRmiClientSocketFactory). Notifying with URL https://localhost:8889/BravaServer/done/xc_E4E99FE32A313D2FBA8D29F846C0EF439E8AE2BE159164D04B2AFD862F714BED_ (context switch time 0ms) [project=axcelerate.lds_5m_review2, session=500380b9-94c5-4740-b30a-81e9f6cd071d, user=r-377] [kttsjx2h.8ys.kai]"
|
print(PySide6.QtCore.__version__)
|
||||||
|
|
||||||
start = time.time()
|
|
||||||
line = Line(byte_offset=byte_offset, byte_end=byte_offset + len(text.encode("utf8")), line=text)
|
|
||||||
regex = re.compile(r"\w", flags=re.IGNORECASE)
|
|
||||||
match_iter = re.finditer(regex, line.line())
|
|
||||||
for match in match_iter:
|
|
||||||
start_char = match.start(0)
|
|
||||||
end_char = match.end(0)
|
|
||||||
|
|
||||||
start_column = line.char_to_column(start_char)
|
|
||||||
end_column = line.char_to_column(end_char)
|
|
||||||
|
|
||||||
result.append(HighlightedRange(start_column, end_column - start_column, highlight_full_line=True, brush=None,
|
|
||||||
brush_full_line=None))
|
|
||||||
|
|
||||||
end = time.time()
|
|
||||||
print("duration: %.3f" % ((end - start) * 1000))
|
|
||||||
|
|
||||||
result = []
|
|
||||||
start = time.time()
|
|
||||||
for i in range(0, 10000):
|
|
||||||
result.append(i)
|
|
||||||
|
|
||||||
end = time.time()
|
|
||||||
print("duration: %.3f" % ((end - start) * 1000))
|
|
||||||
|
|||||||
7
tabs.py
7
tabs.py
@@ -1,9 +1,6 @@
|
|||||||
import os
|
from typing import Optional
|
||||||
from typing import Mapping, Optional
|
|
||||||
|
|
||||||
from PyQt6.QtWidgets import *
|
from PySide6.QtWidgets import QWidget, QTabWidget, QVBoxLayout
|
||||||
from PyQt6.QtCore import *
|
|
||||||
from PyQt6.QtGui import *
|
|
||||||
|
|
||||||
from bigtext import BigText
|
from bigtext import BigText
|
||||||
from fulltabwidget import FullTabWidget
|
from fulltabwidget import FullTabWidget
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ from configparser import ConfigParser
|
|||||||
from os.path import join
|
from os.path import join
|
||||||
|
|
||||||
from logFileModel import LogFileModel
|
from logFileModel import LogFileModel
|
||||||
from line import Line
|
|
||||||
from settings import Settings
|
from settings import Settings
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user