Skip to content

Commit

Permalink
Update build scripts and desktop data
Browse files Browse the repository at this point in the history
- Update python build scripts
- Update schema files
- Update desktop file creator script
  • Loading branch information
hsbasu committed Jan 1, 2024
1 parent aac6898 commit eb8d667
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 23 deletions.
File renamed without changes.
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

0 comments on commit eb8d667

Please sign in to comment.