SafePDF 1.1.1__tar.gz → 1.2.1__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.
- {safepdf-1.1.1 → safepdf-1.2.1}/PKG-INFO +30 -12
- safepdf-1.1.1/SafePDF.egg-info/PKG-INFO → safepdf-1.2.1/README.md +22 -50
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/__init__.py +1 -1
- safepdf-1.2.1/SafePDF/assets/account_circle.svg +1 -0
- safepdf-1.2.1/SafePDF/assets/notifications.svg +1 -0
- safepdf-1.2.1/SafePDF/assets/settings.svg +1 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/build_installer.py +11 -1
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ctrl/safe_pdf_controller.py +150 -101
- safepdf-1.2.1/SafePDF/generate_test_keys.py +112 -0
- safepdf-1.2.1/SafePDF/licensing/__init__.py +17 -0
- safepdf-1.2.1/SafePDF/licensing/license_manager.py +245 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ops/pdf_compress.py +1 -0
- safepdf-1.2.1/SafePDF/ops/pdf_ocr.py +379 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ops/pdf_operations.py +64 -0
- safepdf-1.2.1/SafePDF/ops/watch_folder.py +95 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/safe_pdf_app.py +32 -1
- safepdf-1.2.1/SafePDF/test/test_licensing.py +180 -0
- safepdf-1.2.1/SafePDF/test/test_ocr.py +132 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/text/de/ui.json +37 -4
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/text/de/welcome_content.txt +0 -1
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/text/en/ui.json +37 -4
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/text/en/welcome_content.txt +0 -1
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/text/tr/ui.json +37 -4
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/text/tr/welcome_content.txt +0 -1
- safepdf-1.2.1/SafePDF/ui/common_elements.py +89 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ui/help_ui.py +108 -15
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ui/operation_settings.py +50 -2
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ui/safe_pdf_ui.py +739 -64
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ui/settings_ui.py +3 -1
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ui/theme.py +23 -5
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ui/update_ui.py +259 -82
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/version.txt +5 -5
- safepdf-1.1.1/README.md → safepdf-1.2.1/SafePDF.egg-info/PKG-INFO +68 -11
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF.egg-info/SOURCES.txt +9 -0
- safepdf-1.2.1/SafePDF.egg-info/requires.txt +22 -0
- safepdf-1.2.1/requirements.txt +21 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/setup.py +7 -0
- safepdf-1.1.1/SafePDF/ops/pdf_ocr.py +0 -234
- safepdf-1.1.1/SafePDF/ui/common_elements.py +0 -47
- safepdf-1.1.1/SafePDF.egg-info/requires.txt +0 -13
- safepdf-1.1.1/requirements.txt +0 -13
- {safepdf-1.1.1 → safepdf-1.2.1}/LICENSE +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/MANIFEST.in +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/back.png +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/compress.png +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/compression_err.gif +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/crown.svg +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/extract.png +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/icon.ico +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/icon.png +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/jpg2pdf.png +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/merge.png +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/next.png +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/pdf2jpg.png +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/pdf2ocr.png +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/pdf2txt.png +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/pdf2word.png +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/repair.png +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/rotate.png +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/assets/split.png +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ctrl/__init__.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ctrl/language_manager.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/logger/__init__.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/logger/logging_config.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ops/__init__.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ops/pdf2docx.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ops/pdf2jpeg.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ops/pdf_merge.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ops/pdf_rotate.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ops/pdf_split.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ops/updates.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/test/__init__.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/test/test_compression.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/test/test_pro_dialog.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/text/de/help_content.txt +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/text/de/pro_features.txt +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/text/en/help_content.txt +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/text/en/pro_features.txt +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/text/tr/help_content.txt +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/text/tr/pro_features.txt +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ui/__init__.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ui/language_elements.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF/ui/tabs_manager.py +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF.egg-info/dependency_links.txt +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF.egg-info/entry_points.txt +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/SafePDF.egg-info/top_level.txt +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/pyproject.toml +0 -0
- {safepdf-1.1.1 → safepdf-1.2.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: SafePDF
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: A safe PDF manipulation tool
|
|
5
5
|
Home-page: https://github.com/mcagriaksoy/safepdf
|
|
6
6
|
Author: Mehmet Cagri Aksoy
|
|
@@ -15,12 +15,19 @@ Requires-Python: >=3.8
|
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
17
|
Requires-Dist: PyPDF2>=3.0.0
|
|
18
|
+
Requires-Dist: PyMuPDF<2.0.0,>=1.24.0
|
|
18
19
|
Requires-Dist: Pillow>=9.0.0
|
|
19
20
|
Requires-Dist: pypdfium2>=4.0.0
|
|
20
21
|
Requires-Dist: python-docx>=0.8.11
|
|
22
|
+
Requires-Dist: pytesseract>=0.3.10
|
|
21
23
|
Requires-Dist: PyGitHub>=1.55.0
|
|
22
24
|
Requires-Dist: python-gnupg>=0.4.8
|
|
23
25
|
Requires-Dist: tkinterdnd2>=0.3.0
|
|
26
|
+
Requires-Dist: cryptography>=41.0.0
|
|
27
|
+
Requires-Dist: winrt-Windows.Media.Ocr>=3.0.0; sys_platform == "win32"
|
|
28
|
+
Requires-Dist: winrt-Windows.Graphics.Imaging>=3.0.0; sys_platform == "win32"
|
|
29
|
+
Requires-Dist: winrt-Windows.Storage.Streams>=3.0.0; sys_platform == "win32"
|
|
30
|
+
Requires-Dist: winrt-Windows.Globalization>=3.0.0; sys_platform == "win32"
|
|
24
31
|
Provides-Extra: ocr
|
|
25
32
|
Requires-Dist: pytesseract>=0.3.10; extra == "ocr"
|
|
26
33
|
Provides-Extra: full
|
|
@@ -64,29 +71,39 @@ Dynamic: summary
|
|
|
64
71
|
|
|
65
72
|

|
|
66
73
|
|
|
74
|
+
## What's New in v1.2.0
|
|
75
|
+
|
|
76
|
+
- **Offline Pro & B2B Licensing (Ed25519):** 100% offline asymmetric license verification (`pro_annual`, `pro_lifetime`, `b2b_team`, `b2b_enterprise`) with zero telemetry or network calls.
|
|
77
|
+
- **New Pro/B2B PDF Workflows:** AES-256 PDF Encryption, Text Watermarking, Unlimited OCR Scan, Batch Processing (2+ files), and background **Watch Folder** automation.
|
|
78
|
+
- **Enterprise Silent Deployment:** Automatic license discovery in user (`~/.safepdf/license.key`, `%APPDATA%\SafePDF\license.key`) and system directories (`C:\ProgramData\SafePDF\license.key`, `/etc/safepdf/license.key`), plus `--activate-key` CLI and Inno Setup `/LICENSEKEY=` support.
|
|
79
|
+
- **Refreshed Desktop UI:** 5-column operation grid, top-right Notification Center 🔔, Settings shortcut ⚙, License/B2B profile pill, Preview filename indicator & 🔍 Magnifier modal, and a local 4-step offline guide.
|
|
80
|
+
|
|
67
81
|
## Features
|
|
68
82
|
|
|
83
|
+
**Free (Unlimited Single-File Tools):**
|
|
69
84
|
- **Compress** - Reduce PDF file size with quality control
|
|
70
85
|
- **Split** - Separate PDFs by pages or custom ranges
|
|
71
|
-
- **Merge** - Combine
|
|
72
|
-
- **Convert to Images** - Export PDF pages as JPG
|
|
86
|
+
- **Merge** - Combine two PDF files into one
|
|
87
|
+
- **Convert to Images / JPG to PDF** - Export PDF pages as JPG or create PDFs from images
|
|
73
88
|
- **Rotate** - Rotate pages (90°, 180°, 270°)
|
|
74
89
|
- **Repair** - Fix corrupted PDF files
|
|
75
|
-
- **Convert to Word** - Export
|
|
76
|
-
|
|
77
|
-
|
|
90
|
+
- **Convert to Word / Extract Text / Extract Info** - Export DOCX, plain text, or PDF metadata
|
|
91
|
+
|
|
92
|
+
**Pro & B2B:**
|
|
93
|
+
- **Batch Processing** - Process multiple PDFs at once
|
|
94
|
+
- **Ultra Compression & Unlimited OCR** - Maximum quality compression and local Tesseract OCR
|
|
95
|
+
- **AES-256 Encryption & Watermark** - Password-protect or stamp PDFs locally
|
|
96
|
+
- **Watch Folder** - Auto-compress newly dropped PDFs in a monitored directory
|
|
78
97
|
|
|
79
98
|
**Interface Features:**
|
|
80
|
-
- Drag & drop file selection
|
|
81
|
-
-
|
|
99
|
+
- Drag & drop file selection with live PDF preview & 🔍 magnifier zoom
|
|
100
|
+
- In-app Notification Center & real-time progress tracking
|
|
82
101
|
- Multi-language UI (English, German, Turkish)
|
|
83
102
|
- Light and dark themes
|
|
84
103
|
- Native window frame with a compact, modern layout
|
|
85
104
|
|
|
86
105
|

|
|
87
106
|
|
|
88
|
-

|
|
89
|
-
|
|
90
107
|
## Quick Start
|
|
91
108
|
|
|
92
109
|
### Option 1: Download Executable (Recommended)
|
|
@@ -164,10 +181,11 @@ SafePDF/
|
|
|
164
181
|
│ ├── assets/ # Icons and operation graphics
|
|
165
182
|
│ ├── ctrl/ # Controllers
|
|
166
183
|
│ ├── installer/ # Inno Setup / InstallForge scripts (Windows)
|
|
184
|
+
│ ├── licensing/ # Offline Ed25519 Pro & B2B license verifier
|
|
167
185
|
│ ├── logger/ # Logging
|
|
168
|
-
│ ├── ops/ # PDF operations
|
|
186
|
+
│ ├── ops/ # PDF operations & Watch Folder service
|
|
169
187
|
│ ├── test/ # Test suite
|
|
170
|
-
│ ├── text/ # Localized UI content
|
|
188
|
+
│ ├── text/ # Localized UI content (en, de, tr)
|
|
171
189
|
│ └── ui/ # User interface
|
|
172
190
|
├── docs/ # Marketing website (safepdf.de)
|
|
173
191
|
├── img/ # README screenshots
|
|
@@ -1,42 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: SafePDF
|
|
3
|
-
Version: 1.1.1
|
|
4
|
-
Summary: A safe PDF manipulation tool
|
|
5
|
-
Home-page: https://github.com/mcagriaksoy/safepdf
|
|
6
|
-
Author: Mehmet Cagri Aksoy
|
|
7
|
-
Author-email: info@safepdf.de
|
|
8
|
-
Classifier: Development Status :: 4 - Beta
|
|
9
|
-
Classifier: Intended Audience :: End Users/Desktop
|
|
10
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
11
|
-
Classifier: Operating System :: OS Independent
|
|
12
|
-
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
14
|
-
Requires-Python: >=3.8
|
|
15
|
-
Description-Content-Type: text/markdown
|
|
16
|
-
License-File: LICENSE
|
|
17
|
-
Requires-Dist: PyPDF2>=3.0.0
|
|
18
|
-
Requires-Dist: Pillow>=9.0.0
|
|
19
|
-
Requires-Dist: pypdfium2>=4.0.0
|
|
20
|
-
Requires-Dist: python-docx>=0.8.11
|
|
21
|
-
Requires-Dist: PyGitHub>=1.55.0
|
|
22
|
-
Requires-Dist: python-gnupg>=0.4.8
|
|
23
|
-
Requires-Dist: tkinterdnd2>=0.3.0
|
|
24
|
-
Provides-Extra: ocr
|
|
25
|
-
Requires-Dist: pytesseract>=0.3.10; extra == "ocr"
|
|
26
|
-
Provides-Extra: full
|
|
27
|
-
Requires-Dist: pytesseract>=0.3.10; extra == "full"
|
|
28
|
-
Dynamic: author
|
|
29
|
-
Dynamic: author-email
|
|
30
|
-
Dynamic: classifier
|
|
31
|
-
Dynamic: description
|
|
32
|
-
Dynamic: description-content-type
|
|
33
|
-
Dynamic: home-page
|
|
34
|
-
Dynamic: license-file
|
|
35
|
-
Dynamic: provides-extra
|
|
36
|
-
Dynamic: requires-dist
|
|
37
|
-
Dynamic: requires-python
|
|
38
|
-
Dynamic: summary
|
|
39
|
-
|
|
40
1
|
# SafePDF - Privacy-First PDF Toolkit
|
|
41
2
|
|
|
42
3
|
<p align="center">
|
|
@@ -64,29 +25,39 @@ Dynamic: summary
|
|
|
64
25
|
|
|
65
26
|

|
|
66
27
|
|
|
28
|
+
## What's New in v1.2.0
|
|
29
|
+
|
|
30
|
+
- **Offline Pro & B2B Licensing (Ed25519):** 100% offline asymmetric license verification (`pro_annual`, `pro_lifetime`, `b2b_team`, `b2b_enterprise`) with zero telemetry or network calls.
|
|
31
|
+
- **New Pro/B2B PDF Workflows:** AES-256 PDF Encryption, Text Watermarking, Unlimited OCR Scan, Batch Processing (2+ files), and background **Watch Folder** automation.
|
|
32
|
+
- **Enterprise Silent Deployment:** Automatic license discovery in user (`~/.safepdf/license.key`, `%APPDATA%\SafePDF\license.key`) and system directories (`C:\ProgramData\SafePDF\license.key`, `/etc/safepdf/license.key`), plus `--activate-key` CLI and Inno Setup `/LICENSEKEY=` support.
|
|
33
|
+
- **Refreshed Desktop UI:** 5-column operation grid, top-right Notification Center 🔔, Settings shortcut ⚙, License/B2B profile pill, Preview filename indicator & 🔍 Magnifier modal, and a local 4-step offline guide.
|
|
34
|
+
|
|
67
35
|
## Features
|
|
68
36
|
|
|
37
|
+
**Free (Unlimited Single-File Tools):**
|
|
69
38
|
- **Compress** - Reduce PDF file size with quality control
|
|
70
39
|
- **Split** - Separate PDFs by pages or custom ranges
|
|
71
|
-
- **Merge** - Combine
|
|
72
|
-
- **Convert to Images** - Export PDF pages as JPG
|
|
40
|
+
- **Merge** - Combine two PDF files into one
|
|
41
|
+
- **Convert to Images / JPG to PDF** - Export PDF pages as JPG or create PDFs from images
|
|
73
42
|
- **Rotate** - Rotate pages (90°, 180°, 270°)
|
|
74
43
|
- **Repair** - Fix corrupted PDF files
|
|
75
|
-
- **Convert to Word** - Export
|
|
76
|
-
|
|
77
|
-
|
|
44
|
+
- **Convert to Word / Extract Text / Extract Info** - Export DOCX, plain text, or PDF metadata
|
|
45
|
+
|
|
46
|
+
**Pro & B2B:**
|
|
47
|
+
- **Batch Processing** - Process multiple PDFs at once
|
|
48
|
+
- **Ultra Compression & Unlimited OCR** - Maximum quality compression and local Tesseract OCR
|
|
49
|
+
- **AES-256 Encryption & Watermark** - Password-protect or stamp PDFs locally
|
|
50
|
+
- **Watch Folder** - Auto-compress newly dropped PDFs in a monitored directory
|
|
78
51
|
|
|
79
52
|
**Interface Features:**
|
|
80
|
-
- Drag & drop file selection
|
|
81
|
-
-
|
|
53
|
+
- Drag & drop file selection with live PDF preview & 🔍 magnifier zoom
|
|
54
|
+
- In-app Notification Center & real-time progress tracking
|
|
82
55
|
- Multi-language UI (English, German, Turkish)
|
|
83
56
|
- Light and dark themes
|
|
84
57
|
- Native window frame with a compact, modern layout
|
|
85
58
|
|
|
86
59
|

|
|
87
60
|
|
|
88
|
-

|
|
89
|
-
|
|
90
61
|
## Quick Start
|
|
91
62
|
|
|
92
63
|
### Option 1: Download Executable (Recommended)
|
|
@@ -164,10 +135,11 @@ SafePDF/
|
|
|
164
135
|
│ ├── assets/ # Icons and operation graphics
|
|
165
136
|
│ ├── ctrl/ # Controllers
|
|
166
137
|
│ ├── installer/ # Inno Setup / InstallForge scripts (Windows)
|
|
138
|
+
│ ├── licensing/ # Offline Ed25519 Pro & B2B license verifier
|
|
167
139
|
│ ├── logger/ # Logging
|
|
168
|
-
│ ├── ops/ # PDF operations
|
|
140
|
+
│ ├── ops/ # PDF operations & Watch Folder service
|
|
169
141
|
│ ├── test/ # Test suite
|
|
170
|
-
│ ├── text/ # Localized UI content
|
|
142
|
+
│ ├── text/ # Localized UI content (en, de, tr)
|
|
171
143
|
│ └── ui/ # User interface
|
|
172
144
|
├── docs/ # Marketing website (safepdf.de)
|
|
173
145
|
├── img/ # README screenshots
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24px" width="24px" fill="#434343"><path d="M5.85,17.1q1.27-0.98 2.85-1.54T12,15t3.3,0.56t2.85,1.54q0.88-1.03 1.36-2.33T20,12q0-3.33-2.34-5.66T12,4Q8.68,4 6.34,6.34T4,12q0,1.47 0.49,2.78q0.49,1.3 1.36,2.33Zm3.66-5.11Q8.5,10.98 8.5,9.5q0-1.48 1.01-2.49T12,6t2.49,1.01T15.5,9.5t-1.01,2.49T12,13q-1.47,0-2.49-1.01ZM12,22q-2.07,0-3.9-0.79q-1.82-0.79-3.17-2.14Q3.58,17.73 2.79,15.9T2,12Q2,9.92 2.79,8.1Q3.58,6.27 4.93,4.93Q6.28,3.57 8.1,2.79Q9.93,2 12,2t3.9,0.79t3.17,2.14q1.35,1.35 2.14,3.17Q22,9.92 22,12t-0.79,3.9t-2.14,3.17q-1.35,1.35-3.17,2.14T12,22Zm2.5-2.39q1.18-0.39 2.15-1.11q-0.98-0.73-2.15-1.11T12,17T9.5,17.39Q8.33,17.77 7.35,18.5q0.98,0.73 2.15,1.11T12,20t2.5-0.39Zm-1.42-9.04Q13.5,10.15 13.5,9.5T13.08,8.42T12,8T10.93,8.42T10.5,9.5t0.43,1.07T12,11t1.08-0.43ZM12,9.5Zm0,9Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24px" width="24px" fill="#434343"><path d="M4,19V17H6V10Q6,7.93 7.25,6.31T10.5,4.2V3.5q0-0.63 0.44-1.06T12,2t1.06,0.44T13.5,3.5V4.2q2,0.5 3.25,2.11T18,10v7h2v2H4Zm8-7.5ZM12,22q-0.82,0-1.41-0.59T10,20h4q0,0.82-0.59,1.41T12,22ZM8,17h8V10q0-1.65-1.17-2.82T12,6T9.18,7.18T8,10v7Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24px" width="24px" fill="#434343"><path d="M9.25,22l-0.4-3.2q-0.32-0.13-0.61-0.3T7.68,18.13L4.7,19.38L1.95,14.63l2.58-1.95Q4.5,12.5 4.5,12.34q0-0.16 0-0.34t0-0.34t0.03-0.34L1.95,9.38L4.7,4.63L7.68,5.88Q7.95,5.68 8.25,5.5t0.6-0.3L9.25,2h5.5l0.4,3.2q0.33,0.13 0.61,0.3t0.56,0.38L19.3,4.63l2.75,4.75l-2.57,1.95q0.02,0.18 0.02,0.34t0,0.34t0,0.34t-0.05,0.34l2.57,1.95l-2.75,4.75l-2.95-1.25q-0.27,0.2-0.57,0.38t-0.6,0.3L14.75,22H9.25ZM11,20h1.98l0.35-2.65q0.78-0.2 1.44-0.59t1.21-0.94l2.47,1.03l0.98-1.7l-2.15-1.63q0.13-0.35 0.17-0.74T17.5,12t-0.05-0.79q-0.05-0.39-0.17-0.74l2.15-1.63l-0.98-1.7L15.98,8.2q-0.55-0.57-1.21-0.96T13.33,6.65L13,4H11.03L10.68,6.65Q9.9,6.85 9.24,7.24T8.03,8.17L5.55,7.15L4.58,8.85l2.15,1.6Q6.6,10.83 6.55,11.2T6.5,12q0,0.4 0.05,0.77t0.17,0.75L4.58,15.15l0.98,1.7L8.03,15.8q0.55,0.58 1.21,0.96t1.44,0.59L11,20Zm1.05-4.5q1.45,0 2.47-1.03T15.55,12T14.53,9.52T12.05,8.5q-1.47,0-2.49,1.02T8.55,12t1.01,2.47t2.49,1.03ZM12,12Z"/></svg>
|
|
@@ -11,7 +11,7 @@ def get_version():
|
|
|
11
11
|
match = re.search(r'__version__\s*=\s*["\']([^"\']+)["\']', content)
|
|
12
12
|
if match:
|
|
13
13
|
return match.group(1)
|
|
14
|
-
return "1.
|
|
14
|
+
return "1.2.0" # fallback
|
|
15
15
|
|
|
16
16
|
def build_executable(version, safe_pdf_dir, dist_dir):
|
|
17
17
|
portable_name = f"SafePdf_v{version}_portable_win64"
|
|
@@ -20,6 +20,7 @@ def build_executable(version, safe_pdf_dir, dist_dir):
|
|
|
20
20
|
"pyinstaller",
|
|
21
21
|
"--noconfirm",
|
|
22
22
|
"--windowed",
|
|
23
|
+
"--noupx",
|
|
23
24
|
"--onefile",
|
|
24
25
|
"--name", portable_name,
|
|
25
26
|
"--icon", os.path.join(safe_pdf_dir, "assets", "icon.ico"),
|
|
@@ -33,6 +34,15 @@ def build_executable(version, safe_pdf_dir, dist_dir):
|
|
|
33
34
|
"--add-data", f"{os.path.join(safe_pdf_dir, 'keys')};keys/",
|
|
34
35
|
"--exclude-module", "scipy",
|
|
35
36
|
"--exclude-module", "networkx",
|
|
37
|
+
"--exclude-module", "matplotlib",
|
|
38
|
+
"--exclude-module", "pandas",
|
|
39
|
+
"--exclude-module", "numpy",
|
|
40
|
+
"--exclude-module", "pytest",
|
|
41
|
+
"--exclude-module", "IPython",
|
|
42
|
+
"--exclude-module", "jupyter",
|
|
43
|
+
"--exclude-module", "notebook",
|
|
44
|
+
"--exclude-module", "tkinter.test",
|
|
45
|
+
"--exclude-module", "test",
|
|
36
46
|
os.path.join(safe_pdf_dir, "safe_pdf_app.py")
|
|
37
47
|
]
|
|
38
48
|
|
|
@@ -13,13 +13,11 @@ from os import makedirs
|
|
|
13
13
|
from os import path as os_path
|
|
14
14
|
from threading import Thread
|
|
15
15
|
|
|
16
|
+
from SafePDF.licensing.license_manager import LicenseManager
|
|
16
17
|
from SafePDF.logger.logging_config import get_logger
|
|
17
|
-
try:
|
|
18
|
-
from SafePDF.safepdf_pro.license_manager import LicenseManager
|
|
19
|
-
except ImportError:
|
|
20
|
-
LicenseManager = None
|
|
21
18
|
from SafePDF.ops.pdf_operations import PDFOperations
|
|
22
19
|
from SafePDF.ops.updates import SafePDFUpdates
|
|
20
|
+
from SafePDF.ops.watch_folder import WatchFolderService
|
|
23
21
|
|
|
24
22
|
|
|
25
23
|
class SafePDFController:
|
|
@@ -41,6 +39,12 @@ class SafePDFController:
|
|
|
41
39
|
self.is_pro_activated = False
|
|
42
40
|
self.activation_key = None
|
|
43
41
|
self.pro_expiry_date = None
|
|
42
|
+
self.license_tier = None
|
|
43
|
+
self.license_org_name = None
|
|
44
|
+
self.license_seats = 1
|
|
45
|
+
self.is_lifetime_license = False
|
|
46
|
+
self.is_b2b_license = False
|
|
47
|
+
self.license_data = None
|
|
44
48
|
|
|
45
49
|
# Module logger (needed for _load_pro_status)
|
|
46
50
|
self.logger = get_logger("SafePDF.Controller")
|
|
@@ -72,6 +76,8 @@ class SafePDFController:
|
|
|
72
76
|
self.logger.error(f"Failed to initialize update subsystem: {e}", exc_info=True)
|
|
73
77
|
self.updates = None
|
|
74
78
|
|
|
79
|
+
self.watch_service = None
|
|
80
|
+
|
|
75
81
|
# Callbacks for UI updates
|
|
76
82
|
self.progress_callback = progress_callback
|
|
77
83
|
self.update_ui_callback = None
|
|
@@ -132,6 +138,9 @@ class SafePDFController:
|
|
|
132
138
|
"to_txt",
|
|
133
139
|
"to_ocr",
|
|
134
140
|
"extract_info",
|
|
141
|
+
"encrypt",
|
|
142
|
+
"watermark",
|
|
143
|
+
"watch_folder",
|
|
135
144
|
]
|
|
136
145
|
if operation in valid_operations:
|
|
137
146
|
self.selected_operation = operation
|
|
@@ -152,9 +161,20 @@ class SafePDFController:
|
|
|
152
161
|
return False, "Please select a file first!"
|
|
153
162
|
if self.selected_operation == "merge" and len(self.selected_files) < 2:
|
|
154
163
|
return False, "Merge requires at least two files. Please select more files."
|
|
164
|
+
if self.is_batch_restricted():
|
|
165
|
+
return False, "Batch processing (multiple files) requires SafePDF Pro or B2B."
|
|
155
166
|
|
|
156
167
|
return True, ""
|
|
157
168
|
|
|
169
|
+
def is_batch_restricted(self) -> bool:
|
|
170
|
+
"""Return True if current file selection is a batch operation blocked in Free mode."""
|
|
171
|
+
if self.is_pro_activated:
|
|
172
|
+
return False
|
|
173
|
+
count = len(self.selected_files)
|
|
174
|
+
if self.selected_operation == "merge":
|
|
175
|
+
return count > 2
|
|
176
|
+
return count >= 2
|
|
177
|
+
|
|
158
178
|
def prepare_output_paths(self, custom_output_path=None, use_default=True):
|
|
159
179
|
"""Optimized output path preparation"""
|
|
160
180
|
if not use_default and custom_output_path:
|
|
@@ -174,6 +194,8 @@ class SafePDFController:
|
|
|
174
194
|
"extract_info",
|
|
175
195
|
"merge",
|
|
176
196
|
"jpg_to_pdf",
|
|
197
|
+
"encrypt",
|
|
198
|
+
"watermark",
|
|
177
199
|
]:
|
|
178
200
|
base_name = os_path.splitext(self.selected_file)[0]
|
|
179
201
|
if self.selected_operation == "to_word":
|
|
@@ -190,6 +212,10 @@ class SafePDFController:
|
|
|
190
212
|
return f"{base_name}_merged.pdf", None
|
|
191
213
|
elif self.selected_operation == "jpg_to_pdf":
|
|
192
214
|
return f"{base_name}.pdf", None
|
|
215
|
+
elif self.selected_operation == "encrypt":
|
|
216
|
+
return f"{base_name}_encrypted.pdf", None
|
|
217
|
+
elif self.selected_operation == "watermark":
|
|
218
|
+
return f"{base_name}_watermarked.pdf", None
|
|
193
219
|
else:
|
|
194
220
|
return f"{base_name}_{self.selected_operation}.pdf", None
|
|
195
221
|
else:
|
|
@@ -315,6 +341,21 @@ class SafePDFController:
|
|
|
315
341
|
)
|
|
316
342
|
success, message = self.pdf_ops.extract_hidden_info(self.selected_file, output_path)
|
|
317
343
|
|
|
344
|
+
elif self.selected_operation == "encrypt":
|
|
345
|
+
if not self.is_pro_feature_enabled("encrypt"):
|
|
346
|
+
success, message = False, "AES-256 Encryption requires SafePDF Pro or B2B."
|
|
347
|
+
else:
|
|
348
|
+
password = self.operation_settings.get("encrypt_password", "")
|
|
349
|
+
success, message = self.pdf_ops.encrypt_pdf(self.selected_file, output_path, password)
|
|
350
|
+
|
|
351
|
+
elif self.selected_operation == "watermark":
|
|
352
|
+
if not self.is_pro_feature_enabled("watermark"):
|
|
353
|
+
success, message = False, "PDF Watermark requires SafePDF Pro or B2B."
|
|
354
|
+
else:
|
|
355
|
+
wm_text = self.operation_settings.get("watermark_text", "CONFIDENTIAL")
|
|
356
|
+
opacity = float(self.operation_settings.get("watermark_opacity", 0.25))
|
|
357
|
+
success, message = self.pdf_ops.watermark_pdf(self.selected_file, output_path, wm_text, opacity)
|
|
358
|
+
|
|
318
359
|
# Store current output location
|
|
319
360
|
self.current_output = output_path or output_dir if success else None
|
|
320
361
|
|
|
@@ -351,47 +392,73 @@ class SafePDFController:
|
|
|
351
392
|
# Force-clear running flag as last resort
|
|
352
393
|
self.operation_running = False
|
|
353
394
|
|
|
354
|
-
def
|
|
355
|
-
"""
|
|
395
|
+
def _apply_verified_license(self, license_data, source_path=None):
|
|
396
|
+
"""Populate controller state from verified license payload."""
|
|
397
|
+
expires_at = license_data.get("expires_at") or license_data.get("expires")
|
|
398
|
+
if expires_at is None:
|
|
399
|
+
expiry_date = None
|
|
400
|
+
else:
|
|
401
|
+
try:
|
|
402
|
+
expiry_date = datetime.strptime(expires_at, "%Y-%m-%d")
|
|
403
|
+
except ValueError:
|
|
404
|
+
expiry_date = datetime.now() + timedelta(days=365)
|
|
405
|
+
|
|
406
|
+
self.is_pro_activated = True
|
|
407
|
+
self.activation_key = source_path
|
|
408
|
+
self.pro_expiry_date = expiry_date
|
|
409
|
+
self.license_tier = license_data.get("tier")
|
|
410
|
+
self.license_org_name = license_data.get("org_name")
|
|
411
|
+
self.license_seats = license_data.get("seats", 1)
|
|
412
|
+
self.is_lifetime_license = bool(license_data.get("is_lifetime", expiry_date is None))
|
|
413
|
+
self.is_b2b_license = bool(license_data.get("is_b2b", False))
|
|
414
|
+
self.license_data = license_data
|
|
415
|
+
|
|
416
|
+
def _reset_license_state(self):
|
|
417
|
+
"""Reset all Pro/B2B license state to FREE mode."""
|
|
418
|
+
self.is_pro_activated = False
|
|
419
|
+
self.activation_key = None
|
|
420
|
+
self.pro_expiry_date = None
|
|
421
|
+
self.license_tier = None
|
|
422
|
+
self.license_org_name = None
|
|
423
|
+
self.license_seats = 1
|
|
424
|
+
self.is_lifetime_license = False
|
|
425
|
+
self.is_b2b_license = False
|
|
426
|
+
self.license_data = None
|
|
427
|
+
|
|
428
|
+
def activate_pro_features(self, license_file_or_key):
|
|
429
|
+
"""Activate Pro/B2B features from a license file path or raw license key string."""
|
|
356
430
|
if self.license_manager is None:
|
|
357
431
|
return False, "Pro licensing module is not available in this build."
|
|
358
432
|
try:
|
|
359
|
-
if not
|
|
360
|
-
return False, "
|
|
433
|
+
if not license_file_or_key or not str(license_file_or_key).strip():
|
|
434
|
+
return False, "Please provide a license file or key."
|
|
361
435
|
|
|
362
|
-
|
|
363
|
-
|
|
436
|
+
raw_input = str(license_file_or_key).strip()
|
|
437
|
+
is_file = os_path.isfile(raw_input)
|
|
364
438
|
|
|
439
|
+
success, message, license_data = self.license_manager.verify_license(raw_input)
|
|
365
440
|
if not success:
|
|
366
441
|
self.logger.warning(f"License verification failed: {message}")
|
|
367
442
|
return False, f"License verification failed: {message}"
|
|
368
443
|
|
|
369
|
-
|
|
370
|
-
config_dir = os_path.join(os_path.expanduser("~"), ".safepdf")
|
|
444
|
+
config_dir = self.license_manager.get_user_config_dir()
|
|
371
445
|
makedirs(config_dir, exist_ok=True)
|
|
446
|
+
dest_license_path = os_path.join(config_dir, "license.key")
|
|
372
447
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
448
|
+
if is_file:
|
|
449
|
+
if os_path.abspath(raw_input) != os_path.abspath(dest_license_path):
|
|
450
|
+
shutil.copy2(raw_input, dest_license_path)
|
|
451
|
+
else:
|
|
452
|
+
with open(dest_license_path, "w", encoding="utf-8") as f:
|
|
453
|
+
f.write(raw_input)
|
|
379
454
|
|
|
380
|
-
# Verify the copy was successful
|
|
381
455
|
if not os_path.exists(dest_license_path):
|
|
382
|
-
|
|
383
|
-
return False, "Failed to copy license file to config directory."
|
|
456
|
+
return False, "Failed to save license to config directory."
|
|
384
457
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
expiry_date = datetime.now() + timedelta(days=365) # Fallback to 1 year
|
|
390
|
-
|
|
391
|
-
self.is_pro_activated = True
|
|
392
|
-
self.activation_key = dest_license_path
|
|
393
|
-
self.pro_expiry_date = expiry_date
|
|
394
|
-
self.logger.info(f"✓ Pro features activated successfully: {dest_license_path}")
|
|
458
|
+
self._apply_verified_license(license_data, dest_license_path)
|
|
459
|
+
self.logger.info(
|
|
460
|
+
f"✓ License activated ({self.license_tier}, org={self.license_org_name}): {dest_license_path}"
|
|
461
|
+
)
|
|
395
462
|
return True, "Pro features activated successfully!"
|
|
396
463
|
|
|
397
464
|
except Exception as e:
|
|
@@ -399,23 +466,46 @@ class SafePDFController:
|
|
|
399
466
|
return False, f"Activation failed: {str(e)}"
|
|
400
467
|
|
|
401
468
|
def deactivate_pro_features(self):
|
|
402
|
-
"""Deactivate pro features by deleting the license file"""
|
|
469
|
+
"""Deactivate pro features by deleting the user license file."""
|
|
403
470
|
try:
|
|
404
|
-
# Delete license file from config directory
|
|
405
471
|
if self.activation_key and os_path.exists(self.activation_key):
|
|
406
472
|
os.remove(self.activation_key)
|
|
407
473
|
self.logger.info(f"License file deleted: {self.activation_key}")
|
|
408
474
|
except Exception as e:
|
|
409
475
|
self.logger.error(f"Error deleting license file: {e}")
|
|
410
476
|
|
|
411
|
-
self.
|
|
412
|
-
self.activation_key = None
|
|
413
|
-
self.pro_expiry_date = None
|
|
477
|
+
self._reset_license_state()
|
|
414
478
|
self.logger.info("Pro features deactivated")
|
|
415
479
|
|
|
416
480
|
def is_pro_feature_enabled(self, feature_name=None):
|
|
417
|
-
"""Check if
|
|
418
|
-
|
|
481
|
+
"""Check if Pro/B2B features are enabled, optionally for a specific feature."""
|
|
482
|
+
if not self.is_pro_activated:
|
|
483
|
+
return False
|
|
484
|
+
if feature_name == "b2b_deployment":
|
|
485
|
+
return self.is_b2b_license
|
|
486
|
+
return True
|
|
487
|
+
|
|
488
|
+
def start_watch_folder(self, folder_path: str, quality: str = "medium"):
|
|
489
|
+
"""Start background Watch Folder service (Pro/B2B only)."""
|
|
490
|
+
if not self.is_pro_feature_enabled("watch_folder"):
|
|
491
|
+
return False, "Watch Folder requires SafePDF Pro or B2B."
|
|
492
|
+
self.stop_watch_folder()
|
|
493
|
+
service = WatchFolderService(
|
|
494
|
+
pdf_ops=self.pdf_ops,
|
|
495
|
+
folder_path=folder_path,
|
|
496
|
+
quality=quality,
|
|
497
|
+
status_callback=self._emit_status,
|
|
498
|
+
)
|
|
499
|
+
if not service.start():
|
|
500
|
+
return False, f"Invalid folder path: {folder_path}"
|
|
501
|
+
self.watch_service = service
|
|
502
|
+
return True, f"Watching folder: {folder_path}"
|
|
503
|
+
|
|
504
|
+
def stop_watch_folder(self):
|
|
505
|
+
"""Stop any running Watch Folder service."""
|
|
506
|
+
if self.watch_service is not None:
|
|
507
|
+
self.watch_service.stop()
|
|
508
|
+
self.watch_service = None
|
|
419
509
|
|
|
420
510
|
def check_for_updates(self):
|
|
421
511
|
"""Check for available updates from GitHub Releases"""
|
|
@@ -481,83 +571,42 @@ class SafePDFController:
|
|
|
481
571
|
}
|
|
482
572
|
|
|
483
573
|
def _load_pro_status(self):
|
|
484
|
-
"""Load and verify
|
|
574
|
+
"""Load and verify Pro/B2B license on startup (user dir + system-wide silent activation)."""
|
|
485
575
|
if self.license_manager is None:
|
|
486
|
-
self.logger.info("[STARTUP] Running in FREE mode (no
|
|
487
|
-
self.
|
|
488
|
-
self.activation_key = None
|
|
489
|
-
self.pro_expiry_date = None
|
|
576
|
+
self.logger.info("[STARTUP] Running in FREE mode (no licensing module)")
|
|
577
|
+
self._reset_license_state()
|
|
490
578
|
return
|
|
491
579
|
try:
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
self.logger.info(f"[STARTUP] Checking for license files in: {config_dir}")
|
|
496
|
-
|
|
497
|
-
# Look for license files (.lic extension only)
|
|
498
|
-
license_files = []
|
|
580
|
+
search_paths = self.license_manager.get_license_search_paths()
|
|
581
|
+
existing_files = [p for p in search_paths if os_path.isfile(p)]
|
|
499
582
|
|
|
500
|
-
if
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
if ext.lower() == ".lic":
|
|
504
|
-
license_files.append(os_path.join(config_dir, filename))
|
|
505
|
-
|
|
506
|
-
if license_files:
|
|
507
|
-
self.logger.info(f"[STARTUP] Found {len(license_files)} license file(s)")
|
|
508
|
-
|
|
509
|
-
# Verify each license file found
|
|
510
|
-
for idx, license_file_path in enumerate(license_files, 1):
|
|
511
|
-
self.logger.info(
|
|
512
|
-
f"[STARTUP] Verifying license {idx}/{len(license_files)}: {os_path.basename(license_file_path)}"
|
|
513
|
-
)
|
|
514
|
-
|
|
515
|
-
# Verify the license file using license manager
|
|
583
|
+
if existing_files:
|
|
584
|
+
self.logger.info(f"[STARTUP] Checking {len(existing_files)} license candidate(s)")
|
|
585
|
+
for license_file_path in existing_files:
|
|
516
586
|
success, message, license_data = self.license_manager.verify_license(license_file_path)
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
except (ValueError, KeyError):
|
|
524
|
-
expiry_date = datetime.now() + timedelta(days=365)
|
|
525
|
-
remaining_days = 365
|
|
526
|
-
|
|
527
|
-
self.is_pro_activated = True
|
|
528
|
-
self.activation_key = license_file_path
|
|
529
|
-
self.pro_expiry_date = expiry_date
|
|
530
|
-
self.logger.info("[STARTUP] ✓ License verified successfully!")
|
|
531
|
-
self.logger.info(f"[STARTUP] ✓ User: {license_data.get('user', 'N/A')}")
|
|
532
|
-
self.logger.info(f"[STARTUP] ✓ Type: {license_data.get('type', 'N/A')}")
|
|
533
|
-
self.logger.info(f"[STARTUP] ✓ Expires: {license_data.get('expires', 'N/A')}")
|
|
534
|
-
self.logger.info(f"[STARTUP] ✓ Remaining: {remaining_days} days")
|
|
535
|
-
self.logger.info("[STARTUP] ✓ Pro features ACTIVATED")
|
|
587
|
+
if success and license_data:
|
|
588
|
+
self._apply_verified_license(license_data, license_file_path)
|
|
589
|
+
self.logger.info(
|
|
590
|
+
f"[STARTUP] License verified ({self.license_tier}, "
|
|
591
|
+
f"org={self.license_org_name or 'N/A'}, seats={self.license_seats})"
|
|
592
|
+
)
|
|
536
593
|
return
|
|
537
594
|
else:
|
|
538
|
-
self.logger.warning(f"[STARTUP]
|
|
539
|
-
self.logger.warning(f"[STARTUP] License file: {license_file_path}")
|
|
595
|
+
self.logger.warning(f"[STARTUP] License invalid ({license_file_path}): {message}")
|
|
540
596
|
else:
|
|
541
|
-
self.logger.info(
|
|
597
|
+
self.logger.info("[STARTUP] No license files found in user or system directories")
|
|
542
598
|
|
|
543
|
-
|
|
544
|
-
self.logger.info("[STARTUP] Running in FREE mode")
|
|
545
|
-
self.is_pro_activated = False
|
|
546
|
-
self.activation_key = None
|
|
547
|
-
self.pro_expiry_date = None
|
|
599
|
+
self._reset_license_state()
|
|
548
600
|
|
|
549
601
|
except Exception as e:
|
|
550
602
|
self.logger.error(f"[STARTUP] Error loading pro status: {e}", exc_info=True)
|
|
551
|
-
|
|
552
|
-
self.is_pro_activated = False
|
|
553
|
-
self.pro_expiry_date = None
|
|
554
|
-
self.activation_key = None
|
|
555
|
-
self.logger.info("[STARTUP] Running in FREE mode (error occurred)")
|
|
603
|
+
self._reset_license_state()
|
|
556
604
|
|
|
557
605
|
def get_pro_remaining_days(self):
|
|
558
|
-
"""Get remaining days for
|
|
559
|
-
if not self.is_pro_activated
|
|
606
|
+
"""Get remaining days for expiring license, or None for lifetime licenses."""
|
|
607
|
+
if not self.is_pro_activated:
|
|
560
608
|
return 0
|
|
561
|
-
|
|
609
|
+
if self.is_lifetime_license or self.pro_expiry_date is None:
|
|
610
|
+
return None
|
|
562
611
|
remaining = self.pro_expiry_date - datetime.now()
|
|
563
612
|
return max(0, remaining.days)
|