Skip to content

Commit

Permalink
fix build and add qt data
Browse files Browse the repository at this point in the history
  • Loading branch information
zdimension committed Apr 18, 2018
1 parent b2db31c commit 25b0059
Show file tree
Hide file tree
Showing 8 changed files with 8,048 additions and 8,015 deletions.
2 changes: 1 addition & 1 deletion build-rel.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
pushd src && tools\compile-gui && tools\build && popd && xcopy /y src\dist\*.exe . && gen-arc
pushd src && tools\compile-gui && python tools\build.py && popd && xcopy /y src\dist\*.exe . && gen-arc
2 changes: 1 addition & 1 deletion build-rel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
cd src

tools/compile-gui.sh
tools/build.sh
python3 tools/build.py

cd ..

Expand Down
12 changes: 10 additions & 2 deletions src/lang/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import types
from typing import List, Tuple

import sys

import os
from PyQt5.QtCore import *
from PyQt5.QtWidgets import QWidget

Expand Down Expand Up @@ -52,8 +55,13 @@ def load(lang: str):
print("error loading %s" % lang)
tr_object_qt = QTranslator()

if not tr_object_qt.load(locale, "qt", "_", QLibraryInfo.location(QLibraryInfo.TranslationsPath)):
tr_object_qt.load(locale, "qtbase", "_", QLibraryInfo.location(QLibraryInfo.TranslationsPath))
if hasattr(sys, "frozen"):
tpath = os.path.join(sys._MEIPASS, "PyQt5", "Qt", "translations")
else:
tpath = QLibraryInfo.location(QLibraryInfo.TranslationsPath)

if not tr_object_qt.load(locale, "qt", "_", tpath):
tr_object_qt.load(locale, "qtbase", "_", tpath)

QCoreApplication.installTranslator(tr_object_qt)
QCoreApplication.installTranslator(tr_object)
Expand Down
1 change: 1 addition & 0 deletions src/project.pro
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ SOURCES += \
tests\chat.py \
tests\framework.py \
tests\__init__.py \
tools\build.py \
tools\docgen.py \
tools\progen.py \
util\code.py \
Expand Down
3 changes: 0 additions & 3 deletions src/tools/build.bat

This file was deleted.

32 changes: 32 additions & 0 deletions src/tools/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from PyQt5.QtCore import QLibraryInfo
import subprocess

subprocess.call([
"pyinstaller",
"--onefile",
"--additional-hooks-dir=.",
"--icon=media/icon.ico",
"--hidden-import",
"colorsys",
"--windowed",
"--add-data",
r'%s;PyQt5\Qt\translations' % QLibraryInfo.location(QLibraryInfo.TranslationsPath),
"-n",
"turing",
"-y",
"main.py"
])

subprocess.call([
"pyinstaller",
"--onefile",
"--additional-hooks-dir=.",
"--icon=media/icon.ico",
"--hidden-import",
"pyqode.python.backend",
"-y",
"editor_backend.py"
])
5 changes: 0 additions & 5 deletions src/tools/build.sh

This file was deleted.

16,006 changes: 8,003 additions & 8,003 deletions src/turing_rc.py

Large diffs are not rendered by default.

0 comments on commit 25b0059

Please sign in to comment.