pyloid 0.20.1__tar.gz → 0.20.1.dev1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyloid
3
- Version: 0.20.1
3
+ Version: 0.20.1.dev1
4
4
  Summary:
5
5
  Author: aesthetics-of-record
6
6
  Author-email: 111675679+aesthetics-of-record@users.noreply.github.com
@@ -10,7 +10,6 @@ Classifier: Programming Language :: Python :: 3.9
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
- Requires-Dist: pyinstaller (>=6.11.1,<7.0.0)
14
13
  Requires-Dist: pyside6 (>=6.8.1,<7.0.0)
15
14
  Description-Content-Type: text/markdown
16
15
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyloid"
3
- version = "0.20.1"
3
+ version = "0.20.1-dev1"
4
4
  description = ""
5
5
  authors = ["aesthetics-of-record <111675679+aesthetics-of-record@users.noreply.github.com>"]
6
6
  readme = "README.md"
@@ -11,7 +11,6 @@ packages = [
11
11
  [tool.poetry.dependencies]
12
12
  python = ">=3.9,<3.14"
13
13
  pyside6 = "^6.8.1"
14
- pyinstaller = "^6.11.1"
15
14
 
16
15
 
17
16
  [build-system]
@@ -26,7 +26,8 @@ from PySide6.QtGui import QPixmap, QMovie
26
26
  from PySide6.QtWidgets import QSplashScreen, QLabel
27
27
  from PySide6.QtCore import QSize
28
28
  from typing import TYPE_CHECKING
29
- from PySide6.QtWebEngineCore import QWebEngineSettings
29
+ from PySide6.QtWebEngineCore import QWebEngineSettings, QWebEngineUrlRequestInterceptor
30
+ from .utils import get_production_path, is_production
30
31
 
31
32
  if TYPE_CHECKING:
32
33
  from ..pyloid import Pyloid
@@ -66,6 +67,47 @@ class CustomWebPage(QWebEnginePage):
66
67
  # """desktop media handler"""
67
68
  # self._desktop_media_handler = handler
68
69
 
70
+ class CustomInterceptor(QWebEngineUrlRequestInterceptor):
71
+ def __init__(self, index_path=None):
72
+ super().__init__()
73
+ self.index_path = get_production_path()
74
+ self.last_path = "/"
75
+
76
+ def interceptRequest(self, info):
77
+ url = info.requestUrl()
78
+ navigation_type = info.navigationType()
79
+
80
+ print("--------------------------------")
81
+
82
+ if navigation_type == QWebEnginePage.NavigationType.NavigationTypeTyped:
83
+ print("NavigationTypeTyped")
84
+
85
+ if navigation_type == QWebEnginePage.NavigationType.NavigationTypeReload:
86
+ print("NavigationTypeReload")
87
+
88
+ if navigation_type == QWebEnginePage.NavigationType.NavigationTypeBackForward:
89
+ print("NavigationTypeBackForward")
90
+
91
+ if navigation_type == QWebEnginePage.NavigationType.NavigationTypeLinkClicked:
92
+ print("NavigationTypeLinkClicked")
93
+
94
+ if navigation_type == QWebEnginePage.NavigationType.NavigationTypeFormSubmitted:
95
+ print("NavigationTypeFormSubmitted")
96
+
97
+ if navigation_type == QWebEnginePage.NavigationType.NavigationTypeTyped:
98
+ print("NavigationTypeTyped")
99
+
100
+ if navigation_type == QWebEnginePage.NavigationType.NavigationTypeOther:
101
+ print("NavigationTypeOther")
102
+
103
+ print(url)
104
+ print(url.scheme())
105
+ print(url.host())
106
+ print(url.url())
107
+ print(self.last_path)
108
+
109
+ self.last_path = url.path()
110
+
69
111
 
70
112
  class CustomWebEngineView(QWebEngineView):
71
113
  def __init__(self, parent: "BrowserWindow" = None):
@@ -391,6 +433,17 @@ class BrowserWindow:
391
433
 
392
434
  # Set F12 shortcut
393
435
  self.set_dev_tools(self.dev_tools)
436
+
437
+ # 프로필 가져오기 및 인터셉터 설정
438
+ profile = self.web_view.page().profile()
439
+
440
+ # # 기존 인터셉터가 있다면 제거
441
+ # if self.interceptor:
442
+ # profile.setUrlRequestInterceptor(None)
443
+
444
+ # 새 인터셉터 설정
445
+ self.interceptor = CustomInterceptor()
446
+ profile.setUrlRequestInterceptor(self.interceptor)
394
447
 
395
448
  def _on_load_finished(self, ok):
396
449
  """Handles the event when the web page finishes loading."""
File without changes
File without changes
File without changes
File without changes