drap 0.0.3.post2__py3-none-any.whl → 0.0.3.post6__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.
- drap/gui.py +25 -2
- drap/qt_adjust.py +41 -0
- {drap-0.0.3.post2.dist-info → drap-0.0.3.post6.dist-info}/METADATA +3 -3
- drap-0.0.3.post6.dist-info/RECORD +13 -0
- {drap-0.0.3.post2.dist-info → drap-0.0.3.post6.dist-info}/entry_points.txt +1 -1
- drap-0.0.3.post2.dist-info/RECORD +0 -12
- {drap-0.0.3.post2.dist-info → drap-0.0.3.post6.dist-info}/WHEEL +0 -0
- {drap-0.0.3.post2.dist-info → drap-0.0.3.post6.dist-info}/licenses/LICENSE +0 -0
- {drap-0.0.3.post2.dist-info → drap-0.0.3.post6.dist-info}/top_level.txt +0 -0
drap/gui.py
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
from .utils import *
|
2
2
|
|
3
|
+
from PyQt5.QtWidgets import QApplication
|
4
|
+
import sys
|
5
|
+
|
6
|
+
from .qt_adjust import fix_qt_plugin_paths, assert_not_using_cv2_plugins
|
7
|
+
# from .safe_cv import im
|
8
|
+
|
9
|
+
|
10
|
+
|
3
11
|
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QVBoxLayout, QWidget, QPushButton, QFileDialog, QMessageBox, QLineEdit, QHBoxLayout, QGroupBox, QCheckBox
|
4
12
|
from PyQt5.QtGui import QPixmap, QPainter, QPen, QImage, QMouseEvent, QColor
|
5
13
|
from PyQt5.QtCore import Qt, QPoint, QRect, QFileInfo
|
@@ -16,7 +24,7 @@ from reportlab.lib.pagesizes import A4, letter
|
|
16
24
|
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle
|
17
25
|
from reportlab.pdfgen import canvas
|
18
26
|
from reportlab.lib import colors
|
19
|
-
|
27
|
+
|
20
28
|
import copy
|
21
29
|
import time as timelib
|
22
30
|
from datetime import datetime
|
@@ -25,7 +33,6 @@ import numpy as np
|
|
25
33
|
import sys
|
26
34
|
import re
|
27
35
|
import argparse
|
28
|
-
import cv2
|
29
36
|
import matplotlib
|
30
37
|
|
31
38
|
import matplotlib.pyplot as plt
|
@@ -38,8 +45,24 @@ matplotlib.use('Agg')
|
|
38
45
|
|
39
46
|
def main_gui():
|
40
47
|
|
48
|
+
|
49
|
+
fix_qt_plugin_paths(prefer_platform=None)
|
50
|
+
|
41
51
|
app = QApplication(sys.argv)
|
42
52
|
cropper = ImageCropper()
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
try:
|
57
|
+
assert_not_using_cv2_plugins()
|
58
|
+
except RuntimeError as e:
|
59
|
+
# Mostre uma mensagem amigável e encerre
|
60
|
+
from PyQt5.QtWidgets import QMessageBox
|
61
|
+
QMessageBox.critical(None, "Qt plugin error", str(e))
|
62
|
+
sys.exit(1)
|
63
|
+
|
64
|
+
|
65
|
+
|
43
66
|
sys.exit(app.exec_())
|
44
67
|
|
45
68
|
|
drap/qt_adjust.py
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
|
2
|
+
import os
|
3
|
+
from PyQt5.QtCore import QLibraryInfo, QCoreApplication
|
4
|
+
|
5
|
+
def fix_qt_plugin_paths(prefer_platform: str | None = None) -> None:
|
6
|
+
"""
|
7
|
+
Força o Qt a usar os plugins do PyQt5 e remove caminhos herdados do cv2.
|
8
|
+
Chame isso ANTES de criar o QApplication.
|
9
|
+
"""
|
10
|
+
# 1) Limpa variáveis que podem apontar para plugins errados
|
11
|
+
os.environ.pop("QT_QPA_PLATFORM_PLUGIN_PATH", None)
|
12
|
+
os.environ.pop("QT_PLUGIN_PATH", None)
|
13
|
+
|
14
|
+
# 2) Define plataforma padrão (ajude o usuário)
|
15
|
+
if prefer_platform:
|
16
|
+
os.environ["QT_QPA_PLATFORM"] = prefer_platform
|
17
|
+
else:
|
18
|
+
os.environ.setdefault("QT_QPA_PLATFORM", "xcb") # ou 'wayland' conforme seu público
|
19
|
+
|
20
|
+
# 3) Remove library paths que contenham plugins do cv2
|
21
|
+
for p in list(QCoreApplication.libraryPaths()):
|
22
|
+
if "cv2/qt/plugins" in p:
|
23
|
+
QCoreApplication.removeLibraryPath(p)
|
24
|
+
|
25
|
+
# 4) Garante o diretório oficial de plugins do PyQt5
|
26
|
+
pyqt_plugins = QLibraryInfo.location(QLibraryInfo.PluginsPath)
|
27
|
+
QCoreApplication.addLibraryPath(pyqt_plugins)
|
28
|
+
|
29
|
+
def assert_not_using_cv2_plugins() -> None:
|
30
|
+
"""
|
31
|
+
Se ainda houver um caminho de plugins do cv2, emite uma dica amigável.
|
32
|
+
"""
|
33
|
+
for p in QCoreApplication.libraryPaths():
|
34
|
+
if "cv2/qt/plugins" in p:
|
35
|
+
raise RuntimeError(
|
36
|
+
"Qt ainda está apontando para plugins do OpenCV (cv2/qt/plugins). "
|
37
|
+
"Instale apenas 'opencv-python-headless' e remova resíduos:\n"
|
38
|
+
" pip uninstall -y opencv-python opencv-contrib-python\n"
|
39
|
+
" # apague a pasta 'cv2' do seu site-packages deste venv\n"
|
40
|
+
" pip install --no-cache-dir opencv-python-headless PyQt5\n"
|
41
|
+
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: drap
|
3
|
-
Version: 0.0.3.
|
3
|
+
Version: 0.0.3.post6
|
4
4
|
Summary: Tool for analyzing droplet size and concentration using video and EDF images
|
5
5
|
Author-email: "Gabriel Braga Marques Teobaldo, Oleg Prymak, Natalie Wolff, Matthias Epple, Marco Aurélio Brizzotti Andrade, Cássio Alves and Cristiano Luis Pinto de Oliveira" <alves.casssio@gmail.com>
|
6
6
|
License: MIT
|
@@ -10,13 +10,13 @@ Keywords: saxs,x-ray,edf,opencv,pyqt5,droplet
|
|
10
10
|
Requires-Python: >=3.8
|
11
11
|
Description-Content-Type: text/markdown
|
12
12
|
License-File: LICENSE
|
13
|
-
Requires-Dist: opencv-python
|
13
|
+
Requires-Dist: opencv-python-headless>=4.9
|
14
|
+
Requires-Dist: PyQt5>=5.15
|
14
15
|
Requires-Dist: numpy
|
15
16
|
Requires-Dist: matplotlib
|
16
17
|
Requires-Dist: fabio
|
17
18
|
Requires-Dist: pillow
|
18
19
|
Requires-Dist: reportlab
|
19
|
-
Requires-Dist: PyQt5
|
20
20
|
Dynamic: license-file
|
21
21
|
|
22
22
|
# Droplet Computer program
|
@@ -0,0 +1,13 @@
|
|
1
|
+
drap/__init__.py,sha256=RF05F-NDoYmyOjQ1EgdKSfsx2tTYCheTpL0AYrFmdI0,47
|
2
|
+
drap/automation.py,sha256=TvCwFeYgrKxc50kaQkV2ETGyD1RhxCCX5oCGMWo2JjU,1294
|
3
|
+
drap/gui.py,sha256=LzBBQwFiF6IcOZfBkWB6wnKsBKD-v-6Un8VoJMG7eKU,1553
|
4
|
+
drap/main.py,sha256=IBMQp932Qd6aBSeWCoQH2MQhMtmEU_yZKOsUO_U9Wmk,1201
|
5
|
+
drap/qt_adjust.py,sha256=hERZBrPBQvEi-Us5JN1bQwlmjwhnPcxjnoZsPe8V7_A,1710
|
6
|
+
drap/terminal_interface.py,sha256=vCnobMdtxKvCUaFsu0fWmChd65a-Osn41LdMtSdMdO4,2201
|
7
|
+
drap/utils.py,sha256=5IIjrGB4MBR2FX6Gdh7rCYJOZpGSFn8eTj0g3yPaHxU,66804
|
8
|
+
drap-0.0.3.post6.dist-info/licenses/LICENSE,sha256=iHcEhVN-5ifqXsDa1Ny38sIBS7SJ9-eYJQRtHiJ3QU0,1098
|
9
|
+
drap-0.0.3.post6.dist-info/METADATA,sha256=Z346eZqUd7njt0OefmE7T0EExVkexy7efCuBtges8f8,1367
|
10
|
+
drap-0.0.3.post6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
11
|
+
drap-0.0.3.post6.dist-info/entry_points.txt,sha256=8AnGrT_RVCkh26SYRqjRTbstT4BMuOO68qRFqPfPr8M,69
|
12
|
+
drap-0.0.3.post6.dist-info/top_level.txt,sha256=jYMnBoijRdvPMYoMlILxlRNbSdKUX3_uwMa7DLRE4zE,5
|
13
|
+
drap-0.0.3.post6.dist-info/RECORD,,
|
@@ -1,12 +0,0 @@
|
|
1
|
-
drap/__init__.py,sha256=RF05F-NDoYmyOjQ1EgdKSfsx2tTYCheTpL0AYrFmdI0,47
|
2
|
-
drap/automation.py,sha256=TvCwFeYgrKxc50kaQkV2ETGyD1RhxCCX5oCGMWo2JjU,1294
|
3
|
-
drap/gui.py,sha256=M4XRdqAzABBQjVIDnR3OCs387GzGo5HUIWB0ErWiZo8,1074
|
4
|
-
drap/main.py,sha256=IBMQp932Qd6aBSeWCoQH2MQhMtmEU_yZKOsUO_U9Wmk,1201
|
5
|
-
drap/terminal_interface.py,sha256=vCnobMdtxKvCUaFsu0fWmChd65a-Osn41LdMtSdMdO4,2201
|
6
|
-
drap/utils.py,sha256=5IIjrGB4MBR2FX6Gdh7rCYJOZpGSFn8eTj0g3yPaHxU,66804
|
7
|
-
drap-0.0.3.post2.dist-info/licenses/LICENSE,sha256=iHcEhVN-5ifqXsDa1Ny38sIBS7SJ9-eYJQRtHiJ3QU0,1098
|
8
|
-
drap-0.0.3.post2.dist-info/METADATA,sha256=7_3SQ7D4wduYIlz8Ci4VG3dN43BtiEVUF_1i8jNMIgk,1347
|
9
|
-
drap-0.0.3.post2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
10
|
-
drap-0.0.3.post2.dist-info/entry_points.txt,sha256=r_V3SXtWJt15QVs78jIxD7JJ41KgRtOhigYZFDcMEus,64
|
11
|
-
drap-0.0.3.post2.dist-info/top_level.txt,sha256=jYMnBoijRdvPMYoMlILxlRNbSdKUX3_uwMa7DLRE4zE,5
|
12
|
-
drap-0.0.3.post2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|