Install and locale data.json properly

Julien LepillerTue May 01 19:51:31+0200 2018

ed85795

Install and locale data.json properly

offlate/window.py

55
66
import json
77
import re
8+
import os
89
910
from .manager import ProjectManager
1011
from .spellcheckedit import SpellCheckEdit

180181
        self.searchfield = QLineEdit()
181182
        predefinedbox.addWidget(self.searchfield)
182183
        self.predefinedprojects = QListWidget()
183-
        with open('offlate/data.json') as f:
184+
        with open(os.path.dirname(__file__) + '/data.json') as f:
184185
            self.projectdata = json.load(f)
185186
            for d in self.projectdata:
186187
                item = QListWidgetItem(d['name'])

setup.py

1212
        ]
1313
    },
1414
15-
    data_files=[('config', ['data.json']),],
1615
    package_data={'offlate': ['data.json']},
1716
1817
    author="Julien Lepiller",