diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-08-27 15:50:10 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-08-27 15:50:10 +0200 |
commit | 79853595a8e4adacddaeffd42f8e4cfdf5f9a5c5 (patch) | |
tree | 1a1e7ab8a8a4b703f3237d2ed77ed9f60a2d42fd /setup.py | |
parent | 4bfbd579171d9194956376c7153f378ff6eb9d4e (diff) | |
parent | 1398450b47460ae951f69e410311677cb8fc14a7 (diff) | |
download | ayatana-settings-79853595a8e4adacddaeffd42f8e4cfdf5f9a5c5.tar.gz ayatana-settings-79853595a8e4adacddaeffd42f8e4cfdf5f9a5c5.tar.bz2 ayatana-settings-79853595a8e4adacddaeffd42f8e4cfdf5f9a5c5.zip |
Merge branch 'pr/full-rewrite'
Attributes GH PR #25: https://github.com/AyatanaIndicators/ayatana-settings/pull/25
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/setup.py b/setup.py deleted file mode 100755 index 799d8d2..0000000 --- a/setup.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -from setuptools import setup -from ayatanasettings.appdata import * -import os, polib, configparser - -m_lstDataFiles = [] - -iFile = open('data/applications/{}.desktop.in'.format(APPNAME), 'r') -oConfigParser = configparser.ConfigParser() -oConfigParser.optionxform = str -oConfigParser.read_file(iFile) -iFile.close() - -for strRoot, lstDirnames, lstFilenames in os.walk('po'): - - for strFilename in lstFilenames: - - if strFilename.endswith('.po'): - - strLocale = os.path.splitext(strFilename)[0] - - for oEntry in polib.pofile('po/' + strFilename).translated_entries(): - - if oEntry.msgid == oConfigParser['Desktop Entry']['Name']: - - oConfigParser['Desktop Entry']['Name[' + strLocale + ']'] = oEntry.msgstr - - elif oEntry.msgid == oConfigParser['Desktop Entry']['Comment']: - - oConfigParser['Desktop Entry']['Comment[' + strLocale + ']'] = oEntry.msgstr - -for sSection in oConfigParser.sections(): - - oConfigParser[sSection] = dict(sorted(oConfigParser[sSection].items(), key=lambda lParams: lParams[0])) - -oFile = open('data/applications/{}.desktop'.format(APPNAME), 'w') -oConfigParser.write(oFile, False) -oFile.close() - -for strRoot, lstDirnames, lstFilenames in os.walk('po'): - - for strFilename in lstFilenames: - - if strFilename.endswith('.po'): - - strLocale = os.path.splitext(strFilename)[0] - - if strLocale != APPNAME: - - strLocaleDir = 'data/locale/' + strLocale + '/LC_MESSAGES/' - - if not os.path.isdir(strLocaleDir): - - os.makedirs(strLocaleDir) - - polib.pofile('po/' + strFilename).save_as_mofile(strLocaleDir + APPNAME + '.mo') - -for strRoot, lstDirnames, lstFilenames in os.walk('data'): - - for strFilename in lstFilenames: - - if strFilename == '.gitkeep': - - 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])) - -m_lstDataFiles.append(('bin/', ['ayatana-settings'])) - -setup( - name = APPNAME, - version = APPVERSION, - description = APPDESCRIPTION, - long_description = APPLONGDESCRIPTION, - url = APPURL, - author = APPAUTHOR, - author_email = APPMAIL, - maintainer = APPAUTHOR, - maintainer_email = APPMAIL, - license = 'GPL-3', - classifiers = [ - 'Development Status :: 5 - Production/Stable', - 'Environment :: X11 Applications :: GTK', - 'Intended Audience :: End Users/Desktop', - 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', - 'Natural Language :: English', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python :: 3 :: Only', - 'Topic :: Desktop Environment' - ], - keywords = APPKEYWORDS, - packages = [APPNAME.replace('-', '')], - data_files = m_lstDataFiles, - install_requires = [ 'setuptools', ], - platforms = 'UNIX' - ) |