From ee119c434e35a3d3addf76b718f4828b8cf0b656 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 9 Nov 2020 10:08:59 +0100 Subject: data/applications/ayatana-settings.desktop: Don't in-file update locale strings, rather use an input and an output file. --- data/applications/ayatana-settings.desktop | 9 --------- data/applications/ayatana-settings.desktop.in | 9 +++++++++ setup.py | 10 +++++++--- 3 files changed, 16 insertions(+), 12 deletions(-) delete mode 100644 data/applications/ayatana-settings.desktop create mode 100644 data/applications/ayatana-settings.desktop.in diff --git a/data/applications/ayatana-settings.desktop b/data/applications/ayatana-settings.desktop deleted file mode 100644 index f416c39..0000000 --- a/data/applications/ayatana-settings.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Name=Indicators -Comment=Ayatana Indicators Settings -Categories=Settings;DesktopSettings;X-LXDE-Settings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings; -Exec=/usr/bin/ayatana-settings -Icon=/usr/share/icons/hicolor/scalable/apps/ayatana-settings.svg -Terminal=false -Type=Application -X-Ubuntu-Gettext-Domain=ayatana-settings diff --git a/data/applications/ayatana-settings.desktop.in b/data/applications/ayatana-settings.desktop.in new file mode 100644 index 0000000..f416c39 --- /dev/null +++ b/data/applications/ayatana-settings.desktop.in @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Indicators +Comment=Ayatana Indicators Settings +Categories=Settings;DesktopSettings;X-LXDE-Settings;X-XFCE-SettingsDialog;X-XFCE-SystemSettings; +Exec=/usr/bin/ayatana-settings +Icon=/usr/share/icons/hicolor/scalable/apps/ayatana-settings.svg +Terminal=false +Type=Application +X-Ubuntu-Gettext-Domain=ayatana-settings diff --git a/setup.py b/setup.py index 33f7f29..ca1d8a3 100755 --- a/setup.py +++ b/setup.py @@ -7,10 +7,10 @@ import os, polib, configparser m_lstDataFiles = [] -oFile = open('data/applications/{}.desktop'.format(APPNAME), 'r+') +iFile = open('data/applications/{}.desktop.in'.format(APPNAME), 'r') oConfigParser = configparser.ConfigParser() oConfigParser.optionxform = str -oConfigParser.read_file(oFile) +oConfigParser.read_file(iFile) for strRoot, lstDirnames, lstFilenames in os.walk('po'): @@ -34,7 +34,7 @@ for sSection in oConfigParser.sections(): oConfigParser[sSection] = dict(sorted(oConfigParser[sSection].items(), key=lambda lParams: lParams[0])) -oFile.seek(0) +oFile = open('data/applications/{}.desktop'.format(APPNAME), 'w') oConfigParser.write(oFile, False) oFile.truncate @@ -62,6 +62,10 @@ for strRoot, lstDirnames, lstFilenames in os.walk('data'): continue + elif strFilename == 'ayatana-settings.desktop.in': + + continue + strPath = os.path.join(strRoot, strFilename) m_lstDataFiles.append(("share/{data}".format(data=os.path.dirname(strPath).replace('data/', '')), [strPath])) -- cgit v1.2.3