Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes #71

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Delphi's VCL library allows for building native Windows GUI Applications.

There is a free [eBook and styles bundle](https://embt.co/PythonGUIBundle) with 29 custom styles and 50 pages of content.

<a href="https://embt.co/PythonGUIBundle"><img alt="Download the free eBook and Python styles bundle." src="https://github.com/Embarcadero/PythonFMXBuilder/blob/main/images/30_Banner_Ebook_GGetting Started with Python GUI_830x256.jpg"></a>
<a href="https://embt.co/PythonGUIBundle"><img alt="Download the free eBook and Python styles bundle." src="https://github.com/Embarcadero/DelphiVCL4Python/blob/main/images/30_Banner_Ebook_Getting_Started_with_Python_GUI_830x256.jpg?raw=true"></a>

## Installation: ##

Expand Down
32 changes: 15 additions & 17 deletions delphivcl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import sys
import os
import sys
import platform
import importlib
import importlib.machinery
import importlib.util


def find_extension_module():
Expand All @@ -23,22 +20,23 @@ def find_extension_module():
# Win x86
lib_dir = "Win32"

if lib_dir:
lib_dir = os.path.join(os.path.dirname(
os.path.abspath(__file__)), lib_dir)
if not os.path.exists(lib_dir):
raise ValueError(
"DelphiVCL module not found. \
Try to reinstall the delphivcl package or check for support compatibility.")

for file_name in os.listdir(lib_dir):
if 'DelphiVCL' in file_name:
return os.path.join(lib_dir, os.path.basename(file_name))
raise ValueError(
"DelphiVCL module not found. Try to reinstall the delphivcl package.")
else:
if not lib_dir:
raise ValueError("Unsupported platform.")

lib_dir = os.path.join(os.path.dirname(
os.path.abspath(__file__)), lib_dir)
if not os.path.exists(lib_dir):
raise ValueError(
"DelphiVCL module not found. \
Try to reinstall the delphivcl package or check for support compatibility.")

for file_name in os.listdir(lib_dir):
if 'DelphiVCL' in file_name:
return os.path.join(lib_dir, os.path.basename(file_name))

raise ValueError(
"DelphiVCL module not found. Try to reinstall the delphivcl package.")


def new_import():
lib_path = find_extension_module()
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ python_requires = >=3
setup_requires =
setuptools_scm
cmdclass =
bdist_wheel = build.BDistWheel
bdist_wheel = build.BDistWheel

[options.package_data]
* = *.pyd, *.xml
Loading