Install and locale data.json properly
offlate/window.py
5 | 5 | ||
6 | 6 | import json | |
7 | 7 | import re | |
8 | + | import os | |
8 | 9 | ||
9 | 10 | from .manager import ProjectManager | |
10 | 11 | from .spellcheckedit import SpellCheckEdit | |
… | |||
180 | 181 | self.searchfield = QLineEdit() | |
181 | 182 | predefinedbox.addWidget(self.searchfield) | |
182 | 183 | self.predefinedprojects = QListWidget() | |
183 | - | with open('offlate/data.json') as f: | |
184 | + | with open(os.path.dirname(__file__) + '/data.json') as f: | |
184 | 185 | self.projectdata = json.load(f) | |
185 | 186 | for d in self.projectdata: | |
186 | 187 | item = QListWidgetItem(d['name']) |
setup.py
12 | 12 | ] | |
13 | 13 | }, | |
14 | 14 | ||
15 | - | data_files=[('config', ['data.json']),], | |
16 | 15 | package_data={'offlate': ['data.json']}, | |
17 | 16 | ||
18 | 17 | author="Julien Lepiller", |