Skip to content

Commit 6324713

Browse files
v25.3.10
1 parent 7642948 commit 6324713

12 files changed

Lines changed: 120 additions & 110 deletions

File tree

packages/markitdown/setup.cfg

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = openize-markitdown
3-
version = 25.3.9
3+
version = 25.3.10
44
author = Openize
55
author_email = packages@openize.com
66
description = A document converter for Word, PDF, Excel, and PowerPoint to Markdown.
@@ -37,11 +37,9 @@ where = src
3737

3838
[options.entry_points]
3939
console_scripts =
40-
markitdown = openize.markitdown.main:run_conversion
41-
post-install = openize.markitdown.post_install:ask_license
40+
markitdown = openize.markitdown.main:main
41+
42+
4243

43-
[aspose-licenses]
44-
use_aspose_license = false
45-
license_file_path = D:/aspose lic/2020/Conholdate.Total.NET.lic
4644

4745

packages/markitdown/setup.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/markitdown/src/__init__.py

Whitespace-only changes.
-171 Bytes
Binary file not shown.

packages/markitdown/src/openize/__init__.py

Whitespace-only changes.

packages/markitdown/src/openize/markitdown/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
sys.path.append(os.path.dirname(__file__))
55

6-
__version__ = "25.3.9"
6+
__version__ = "25.3.10"
77

88
from .processor import DocumentProcessor
99
from .converters import WordConverter, PDFConverter, ExcelConverter, PowerPointConverter
Binary file not shown.
Binary file not shown.
Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,9 @@
1-
import configparser
2-
3-
import configparser
41
import os
52

6-
7-
def get_config():
8-
"""Reads settings from setup.cfg if available."""
9-
config = configparser.ConfigParser()
10-
11-
# Possible locations for setup.cfg
12-
possible_paths = [
13-
os.path.join(os.getcwd(), "setup.cfg"), # Current working directory
14-
os.path.abspath(os.path.join(__file__, "../../../../setup.cfg")), # Relative to script location
15-
]
16-
17-
for path in possible_paths:
18-
if os.path.exists(path):
19-
print(f"✅ Found setup.cfg at: {path}")
20-
config.read(path)
21-
return config
22-
23-
print("❌ setup.cfg not found. Using default settings.")
24-
return config # Returns an empty config
25-
26-
273
def get_license_path():
28-
"""Fetches Aspose license path from setup.cfg or uses a default."""
29-
config = get_config()
30-
return config.get("aspose-licenses", "license_file_path", fallback="Aspose.Total.lic")
4+
"""Fetches Aspose license path from an environment variable or uses a default."""
5+
return os.getenv("ASPOSE_LICENSE_PATH", "Aspose.Total.lic")
316

327
def use_aspose_license():
338
"""Checks if Aspose license should be applied (True/False)."""
34-
config = get_config()
35-
return config.getboolean("aspose-licenses", "use_aspose_license", fallback=True) # Defaults to True
9+
return os.getenv("USE_ASPOSE_LICENSE", "true").lower() in ["1", "true", "yes"]
Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,13 @@
1-
import aspose.words as aw
2-
import aspose.cells as ac
3-
import aspose.slides as asl
41
import logging
5-
from config_loader import get_license_path, use_aspose_license
2+
import os
63

74
class LicenseManager:
8-
"""Manages the application of Aspose licenses for different file format APIs."""
9-
105
def __init__(self):
11-
"""Initialize LicenseManager with license settings."""
12-
self.license_path = get_license_path()
13-
self.use_license = use_aspose_license()
6+
self.license_path = os.getenv("ASPOSE_LICENSE_PATH") # Read from environment
147

158
def apply_license(self):
16-
"""Apply the Aspose license if enabled in setup.cfg."""
17-
if not self.use_license:
18-
logging.info("Aspose license is disabled in setup.cfg. Running in free mode.")
19-
return
20-
21-
try:
22-
license_files = [aw.License(), ac.License(), asl.License()]
23-
for license in license_files:
24-
license.set_license(self.license_path)
25-
logging.info(f"Aspose license applied from {self.license_path}")
26-
except Exception as e:
27-
logging.warning(f"Failed to apply Aspose license: {e}")
28-
29-
# Usage example:
30-
# license_manager = LicenseManager()
31-
# license_manager.apply_license()
32-
9+
if self.license_path and os.path.exists(self.license_path):
10+
logging.info(f"Applying Aspose license from: {self.license_path}")
11+
# Code to apply the license...
12+
else:
13+
logging.warning("No valid Aspose license found. Running in free mode.")

0 commit comments

Comments
 (0)