Fix formatting
This commit is contained in:
parent
db1cfd12f0
commit
b4d02e3686
@ -2,11 +2,12 @@
|
||||
#coding:utf8
|
||||
|
||||
|
||||
#*** TROUBLESHOOTING ***
|
||||
#1) If you get the error "ImportError: No module named zope.interface" then add an empty __init__.py file to the PYTHONDIR/Lib/site-packages/zope directory
|
||||
#2) It is expected that you will have NSIS 3 NSIS from http://nsis.sourceforge.net installed.
|
||||
# *** TROUBLESHOOTING ***
|
||||
# 1) If you get the error "ImportError: No module named zope.interface" then add an empty __init__.py file to the PYTHONDIR/Lib/site-packages/zope directory
|
||||
# 2) It is expected that you will have NSIS 3 NSIS from http://nsis.sourceforge.net installed.
|
||||
|
||||
import sys, codecs
|
||||
import codecs
|
||||
import sys
|
||||
# try:
|
||||
# if (sys.version_info.major != 2) or (sys.version_info.minor < 7):
|
||||
# raise Exception("You must build Syncplay with Python 2.7!")
|
||||
@ -14,23 +15,26 @@ import sys, codecs
|
||||
# import warnings
|
||||
# warnings.warn("You must build Syncplay with Python 2.7!")
|
||||
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
from string import Template
|
||||
|
||||
from distutils.core import setup
|
||||
try:
|
||||
from py2exe.build_exe import py2exe
|
||||
except ImportError:
|
||||
from py2exe.distutils_buildexe import py2exe
|
||||
from string import Template
|
||||
|
||||
import syncplay
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
from syncplay.messages import getMissingStrings
|
||||
|
||||
missingStrings = getMissingStrings()
|
||||
if missingStrings is not None and missingStrings is not "":
|
||||
import warnings
|
||||
warnings.warn("MISSING/UNUSED STRINGS DETECTED:\n{}".format(missingStrings))
|
||||
|
||||
|
||||
def get_nsis_path():
|
||||
bin_name = "makensis.exe"
|
||||
from winreg import HKEY_LOCAL_MACHINE as HKLM
|
||||
@ -44,6 +48,8 @@ def get_nsis_path():
|
||||
raise Exception("You must install NSIS 3 or later.")
|
||||
except WindowsError:
|
||||
return bin_name
|
||||
|
||||
|
||||
NSIS_COMPILE = get_nsis_path()
|
||||
|
||||
OUT_DIR = "syncplay_v{}".format(syncplay.version)
|
||||
@ -613,6 +619,7 @@ NSIS_SCRIPT_TEMPLATE = r"""
|
||||
SectionEnd
|
||||
"""
|
||||
|
||||
|
||||
class NSISScript(object):
|
||||
def create(self):
|
||||
fileList, totalSize = self.getBuildDirContents(OUT_DIR)
|
||||
@ -623,10 +630,10 @@ class NSISScript(object):
|
||||
if os.path.isfile(SETUP_SCRIPT_PATH):
|
||||
raise RuntimeError("Cannot create setup script, file exists at {}".format(SETUP_SCRIPT_PATH))
|
||||
contents = Template(NSIS_SCRIPT_TEMPLATE).substitute(
|
||||
version = syncplay.version,
|
||||
uninstallFiles = uninstallFiles,
|
||||
installFiles = installFiles,
|
||||
totalSize = totalSize,
|
||||
version=syncplay.version,
|
||||
uninstallFiles=uninstallFiles,
|
||||
installFiles=installFiles,
|
||||
totalSize=totalSize,
|
||||
)
|
||||
with codecs.open(SETUP_SCRIPT_PATH, "w", "utf-8-sig") as outfile:
|
||||
outfile.write(contents)
|
||||
@ -669,6 +676,7 @@ class NSISScript(object):
|
||||
delete.append('RMdir "$INSTDIR\\{}"'.format(file_))
|
||||
return "\n".join(delete)
|
||||
|
||||
|
||||
class build_installer(py2exe):
|
||||
def run(self):
|
||||
py2exe.run(self)
|
||||
@ -678,13 +686,15 @@ class build_installer(py2exe):
|
||||
script.compile()
|
||||
print("*** DONE ***")
|
||||
|
||||
guiIcons = ['resources/accept.png', 'resources/arrow_undo.png', 'resources/clock_go.png',
|
||||
|
||||
guiIcons = [
|
||||
'resources/accept.png', 'resources/arrow_undo.png', 'resources/clock_go.png',
|
||||
'resources/control_pause_blue.png', 'resources/cross.png', 'resources/door_in.png',
|
||||
'resources/folder_explore.png', 'resources/help.png', 'resources/table_refresh.png',
|
||||
'resources/timeline_marker.png','resources/control_play_blue.png',
|
||||
'resources/mpc-hc.png','resources/mpc-hc64.png','resources/mplayer.png',
|
||||
'resources/timeline_marker.png', 'resources/control_play_blue.png',
|
||||
'resources/mpc-hc.png', 'resources/mpc-hc64.png', 'resources/mplayer.png',
|
||||
'resources/mpc-be.png',
|
||||
'resources/mpv.png','resources/vlc.png', 'resources/house.png', 'resources/film_link.png',
|
||||
'resources/mpv.png', 'resources/vlc.png', 'resources/house.png', 'resources/film_link.png',
|
||||
'resources/eye.png', 'resources/comments.png', 'resources/cog_delete.png', 'resources/chevrons_right.png',
|
||||
'resources/user_key.png', 'resources/lock.png', 'resources/key_go.png', 'resources/page_white_key.png',
|
||||
'resources/tick.png', 'resources/lock_open.png', 'resources/empty_checkbox.png', 'resources/tick_checkbox.png',
|
||||
@ -699,8 +709,14 @@ guiIcons = ['resources/accept.png', 'resources/arrow_undo.png', 'resources/clock
|
||||
'resources/shield_add.png',
|
||||
'resources/email_go.png',
|
||||
'resources/world_add.png', 'resources/film_add.png', 'resources/delete.png', 'resources/spinner.mng'
|
||||
]
|
||||
resources = ["resources/icon.ico", "resources/syncplay.png", "resources/syncplayintf.lua", "resources/license.rtf", "resources/third-party-notices.rtf"]
|
||||
]
|
||||
resources = [
|
||||
"resources/icon.ico",
|
||||
"resources/syncplay.png",
|
||||
"resources/syncplayintf.lua",
|
||||
"resources/license.rtf",
|
||||
"resources/third-party-notices.rtf"
|
||||
]
|
||||
resources.extend(guiIcons)
|
||||
intf_resources = ["resources/lua/intf/syncplay.lua"]
|
||||
|
||||
@ -714,11 +730,16 @@ common_info = dict(
|
||||
|
||||
info = dict(
|
||||
common_info,
|
||||
windows=[{"script":"syncplayClient.py", "icon_resources":[(1, "resources\\icon.ico")], 'dest_base': "Syncplay"},],
|
||||
windows=[{
|
||||
"script": "syncplayClient.py",
|
||||
"icon_resources": [(1, "resources\\icon.ico")],
|
||||
'dest_base': "Syncplay"},
|
||||
],
|
||||
console=['syncplayServer.py'],
|
||||
# *** If you wish to make the Syncplay client use console mode (for --no-gui to work) then comment out the above two lines and uncomment the following line:
|
||||
# console=['syncplayServer.py', {"script":"syncplayClient.py", "icon_resources":[(1, "resources\\icon.ico")], 'dest_base': "Syncplay"}],
|
||||
options={'py2exe': {
|
||||
options={
|
||||
'py2exe': {
|
||||
'dist_dir': OUT_DIR,
|
||||
'packages': 'PySide.QtUiTools',
|
||||
'includes': 'twisted, sys, encodings, datetime, os, time, math, PySide, liburl, ast, unicodedata, _ssl',
|
||||
@ -728,9 +749,9 @@ info = dict(
|
||||
'compressed': 1
|
||||
}
|
||||
},
|
||||
data_files = [("resources", resources),("resources/lua/intf", intf_resources)],
|
||||
zipfile = "lib/libsync",
|
||||
cmdclass = {"py2exe": build_installer},
|
||||
data_files=[("resources", resources), ("resources/lua/intf", intf_resources)],
|
||||
zipfile="lib/libsync",
|
||||
cmdclass={"py2exe": build_installer},
|
||||
)
|
||||
|
||||
sys.argv.extend(['py2exe', '-p win32com ', '-i twisted.web.resource', '-i PySide.QtCore', '-i PySide.QtGui'])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user