drap 0.0.3.post5__tar.gz → 0.0.3.post7__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: drap
3
- Version: 0.0.3.post5
3
+ Version: 0.0.3.post7
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
@@ -1,10 +1,10 @@
1
1
  [build-system]
2
- requires = ["setuptools>=61.0", "wheel"]
2
+ requires = ["setuptools>=61.0", "wheel", "build"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "drap"
7
- version = "0.0.3.post5"
7
+ version = "0.0.3.post7"
8
8
  description = "Tool for analyzing droplet size and concentration using video and EDF images"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -25,7 +25,7 @@ keywords = ["saxs", "x-ray", "edf", "opencv", "pyqt5", "droplet"]
25
25
 
26
26
  [project.scripts]
27
27
  drap = "drap.main:main"
28
- drap-gui = "drap.gui:gui"
28
+ drap-gui = "drap.gui:main_gui"
29
29
 
30
30
  [tool.setuptools]
31
31
  package-dir = {"" = "src"}
@@ -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
- import os
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
 
@@ -0,0 +1,30 @@
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
+ os.environ.pop("QT_QPA_PLATFORM_PLUGIN_PATH", None)
8
+ os.environ.pop("QT_PLUGIN_PATH", None)
9
+
10
+ if prefer_platform:
11
+ os.environ["QT_QPA_PLATFORM"] = prefer_platform
12
+ else:
13
+ os.environ.setdefault("QT_QPA_PLATFORM", "xcb") # ou 'wayland' conforme seu público
14
+
15
+
16
+ for p in list(QCoreApplication.libraryPaths()):
17
+ if "cv2/qt/plugins" in p:
18
+ QCoreApplication.removeLibraryPath(p)
19
+
20
+
21
+ pyqt_plugins = QLibraryInfo.location(QLibraryInfo.PluginsPath)
22
+ QCoreApplication.addLibraryPath(pyqt_plugins)
23
+
24
+ def assert_not_using_cv2_plugins() -> None:
25
+
26
+ for p in QCoreApplication.libraryPaths():
27
+ if "cv2/qt/plugins" in p:
28
+ raise RuntimeError(
29
+ "Error"
30
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: drap
3
- Version: 0.0.3.post5
3
+ Version: 0.0.3.post7
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
@@ -5,6 +5,7 @@ src/drap/__init__.py
5
5
  src/drap/automation.py
6
6
  src/drap/gui.py
7
7
  src/drap/main.py
8
+ src/drap/qt_adjust.py
8
9
  src/drap/terminal_interface.py
9
10
  src/drap/utils.py
10
11
  src/drap.egg-info/PKG-INFO
@@ -1,3 +1,3 @@
1
1
  [console_scripts]
2
2
  drap = drap.main:main
3
- drap-gui = drap.gui:gui
3
+ drap-gui = drap.gui:main_gui
File without changes
File without changes
File without changes
File without changes
File without changes