Skip to content

Commit

Permalink
Windows: copy DLLs to avoid conflicts
Browse files Browse the repository at this point in the history
PyEnchant is distributed with older versions of DLLs that are in the PyGObject package.
  • Loading branch information
jim-easterbrook committed Oct 15, 2015
1 parent 38e3ff8 commit 8d74a6b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/photini/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

from __future__ import unicode_literals

__version__ = '15.10.0.dev364'
__version__ = '15.10.0'
_dev_no = '364'
_commit = 'c0decf3'
22 changes: 22 additions & 0 deletions src/photini/spelling.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,29 @@

from __future__ import unicode_literals

import os
import re
import shutil
import site
import sys

# avoid "dll Hell" on Windows by copying PyGObject's copies of some dlls
if sys.platform == 'win32':
enchant_dir = None
gnome_dir = None
for name in site.getsitepackages():
dir_name = os.path.join(name, 'enchant')
if os.path.isdir(dir_name):
enchant_dir = dir_name
dir_name = os.path.join(name, 'gnome')
if os.path.isdir(dir_name):
gnome_dir = dir_name
if enchant_dir and gnome_dir:
for name in (
'libenchant-1.dll', 'libglib-2.0-0.dll', 'libgmodule-2.0-0.dll'):
src = os.path.join(gnome_dir, name)
if os.path.exists(src):
shutil.copy(src, enchant_dir)

try:
import enchant
Expand Down
2 changes: 1 addition & 1 deletion src/windows/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Brief notes. (-:
pip, pkginfo, pyqt4, pywin32, setuptools, wheel, winpython
6/ Install All-In-One PyGI/PyGObject for Windows from http://sourceforge.net/projects/pygobjectwin32/files/
Add the Photini/src/windows/WinPython Python as a "portable Python" installation
Select "Base packages" and "Gexiv2" packages
Select "Base packages" and "Gexiv2" packages, then "Enchant-extra-dicts" non-GNOME library
7/ Run WinPython Command Prompt.exe to open a shell, then navigate to the Photini root directory
a/ Run "pip install -U appdirs six flickrapi keyring"
b/ Run "python setup.py build"
Expand Down

0 comments on commit 8d74a6b

Please sign in to comment.