adjust pyinstaller data paths to match importlib_resources

Not that we are looking up resources via importlib_resources for
pyinstaller builds too we need to change where the data files are
installed to to match what importlib_resources is expecting.

There was a comment in the previous resource lookup special case
complaining about the data files being at the top level so it seems this
is a change for the better anyhow.

Observed paths:

    requested file: qutebrowser.app/Contents/Frameworks/qutebrowser/config/configdata.yml
    actual file   : qutebrowser.app/Contents/Frameworks/config/configdata.yml
This commit is contained in:
toofar 2023-07-18 20:54:21 +12:00
parent f254680641
commit c0d31d399d
1 changed files with 8 additions and 8 deletions

View File

@ -64,17 +64,17 @@ INFO_PLIST_UPDATES = {
def get_data_files():
data_files = [
('../qutebrowser/html', 'html'),
('../qutebrowser/img', 'img'),
('../qutebrowser/icons', 'icons'),
('../qutebrowser/javascript', 'javascript'),
('../qutebrowser/html/doc', 'html/doc'),
('../qutebrowser/git-commit-id', '.'),
('../qutebrowser/config/configdata.yml', 'config'),
('../qutebrowser/html', 'qutebrowser/html'),
('../qutebrowser/img', 'qutebrowser/img'),
('../qutebrowser/icons', 'qutebrowser/icons'),
('../qutebrowser/javascript', 'qutebrowser/javascript'),
('../qutebrowser/html/doc', 'qutebrowser/html/doc'),
('../qutebrowser/git-commit-id', 'qutebrowser/git-commit-id'),
('../qutebrowser/config/configdata.yml', 'qutebrowser/config'),
]
if os.path.exists(os.path.join('qutebrowser', '3rdparty', 'pdfjs')):
data_files.append(('../qutebrowser/3rdparty/pdfjs', '3rdparty/pdfjs'))
data_files.append(('../qutebrowser/3rdparty/pdfjs', 'qutebrowser/3rdparty/pdfjs'))
else:
print("Warning: excluding pdfjs as it's not present!")