Move data collection to mcedit2.spec. Remove hook-mcedit2.py.
Specfile update for PyInstaller 3
This commit is contained in:
parent
4cdf7cffc8
commit
e5b9c67d31
@ -1,32 +0,0 @@
|
||||
"""
|
||||
hook-mcedit2.py
|
||||
Hook for pyinstaller to collect MCEdit's data files
|
||||
"""
|
||||
from __future__ import absolute_import, division, print_function#, unicode_literals
|
||||
import glob
|
||||
import logging
|
||||
import os
|
||||
from PyInstaller.hooks.hookutils import collect_data_files
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
# Remove cython and coverage byproducts
|
||||
def ext_filter(source):
|
||||
base = os.path.basename(source)
|
||||
if base == '.coverage':
|
||||
return False
|
||||
name, ext = os.path.splitext(base)
|
||||
return ext not in ('.c', '.html')
|
||||
|
||||
mceditlib_datas = collect_data_files('mceditlib')
|
||||
mceditlib_datas = [(source, dest)
|
||||
for source, dest in mceditlib_datas
|
||||
if ext_filter(source)]
|
||||
|
||||
mcedit2_datas = collect_data_files('mcedit2')
|
||||
mcedit2_datas = [(source, dest)
|
||||
for source, dest in mcedit2_datas
|
||||
if ext_filter(source)]
|
||||
|
||||
datas = mceditlib_datas + mcedit2_datas
|
||||
|
22
mcedit2.spec
22
mcedit2.spec
@ -6,6 +6,8 @@ import fnmatch
|
||||
import os
|
||||
import itertools
|
||||
|
||||
from PyInstaller.utils.hooks.hookutils import collect_data_files
|
||||
|
||||
# Grab every .py file under src/mcedit2 and src/mceditlib because some modules are made
|
||||
# available for plugins and not directly used by MCEdit.
|
||||
everything = []
|
||||
@ -45,6 +47,26 @@ for d in a.datas:
|
||||
a.datas.remove(d)
|
||||
break
|
||||
|
||||
def ext_filter(source):
|
||||
base = os.path.basename(source)
|
||||
if base == '.coverage':
|
||||
return False
|
||||
name, ext = os.path.splitext(base)
|
||||
return ext not in ('.c', '.html')
|
||||
|
||||
mceditlib_datas = collect_data_files('mceditlib')
|
||||
mceditlib_datas = [(os.path.join(dest, os.path.basename(source)), source, 'DATA')
|
||||
for source, dest in mceditlib_datas
|
||||
if ext_filter(source)]
|
||||
|
||||
mcedit2_datas = collect_data_files('mcedit2')
|
||||
mcedit2_datas = [(os.path.join(dest, os.path.basename(source)), source, 'DATA')
|
||||
for source, dest in mcedit2_datas
|
||||
if ext_filter(source)]
|
||||
|
||||
a.datas.extend(mcedit2_datas)
|
||||
a.datas.extend(mceditlib_datas)
|
||||
|
||||
a.binaries = a.binaries - TOC([
|
||||
('sqlite3.dll', '', ''),
|
||||
('_sqlite3', '', ''),
|
||||
|
Reference in New Issue
Block a user