setuptools: change resources path

This commit is contained in:
Alberto Sottile 2019-03-05 12:11:48 +01:00
parent 7ae1ef8211
commit b8e4306a27
82 changed files with 30 additions and 30 deletions

View File

@ -28,7 +28,7 @@ install:
before_deploy: before_deploy:
- pip3 install dmgbuild - pip3 install dmgbuild
- mkdir dist_dmg - mkdir dist_dmg
- mv resources/macOS_readme.pdf resources/.macOS_readme.pdf - mv syncplay/resources/macOS_readme.pdf syncplay/resources/.macOS_readme.pdf
- export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')" - export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')"
- dmgbuild -s appdmg.py "Syncplay" dist_dmg/Syncplay_${VER}.dmg - dmgbuild -s appdmg.py "Syncplay" dist_dmg/Syncplay_${VER}.dmg
- python3 bintray_version.py - python3 bintray_version.py

View File

@ -35,18 +35,18 @@ endif
SHARE_PATH = ${DESTDIR}${PREFIX}/share SHARE_PATH = ${DESTDIR}${PREFIX}/share
common: common:
-mkdir -p $(LIB_PATH)/syncplay/resources/lua/intf -mkdir -p $(LIB_PATH)/syncplay/syncplay/resources/lua/intf
-mkdir -p $(APP_SHORTCUT_PATH) -mkdir -p $(APP_SHORTCUT_PATH)
-mkdir -p $(SHARE_PATH)/app-install/icons -mkdir -p $(SHARE_PATH)/app-install/icons
-mkdir -p $(SHARE_PATH)/pixmaps/ -mkdir -p $(SHARE_PATH)/pixmaps/
cp -r syncplay $(LIB_PATH)/syncplay/ cp -r syncplay $(LIB_PATH)/syncplay/
chmod 755 $(LIB_PATH)/syncplay/ chmod 755 $(LIB_PATH)/syncplay/
cp -r resources/hicolor $(SHARE_PATH)/icons/ cp -r syncplay/resources/hicolor $(SHARE_PATH)/icons/
cp -r resources/*.png $(LIB_PATH)/syncplay/resources/ cp -r syncplay/resources/*.png $(LIB_PATH)/syncplay/syncplay/resources/
cp -r resources/*.lua $(LIB_PATH)/syncplay/resources/ cp -r syncplay/resources/*.lua $(LIB_PATH)/syncplay/syncplay/resources/
cp -r resources/lua/intf/*.lua $(LIB_PATH)/syncplay/resources/lua/intf/ cp -r syncplay/resources/lua/intf/*.lua $(LIB_PATH)/syncplay/syncplay/resources/lua/intf/
cp resources/hicolor/48x48/apps/syncplay.png $(SHARE_PATH)/app-install/icons/ cp syncplay/resources/hicolor/48x48/apps/syncplay.png $(SHARE_PATH)/app-install/icons/
cp resources/hicolor/48x48/apps/syncplay.png $(SHARE_PATH)/pixmaps/ cp syncplay/resources/hicolor/48x48/apps/syncplay.png $(SHARE_PATH)/pixmaps/
u-common: u-common:
-rm -rf $(LIB_PATH)/syncplay -rm -rf $(LIB_PATH)/syncplay
@ -60,7 +60,7 @@ client:
sed -i -e '/# libpath/ a\import site\nsite.addsitedir\("${PREFIX}/lib/syncplay"\)' $(BIN_PATH)/syncplay sed -i -e '/# libpath/ a\import site\nsite.addsitedir\("${PREFIX}/lib/syncplay"\)' $(BIN_PATH)/syncplay
chmod 755 $(BIN_PATH)/syncplay chmod 755 $(BIN_PATH)/syncplay
cp syncplayClient.py $(LIB_PATH)/syncplay/ cp syncplayClient.py $(LIB_PATH)/syncplay/
cp resources/syncplay.desktop $(APP_SHORTCUT_PATH)/ cp syncplay/resources/syncplay.desktop $(APP_SHORTCUT_PATH)/
ifeq ($(SINGLE_USER),false) ifeq ($(SINGLE_USER),false)
chmod 755 $(APP_SHORTCUT_PATH)/syncplay.desktop chmod 755 $(APP_SHORTCUT_PATH)/syncplay.desktop
@ -79,7 +79,7 @@ server:
sed -i -e '/# libpath/ a\import site\nsite.addsitedir\("${PREFIX}/lib/syncplay"\)' $(BIN_PATH)/syncplay-server sed -i -e '/# libpath/ a\import site\nsite.addsitedir\("${PREFIX}/lib/syncplay"\)' $(BIN_PATH)/syncplay-server
chmod 755 $(BIN_PATH)/syncplay-server chmod 755 $(BIN_PATH)/syncplay-server
cp syncplayServer.py $(LIB_PATH)/syncplay/ cp syncplayServer.py $(LIB_PATH)/syncplay/
cp resources/syncplay-server.desktop $(APP_SHORTCUT_PATH)/ cp syncplay/resources/syncplay-server.desktop $(APP_SHORTCUT_PATH)/
ifeq ($(SINGLE_USER),false) ifeq ($(SINGLE_USER),false)
chmod 755 $(APP_SHORTCUT_PATH)/syncplay-server.desktop chmod 755 $(APP_SHORTCUT_PATH)/syncplay-server.desktop

View File

@ -1,6 +1,6 @@
include LICENSE include LICENSE
include resources/*.png include syncplay/resources/*.png
include resources/*.mng include syncplay/resources/*.mng
include resources/*.lua include syncplay/resources/*.lua
include resources/*.rtf include syncplay/resources/*.rtf
include resources/lua/intf/*.lua include syncplay/resources/lua/intf/*.lua

View File

@ -31,7 +31,7 @@ size = defines.get('size', None)
# Files to include # Files to include
files = [ files = [
application, application,
'resources/.macOS_readme.pdf' 'syncplay/resources/.macOS_readme.pdf'
] ]
# Symlinks to create # Symlinks to create
@ -78,7 +78,7 @@ icon_locations = {
# #
# Other color components may be expressed either in the range 0 to 1, or # Other color components may be expressed either in the range 0 to 1, or
# as percentages (e.g. 60% is equivalent to 0.6). # as percentages (e.g. 60% is equivalent to 0.6).
background = 'resources/macOS_dmg_bkg.tiff' background = 'syncplay/resources/macOS_dmg_bkg.tiff'
show_status_bar = False show_status_bar = False
show_tab_view = False show_tab_view = False

View File

@ -11,11 +11,11 @@ import syncplay
APP = ['syncplayClient.py'] APP = ['syncplayClient.py']
DATA_FILES = [ DATA_FILES = [
('resources', glob('resources/*.png') + glob('resources/*.rtf') + glob('resources/*.lua')), ('resources', glob('syncplay/resources/*.png') + glob('syncplay/resources/*.rtf') + glob('syncplay/resources/*.lua')),
('resources/lua/intf', glob('resources/lua/intf/*.lua')) ('resources/lua/intf', glob('syncplay/resources/lua/intf/*.lua'))
] ]
OPTIONS = { OPTIONS = {
'iconfile': 'resources/icon.icns', 'iconfile': 'syncplay/resources/icon.icns',
'extra_scripts': 'syncplayServer.py', 'extra_scripts': 'syncplayServer.py',
'includes': {'PySide2.QtCore', 'PySide2.QtUiTools', 'PySide2.QtGui', 'PySide2.QtWidgets', 'certifi', 'cffi'}, 'includes': {'PySide2.QtCore', 'PySide2.QtUiTools', 'PySide2.QtGui', 'PySide2.QtWidgets', 'certifi', 'cffi'},
'excludes': {'PySide', 'PySide.QtCore', 'PySide.QtUiTools', 'PySide.QtGui'}, 'excludes': {'PySide', 'PySide.QtCore', 'PySide.QtUiTools', 'PySide.QtGui'},

View File

@ -691,14 +691,14 @@ guiIcons = [
'resources/world_add.png', 'resources/film_add.png', 'resources/delete.png', 'resources/spinner.mng' 'resources/world_add.png', 'resources/film_add.png', 'resources/delete.png', 'resources/spinner.mng'
] ]
resources = [ resources = [
"resources/icon.ico", "syncplay/resources/icon.ico",
"resources/syncplay.png", "syncplay/resources/syncplay.png",
"resources/syncplayintf.lua", "syncplay/resources/syncplayintf.lua",
"resources/license.rtf", "syncplay/resources/license.rtf",
"resources/third-party-notices.rtf" "syncplay/resources/third-party-notices.rtf"
] ]
resources.extend(guiIcons) resources.extend(guiIcons)
intf_resources = ["resources/lua/intf/syncplay.lua"] intf_resources = ["syncplay/resources/lua/intf/syncplay.lua"]
qt_plugins = ['platforms\\qwindows.dll', 'styles\\qwindowsvistastyle.dll'] qt_plugins = ['platforms\\qwindows.dll', 'styles\\qwindowsvistastyle.dll']
@ -714,7 +714,7 @@ info = dict(
common_info, common_info,
windows=[{ windows=[{
"script": "syncplayClient.py", "script": "syncplayClient.py",
"icon_resources": [(1, "resources\\icon.ico")], "icon_resources": [(1, "syncplay\\resources\\icon.ico")],
'dest_base': "Syncplay"}, 'dest_base': "Syncplay"},
], ],
console=['syncplayServer.py'], console=['syncplayServer.py'],

View File

@ -11,7 +11,7 @@ with open("README.md", "r") as fh:
long_description = fh.read() long_description = fh.read()
setuptools.setup( setuptools.setup(
name="syncplay-distutil-test-3", name="syncplay-setuptools-test-3",
version=syncplay_version, version=syncplay_version,
author="Syncplay", author="Syncplay",
author_email="dev@syncplay.pl", author_email="dev@syncplay.pl",

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

Before

Width:  |  Height:  |  Size: 581 B

After

Width:  |  Height:  |  Size: 581 B

View File

Before

Width:  |  Height:  |  Size: 685 B

After

Width:  |  Height:  |  Size: 685 B

View File

Before

Width:  |  Height:  |  Size: 683 B

After

Width:  |  Height:  |  Size: 683 B

View File

Before

Width:  |  Height:  |  Size: 631 B

After

Width:  |  Height:  |  Size: 631 B

View File

Before

Width:  |  Height:  |  Size: 349 B

After

Width:  |  Height:  |  Size: 349 B

View File

Before

Width:  |  Height:  |  Size: 418 B

After

Width:  |  Height:  |  Size: 418 B

View File

Before

Width:  |  Height:  |  Size: 959 B

After

Width:  |  Height:  |  Size: 959 B

View File

Before

Width:  |  Height:  |  Size: 512 B

After

Width:  |  Height:  |  Size: 512 B

View File

Before

Width:  |  Height:  |  Size: 847 B

After

Width:  |  Height:  |  Size: 847 B

View File

Before

Width:  |  Height:  |  Size: 557 B

After

Width:  |  Height:  |  Size: 557 B

View File

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 721 B

View File

Before

Width:  |  Height:  |  Size: 717 B

After

Width:  |  Height:  |  Size: 717 B

View File

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 655 B

View File

Before

Width:  |  Height:  |  Size: 671 B

After

Width:  |  Height:  |  Size: 671 B

View File

Before

Width:  |  Height:  |  Size: 715 B

After

Width:  |  Height:  |  Size: 715 B

View File

Before

Width:  |  Height:  |  Size: 693 B

After

Width:  |  Height:  |  Size: 693 B

View File

Before

Width:  |  Height:  |  Size: 754 B

After

Width:  |  Height:  |  Size: 754 B

View File

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 179 B

View File

Before

Width:  |  Height:  |  Size: 666 B

After

Width:  |  Height:  |  Size: 666 B

View File

Before

Width:  |  Height:  |  Size: 750 B

After

Width:  |  Height:  |  Size: 750 B

View File

Before

Width:  |  Height:  |  Size: 739 B

After

Width:  |  Height:  |  Size: 739 B

View File

Before

Width:  |  Height:  |  Size: 855 B

After

Width:  |  Height:  |  Size: 855 B

View File

Before

Width:  |  Height:  |  Size: 1021 B

After

Width:  |  Height:  |  Size: 1021 B

View File

Before

Width:  |  Height:  |  Size: 813 B

After

Width:  |  Height:  |  Size: 813 B

View File

Before

Width:  |  Height:  |  Size: 830 B

After

Width:  |  Height:  |  Size: 830 B

View File

Before

Width:  |  Height:  |  Size: 679 B

After

Width:  |  Height:  |  Size: 679 B

View File

Before

Width:  |  Height:  |  Size: 792 B

After

Width:  |  Height:  |  Size: 792 B

View File

Before

Width:  |  Height:  |  Size: 786 B

After

Width:  |  Height:  |  Size: 786 B

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 806 B

After

Width:  |  Height:  |  Size: 806 B

View File

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 133 KiB

View File

Before

Width:  |  Height:  |  Size: 744 B

After

Width:  |  Height:  |  Size: 744 B

View File

Before

Width:  |  Height:  |  Size: 884 B

After

Width:  |  Height:  |  Size: 884 B

View File

Before

Width:  |  Height:  |  Size: 791 B

After

Width:  |  Height:  |  Size: 791 B

View File

Before

Width:  |  Height:  |  Size: 862 B

After

Width:  |  Height:  |  Size: 862 B

View File

Before

Width:  |  Height:  |  Size: 824 B

After

Width:  |  Height:  |  Size: 824 B

View File

Before

Width:  |  Height:  |  Size: 890 B

After

Width:  |  Height:  |  Size: 890 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 931 B

After

Width:  |  Height:  |  Size: 931 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 759 B

After

Width:  |  Height:  |  Size: 759 B

View File

Before

Width:  |  Height:  |  Size: 616 B

After

Width:  |  Height:  |  Size: 616 B

View File

Before

Width:  |  Height:  |  Size: 758 B

After

Width:  |  Height:  |  Size: 758 B

View File

Before

Width:  |  Height:  |  Size: 773 B

After

Width:  |  Height:  |  Size: 773 B

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Before

Width:  |  Height:  |  Size: 795 B

After

Width:  |  Height:  |  Size: 795 B

View File

Before

Width:  |  Height:  |  Size: 537 B

After

Width:  |  Height:  |  Size: 537 B

View File

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 556 B

View File

Before

Width:  |  Height:  |  Size: 327 B

After

Width:  |  Height:  |  Size: 327 B

View File

Before

Width:  |  Height:  |  Size: 743 B

After

Width:  |  Height:  |  Size: 743 B

View File

Before

Width:  |  Height:  |  Size: 834 B

After

Width:  |  Height:  |  Size: 834 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 940 B

After

Width:  |  Height:  |  Size: 940 B

View File

Before

Width:  |  Height:  |  Size: 987 B

After

Width:  |  Height:  |  Size: 987 B

View File

Before

Width:  |  Height:  |  Size: 944 B

After

Width:  |  Height:  |  Size: 944 B

View File

@ -147,7 +147,7 @@ def isASCII(s):
def findResourcePath(resourceName): def findResourcePath(resourceName):
if resourceName == "syncplay.lua": if resourceName == "syncplay.lua":
resourcePath = os.path.join(findWorkingDir(),"resources", "lua", "intf", resourceName) resourcePath = os.path.join(findWorkingDir(), "resources", "lua", "intf", resourceName)
else: else:
resourcePath = os.path.join(findWorkingDir(), "resources", resourceName) resourcePath = os.path.join(findWorkingDir(), "resources", resourceName)
return resourcePath return resourcePath
@ -156,7 +156,7 @@ def findResourcePath(resourceName):
def findWorkingDir(): def findWorkingDir():
frozen = getattr(sys, 'frozen', '') frozen = getattr(sys, 'frozen', '')
if not frozen: if not frozen:
path = os.path.dirname(os.path.dirname(__file__)) path = os.path.dirname(__file__)
elif frozen in ('dll', 'console_exe', 'windows_exe', 'macosx_app'): elif frozen in ('dll', 'console_exe', 'windows_exe', 'macosx_app'):
path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
elif frozen: # needed for PyInstaller elif frozen: # needed for PyInstaller