Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build scripts and desktop data #62

Merged
merged 1 commit into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions data/schema/org.mamolinux.simple-pwgen.gschema.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema id="org.mamolinux.simple-pwgen" path="/org/mamolinux/simple-pwgen/">
</schema>
</schemalist>
4 changes: 2 additions & 2 deletions generate_desktop_files
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ StartupNotify=false
NotShowIn=KDE;
"""

additionalfiles.generate(DOMAIN, PATH, "usr/share/applications/simple-pwgen.desktop", prefix, _("Simple Password Generator"), _("Very simple Python3-based GUI application to generate random password."), suffix)
additionalfiles.generate(DOMAIN, PATH, "data/simple-pwgen.desktop.in", prefix, _("Simple Password Generator"), _("Very simple Python3-based GUI application to generate random password."), suffix)

prefix = "[Desktop Entry]\n"

Expand All @@ -36,4 +36,4 @@ X-KDE-StartupNotify=false
OnlyShowIn=KDE;
"""

additionalfiles.generate(DOMAIN, PATH, "usr/share/applications/kde4/simple-pwgen.desktop", prefix, _("Simple Password Generator"), _("Very simple Python3-based GUI application to generate random password."), suffix, genericName=_("Simple Password Generator"))
additionalfiles.generate(DOMAIN, PATH, "data/kde4/simple-pwgen.desktop.in", prefix, _("Simple Password Generator"), _("Very simple Python3-based GUI application to generate random password."), suffix, genericName=_("Simple Password Generator"))
8 changes: 6 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ classifiers =
[options]
package_dir =
= src
packages = find:
packages = find_namespace:
python_requires = >=3.6
include_package_data = True
install_requires =
configobj
PyGObject
setproctitle

[options.package_data]
* = *VERSION, *ui
Expand All @@ -41,6 +45,6 @@ console_scripts =
domain=simple-pwgen
desktop_files=[("share/applications", ("data/simple-pwgen.desktop.in",
))]
schemas_files=[("share/glib-2.0/schemas",
schemas_files=[("share/glib-2.0/schemas",
("data/org.mamolinux.simple-pwgen.gschema.xml.in",))
]
38 changes: 19 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@
import distutils.command.install_data

for line in subprocess.check_output('dpkg-parsechangelog --format rfc822'.split(),
universal_newlines=True).splitlines():
header, colon, value = line.lower().partition(':')
if header == 'version':
version = value.strip()
break
universal_newlines=True).splitlines():
header, colon, value = line.lower().partition(':')
if header == 'version':
version = value.strip()
break
else:
raise RuntimeError('No version found in debian/changelog')
raise RuntimeError('No version found in debian/changelog')

with open("src/SimplePwgen/VERSION", "w") as f:
if '~' in version:
version = version.split('~')[0]
f.write("%s" % version)
if '~' in version:
version = version.split('~')[0]
f.write("%s" % version)

gschema_dir_suffix = 'share/glib-2.0/schemas'

class install_data(distutils.command.install_data.install_data):
def run(self):
# Python 3 'super' call.
super().run()
# Compile '*.gschema.xml' to update or create 'gschemas.compiled'.
info("compiling gsettings schemas")
# Use 'self.install_dir' to build the path, so that it works
# for both global and local '--user' installs.
gschema_dir = os.path.join(self.install_dir, gschema_dir_suffix)
self.spawn(["glib-compile-schemas", gschema_dir])
def run(self):
# Python 3 'super' call.
super().run()
# Compile '*.gschema.xml' to update or create 'gschemas.compiled'.
info("compiling gsettings schemas")
# Use 'self.install_dir' to build the path, so that it works
# for both global and local '--user' installs.
gschema_dir = os.path.join(self.install_dir, gschema_dir_suffix)
self.spawn(["glib-compile-schemas", gschema_dir])

data_files = [('share/applications', glob.glob("data/applications/*.desktop")),
('share/icons/hicolor/scalable/apps', glob.glob("data/icons/*")),
Expand Down
Loading