diff --git a/DemonEditor.desktop b/DemonEditor.desktop deleted file mode 100755 index a07d89ea..00000000 --- a/DemonEditor.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Version=1.0 -Name=DemonEditor -Comment=Channels and satellites list editor for Enigma2 -Comment[ru]=Редактор списка каналов и спутников для Enigma2 -Icon=accessories-text-editor -Exec=bash -c 'cd $(dirname %k) && ./start.py' -Terminal=false -Type=Application -Categories=Utility;Application; -StartupNotify=false diff --git a/DemonEditor.spec b/DemonEditor.spec new file mode 100644 index 00000000..79d20d8a --- /dev/null +++ b/DemonEditor.spec @@ -0,0 +1,61 @@ +import os +import distutils.util + +EXE_NAME = 'start.py' +DIR_PATH = os.getcwd() +COMPILING_PLATFORM = distutils.util.get_platform() +PATH_EXE = [os.path.join(DIR_PATH, EXE_NAME)] +STRIP = True + +block_cipher = None + +ui_files = [('app/ui/*.glade', 'ui'), + ('app/ui/*.css', 'ui'), + ('app/ui/*.ui', 'ui') + ] + +a = Analysis([EXE_NAME], + pathex=PATH_EXE, + binaries=None, + datas=ui_files, + hiddenimports=[], + 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='DemonEditor', + debug=False, + strip=STRIP, + upx=True, + console=False) + +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=STRIP, + upx=True, + name='DemonEditor') + +app = BUNDLE(coll, + name='DemonEditor.app', + icon='icon.icns', + bundle_identifier=None, + info_plist={ + 'NSPrincipalClass': 'NSApplication', + 'CFBundleName': 'DemonEditor', + 'CFBundleDisplayName': 'DemonEditor', + 'CFBundleGetInfoString': "Enigma2 channel and satellites editor", + 'CFBundleShortVersionString': "0.4.7 Pre-alpha", + 'NSHumanReadableCopyright': u"Copyright © 2019, Dmitriy Yefremov" + }) diff --git a/app/properties.py b/app/properties.py index ebf0b12f..370a9a82 100644 --- a/app/properties.py +++ b/app/properties.py @@ -5,7 +5,7 @@ from pathlib import Path CONFIG_PATH = str(Path.home()) + "/.config/demon-editor/" CONFIG_FILE = CONFIG_PATH + "config.json" -DATA_PATH = "data/" +DATA_PATH = os.path.expanduser("~") + "/data/" class Profile(Enum): diff --git a/app/ui/uicommons.py b/app/ui/uicommons.py index 56ae3d52..908478c3 100644 --- a/app/ui/uicommons.py +++ b/app/ui/uicommons.py @@ -7,15 +7,14 @@ gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk # path to *.glade files -UI_RESOURCES_PATH = "app/ui/" if os.path.exists("app/ui/") else "/usr/share/demoneditor/app/ui/" +UI_RESOURCES_PATH = "app/ui/" if os.path.exists("app/ui/") else "ui/" IS_GNOME_SESSION = int(bool(os.environ.get("GNOME_DESKTOP_SESSION_ID"))) - # translation TEXT_DOMAIN = "demon-editor" if UI_RESOURCES_PATH == "app/ui/": LANG_DIR = UI_RESOURCES_PATH + "lang" - # locale.bindtextdomain(TEXT_DOMAIN, UI_RESOURCES_PATH + "lang") +# locale.bindtextdomain(TEXT_DOMAIN, UI_RESOURCES_PATH + "lang") theme = Gtk.IconTheme.get_default() _IMAGE_MISSING = theme.load_icon("image-missing", 16, 0) if theme.lookup_icon("image-missing", 16, 0) else None diff --git a/build-deb.sh b/build-deb.sh deleted file mode 100755 index 1bae0104..00000000 --- a/build-deb.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -VER="0.4.7_Pre-alpha" -B_PATH="dist/DemonEditor" -DEB_PATH="$B_PATH/usr/share/demoneditor" - -mkdir -p $B_PATH -cp -TRv deb $B_PATH -rsync --exclude=app/ui/lang -arv app $DEB_PATH -cp -Rv start.py $DEB_PATH - -cd dist -fakeroot dpkg-deb --build DemonEditor -mv DemonEditor.deb DemonEditor_$VER.deb - -rm -R DemonEditor - - - - diff --git a/deb/usr/share/locale/de/LC_MESSAGES/demon-editor.mo b/deb/usr/share/locale/de/LC_MESSAGES/demon-editor.mo deleted file mode 100644 index 82d95096..00000000 Binary files a/deb/usr/share/locale/de/LC_MESSAGES/demon-editor.mo and /dev/null differ diff --git a/icon.icns b/icon.icns new file mode 100644 index 00000000..8c6a900d Binary files /dev/null and b/icon.icns differ diff --git a/start.py b/start.py index 4b2bdf8c..ca9f522d 100755 --- a/start.py +++ b/start.py @@ -1,4 +1,9 @@ #!/usr/bin/env python3 +import os + +# For launching from the bundle. +if os.getcwd() == "/": + os.chdir("/Applications/DemonEditor.app/Contents/MacOS/") try: from Cocoa import NSBundle