Skip to content

Commit

Permalink
- Fix #12
Browse files Browse the repository at this point in the history
- Fix #13
- Regress to pyinstaller
  • Loading branch information
bperian committed Apr 18, 2018
1 parent 3932dd3 commit 4e5c6f6
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 57 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
src/dist/*
src/build/*
*.log
avbin64.dll
avbin32.dll
avbin.dll
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,25 @@ To use this feature: click on a pilot in the local pilot list and then type the

## Running Vintel from Source

To run or build from the source you need the following packages installed on your machine. Most, if not all, can be installed from the command line using package management software such as "pip". Mac and Linux both come with pip installed, Windows users may need to install [cygwin](https://www.cygwin.com) to get pip. Of course all the requirements also have downoad links.

The packages requirements are defined in `setup.py` file
- The packages requirements are defined in `setup.py` file
- Pyglet may require https://github.com/AVbin/AVbin installed; this can be easily confirmed by checking the `vintel.log` file for errors regarding `avbin` not loaded.


## Building the Vintel Standalone Package

- The standalone is created using cx_freeze. All media files and the setup.py file with the configuration for cx_freeze are included in the source repo. cx_freeze can be found here: https://pypi.python.org/pypi/cx_Freeze.
- execute "python setup.py build". If everything went correctly you should get a dist folder that contains the standalone executable + required files.
- The standalone is created using pyinstaller. All media files and the setup.py file with the configuration for pyinstaller are included in the source repo.
pyinstaller can be installed through pip like this `pip install pyinstaller`
- execute "pyinstaller vintel.spec vintel.py". If everything went correctly you should get a dist folder that contains the standalone executable + required files.

## FAQ

**License?**
**License**

Vintel is licensed under the [GPLv3](http://www.gnu.org/licenses/gpl-3.0.html).

**A litte bit to big for such a little tool.**

The .exe ships with the complete environment and needed libs. You could save some space using the the source code instead.
- The .exe ships with the complete environment and needed libs. You could save some space using the the source code instead.

**What platforms are supported?**

Expand Down
10 changes: 0 additions & 10 deletions src/VINTEL.egg-info/PKG-INFO

This file was deleted.

10 changes: 0 additions & 10 deletions src/VINTEL.egg-info/SOURCES.txt

This file was deleted.

1 change: 0 additions & 1 deletion src/VINTEL.egg-info/dependency_links.txt

This file was deleted.

1 change: 0 additions & 1 deletion src/VINTEL.egg-info/top_level.txt

This file was deleted.

14 changes: 5 additions & 9 deletions src/setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from setuptools import find_packages
from cx_Freeze import setup, Executable
from setuptools import find_packages, setup, Executable




Expand All @@ -11,23 +11,19 @@

import os.path
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')



executables = [Executable("vintel.py", base=base,icon="icon.ico")]

packages = ["idna","appdirs","packaging.version","packaging.specifiers","packaging","pyglet","pyqt5","pyttsx3"]
packages = ["appdirs","packaging.version","packaging.specifiers","packaging","pyglet","pyqt5","pyttsx3"]

package_data = {'ui' : ['vi/ui/*']}

options = {
'build_exe': {
'packages':packages,
'include_files':[
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
],
'optimize':2,

},
}
Expand Down
9 changes: 2 additions & 7 deletions src/vi/PanningWebView.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@

from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEnginePage
from PyQt5.QtGui import *
from PyQt5 import QtCore
from PyQt5.QtCore import QPoint,pyqtSignal, QUrl

from PyQt5.QtCore import QEvent
from PyQt5.QtCore import QPoint,pyqtSignal, QUrl, QEvent

class WebEnginePage(QWebEnginePage):
mapLinkClicked = pyqtSignal(QUrl)
Expand All @@ -13,7 +8,7 @@ def acceptNavigationRequest(self, url, type, isMainFrame):
self.mapLinkClicked.emit(url)
return False
return True
def javaScriptConsoleMessage(self, msg, line, source):
def javaScriptConsoleMessage(self, level, msg, line, source):
# supress Javascript warnings and uncaught ReferenceError exceptions for JS functions
pass

Expand Down
2 changes: 1 addition & 1 deletion src/vi/soundmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

global gPygletAvailable


try:
import pyglet
from pyglet import media
Expand Down Expand Up @@ -143,7 +144,6 @@ def run(self):
self.playAudioFile(audioFile, False)
logging.error("SoundThread: sorry, speech not yet implemented on this platform")
elif audioFile is not None:
print(audioFile)
self.playAudioFile(audioFile, False)

def quit(self):
Expand Down
19 changes: 9 additions & 10 deletions src/vi/ui/viui.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,18 @@
import time
import six
import requests
import webbrowser



import vi.PanningWebView
import vi.version
from vi.ui.ChatEntryWidget import ChatEntryWidget
from pkg_resources import resource_string, resource_stream, resource_filename
import logging
from PyQt5 import QtGui, uic, QtCore, QtWidgets
from PyQt5.QtCore import QPoint, pyqtSignal
from PyQt5 import uic, QtCore, QtWidgets
from PyQt5.QtCore import QPoint, pyqtSignal, QTimer
from PyQt5.QtWidgets import QMessageBox, QAction, QActionGroup, QStyleOption, QStyle
from PyQt5.QtWebEngineWidgets import QWebEnginePage
from PyQt5.QtGui import *
from PyQt5.QtGui import QPainter, QIcon, QPixmap

from vi import amazon_s3, evegate
from vi import dotlan, filewatcher
Expand Down Expand Up @@ -66,16 +65,16 @@ def __init__(self, pathToLogs, pathToGameLogs, trayIcon, backGroundColor, loggin
self.setStyleSheet("QWidget { background-color: %s; }" % backGroundColor)
uic.loadUi(resource_stream(__name__, 'MainWindow.ui'), self)
self.setWindowTitle("Vintel " + vi.version.VERSION + "{dev}".format(dev="-SNAPSHOT" if vi.version.SNAPSHOT else ""))
self.taskbarIconQuiescent = QtGui.QIcon(resource_filename(__name__,'res/logo_small.png'))
self.taskbarIconWorking = QtGui.QIcon(resource_filename(__name__,'res/logo_small_green.png'))
self.taskbarIconQuiescent = QIcon(resource_filename(__name__,'res/logo_small.png'))
self.taskbarIconWorking = QIcon(resource_filename(__name__,'res/logo_small_green.png'))
self.setWindowIcon(self.taskbarIconQuiescent)
self.setFocusPolicy(QtCore.Qt.StrongFocus)

self.pathToLogs = pathToLogs
self.pathToGameLogs = pathToGameLogs
self.mapTimer = QtCore.QTimer(self)
self.mapTimer = QTimer(self)
self.mapTimer.timeout.connect(self.updateMapView)
self.clipboardTimer = QtCore.QTimer(self)
self.clipboardTimer = QTimer(self)
self.oldClipboardContent = ""
self.trayIcon = trayIcon
self.trayIcon.activated.connect(self.systemTrayActivated)
Expand Down Expand Up @@ -744,7 +743,7 @@ def showInfo(self):
infoDialog = QtWidgets.QDialog(self)
uic.loadUi(resource_stream(__name__,"Info.ui"), infoDialog)
infoDialog.versionLabel.setText(u"Version: {0}".format(vi.version.VERSION))
infoDialog.logoLabel.setPixmap(QtGui.QPixmap(resource_filename(__name__,"res/logo.png")))
infoDialog.logoLabel.setPixmap(QPixmap(resource_filename(__name__,"res/logo.png")))
infoDialog.closeButton.clicked.connect(infoDialog.accept)
infoDialog.show()

Expand Down
2 changes: 1 addition & 1 deletion src/vintel.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from vi.cache.cache import Cache
from PyQt5.QtWidgets import QApplication, QMessageBox
from PyQt5 import QtGui, QtWidgets

import PyQt5

def exceptHook(exceptionType, exceptionValue, tracebackObject):
"""
Expand Down
45 changes: 45 additions & 0 deletions src/vintel.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- mode: python -*-

import os
import ntpath
import PyQt5

block_cipher = None


a = Analysis(['vintel.py'],
pathex=['E:\\work\\Repositories\\vintel\\src',os.path.join(ntpath.dirname(PyQt5.__file__), 'Qt', 'bin')],
binaries=[('avbin.dll','.'),],
datas=[
('vi/ui/*.ui','vi/ui'),
('vi/ui/res/*','vi/ui/res')],
hiddenimports=[
'pyttsx3.drivers',
'pyttsx3.drivers.dummy',
'pyttsx3.drivers.espeak',
'pyttsx3.drivers.nsss',
'pyttsx3.drivers.sapi5',
],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='vintel',
debug=False,
strip=False,
upx=True,
console=False )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='vintel')

0 comments on commit 4e5c6f6

Please sign in to comment.