Skip to content

Commit

Permalink
Merge branch 'master' into search-page
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbende committed Dec 3, 2023
2 parents 79427eb + 1ba3745 commit 33944e4
Show file tree
Hide file tree
Showing 19 changed files with 2,404 additions and 146 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/aur.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Install dependencies
run: |
Expand Down Expand Up @@ -62,4 +62,4 @@ jobs:
git config --global user.name "Github Actions"
cd /tmp/aur
git commit -am "Bump version to $(cat /tmp/VERSION)"
git push
git push
7 changes: 1 addition & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
image: ghcr.io/geigi/cozy-ci:main

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Lint with flake8
run: |
Expand All @@ -23,8 +23,3 @@ jobs:
- name: Test with pytest
run: |
pytest
- name: Install Cozy
run: |
meson --prefix=/usr ./build
ninja -C build install
4 changes: 2 additions & 2 deletions .github/workflows/flathub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Install dependencies
run: |
Expand Down Expand Up @@ -51,4 +51,4 @@ jobs:
run: |
cd $GITHUB_WORKSPACE/.ci
chmod +x *.sh
./flathub_wait_for_build.sh
./flathub_wait_for_build.sh
8 changes: 4 additions & 4 deletions .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: bilelmoussaoui/flatpak-github-actions:gnome-41
image: bilelmoussaoui/flatpak-github-actions:gnome-44
options: --privileged

strategy:
Expand All @@ -16,7 +16,7 @@ jobs:
# Don't fail the whole workflow if one architecture fails
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install deps
run: |
Expand All @@ -25,12 +25,12 @@ jobs:

- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
if: ${{ matrix.arch == 'aarch64' }}

- uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
- uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6
with:
bundle: Cozy.flatpak
manifest-path: com.github.geigi.cozy.json
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/opensuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Install dependencies
run: |
Expand Down Expand Up @@ -65,4 +65,4 @@ jobs:
- name: Submit package
run: |
cd X11:Pantheon:Apps/cozy
osc submitrequest -m "Update to version $(cat /tmp/VERSION)."
osc submitrequest -m "Update to version $(cat /tmp/VERSION)."
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ _The below instructions have been tested on Ubuntu 20.04_
```bash
sudo apt update
sudo apt install \
appstream-util \
appstreamcli \
cmake \
gettext \
git \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ To nedrichards for the Flatpak.
## Help me translate cozy!
Cozy is on <a href="https://www.transifex.com/geigi/cozy/">Transifex</a>, where anyone can contribute and translate. Can't find your language in the list? Let me know!

If you like this project, consider supporting me on <a href="https://www.patreon.com/bePatron?u=8147127">Patreon</a> :)
If you like this project, consider supporting me on <a href="https://www.patreon.com/geigi">Patreon</a> :)

----
[![Maintainability](https://api.codeclimate.com/v1/badges/fde8cbdff23033adaca2/maintainability)](https://codeclimate.com/github/geigi/cozy/maintainability)
8 changes: 7 additions & 1 deletion cozy/application.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import gettext
import locale
import logging
import os
Expand Down Expand Up @@ -73,9 +74,14 @@ def __init__(self, localedir: str, pkgdatadir: str):
sys.excepthook = self.handle_exception
setup_thread_excepthook()

import gettext
# We need to call `locale.*textdomain` to get the strings in UI files translated
locale.bindtextdomain('com.github.geigi.cozy', localedir)
locale.textdomain('com.github.geigi.cozy')

# But also `gettext.*textdomain`, to make `_("foo")` in Python work as well
gettext.bindtextdomain('com.github.geigi.cozy', localedir)
gettext.textdomain('com.github.geigi.cozy')

gettext.install('com.github.geigi.cozy', localedir)

def do_startup(self):
Expand Down
10 changes: 8 additions & 2 deletions cozy/control/mpris.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
log = logging.getLogger("offline_cache")


class UnsupportedProperty(Exception):
pass


class Server:
def __init__(self, con, path):
method_outargs = {}
Expand Down Expand Up @@ -84,13 +88,15 @@ def on_method_call(self,
invocation.return_value(variant)
else:
invocation.return_value(None)
except UnsupportedProperty:
invocation.return_dbus_error("{}.Error.NotSupported".format(interface_name), "Unsupported property")
except Exception as e:
log.error(e)
reporter.exception("mpris", e)
reporter.error("mpris", "MPRIS method call failed with method name: {}".format(method_name))
if out_args:
reporter.error("mpris", "MPRIS method call failed with out_args: {}".format(out_args))
invocation.return_value(None)
invocation.return_dbus_error("{}.Error.Failed".format(interface_name), "Internal exception occurred")


class MPRIS(Server):
Expand Down Expand Up @@ -270,7 +276,7 @@ def Get(self, interface, property_name):
return GLib.Variant("d", self._player.volume)
else:
reporter.warning("mpris", "MPRIS required an unknown information: {}".format(property_name))
return None
raise UnsupportedProperty

def GetAll(self, interface):
ret = {}
Expand Down
2 changes: 1 addition & 1 deletion cozy/ui/app_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, builder: Gtk.Builder):

def _get_ui_elements(self):
self._main_stack: Gtk.Stack = self._builder.get_object("main_stack")
self._navigation_view: Adw.Leaflet = self._builder.get_object("navigation_view")
self._navigation_view: Adw.NavigationView = self._builder.get_object("navigation_view")

def _connect_ui_elements(self):
self._main_stack.connect("notify::visible-child", self._update_view_model_view)
Expand Down
2 changes: 1 addition & 1 deletion cozy/ui/main_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import webbrowser
from threading import Thread

from gi.repository import Gtk, Gio, Gdk, GLib, GObject
from gi.repository import Adw, Gtk, Gio, Gdk, GLib, GObject

import cozy.control.filesystem_monitor as fs_monitor
import cozy.ext.inject as inject
Expand Down
41 changes: 24 additions & 17 deletions data/com.github.geigi.cozy.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
<provides>
<binary>com.github.geigi.cozy</binary>
</provides>
<launchable type="desktop-id">com.github.geigi.cozy.desktop</launchable>
<translation type="gettext">com.github.geigi.cozy</translation>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/geigi/cozy/img/img/screenshot1.png</image>
Expand All @@ -42,19 +44,24 @@
<image>https://raw.githubusercontent.com/geigi/cozy/img/img/screenshot4.png</image>
</screenshot>
</screenshots>
<developer_name>Julian Geywitz</developer_name>
<developer_name translatable="no">Julian Geywitz</developer_name>
<url type="homepage">https://cozy.sh</url>
<url type="bugtracker">https://github.com/geigi/cozy/issues</url>
<url type="help">https://github.com/geigi/cozy/issues</url>
<url type="help">https://matrix.to/#/#cozy:gnome.org?via=matrix.org&amp;via=gnome.org</url>
<url type="donation">https://www.patreon.com/geigi</url>
<url type="vcs-browser">https://github.com/geigi/cozy/</url>
<url type="translate">https://www.transifex.com/geigi/cozy/</url>
<update_contact>[email protected]</update_contact>
<custom>
<value key="Purism::form_factor">workstation</value>
<value key="Purism::form_factor">mobile</value>
</custom>
<releases>
<release version="1.3.0" timestamp="1701613884">
<description translatable="no">
<ul>
<li>Update to GTK 4 and libadwaita (thank you rdbende and grahamvh!)</li>
</ul>
</description>
</release>
<release version="1.2.1" timestamp="1661086733">
<description>
<description translatable="no">
<ul>
<li>Support for GTK style manager (thanks A6GibKm)</li>
<li>Use natural sorting for chapter titles</li>
Expand All @@ -63,7 +70,7 @@
</description>
</release>
<release version="1.2.0" timestamp="1641661352">
<description>
<description translatable="no">
<p>
This release features a redesigned preference window. All settings can now be searched. Good news for mobile users too: the redesign should work a lot better on mobile devices now.
</p>
Expand All @@ -78,7 +85,7 @@
</description>
</release>
<release version="1.1.3" timestamp="1640949259">
<description>
<description translatable="no">
<p>
A small bugfix release which makes Cozy more reliable.
</p>
Expand All @@ -91,7 +98,7 @@
</description>
</release>
<release version="1.1.2" timestamp="1629458444">
<description>
<description translatable="no">
<p>
A small bugfix release which makes Cozy more reliable.
</p>
Expand All @@ -107,7 +114,7 @@
</description>
</release>
<release version="1.1.1" timestamp="1629456144">
<description>
<description translatable="no">
<p>
A small bugfix release which makes Cozy more reliable.
</p>
Expand All @@ -123,7 +130,7 @@
</description>
</release>
<release version="1.1.0" timestamp="1628322225">
<description>
<description translatable="no">
<p>
This release features a redesigned library with responsiveness in mind.
</p>
Expand All @@ -140,7 +147,7 @@
</description>
</release>
<release version="1.0.4" timestamp="1627489551">
<description>
<description translatable="no">
<p>
Performance improvements for the book detail view and some bugfixes.
</p>
Expand All @@ -155,7 +162,7 @@
</description>
</release>
<release version="1.0.3" timestamp="1622826417">
<description>
<description translatable="no">
<p>
A small bugfix release which makes Cozy more reliable.
</p>
Expand All @@ -170,7 +177,7 @@
</description>
</release>
<release version="1.0.2" timestamp="1622490608">
<description>
<description translatable="no">
<p>
A small bugfix release which makes Cozy more reliable.
</p>
Expand All @@ -185,7 +192,7 @@
</description>
</release>
<release version="1.0.1" timestamp="1622363623">
<description>
<description translatable="no">
<p>
This release features chapter support for m4b files.
</p>
Expand All @@ -199,7 +206,7 @@
</description>
</release>
<release version="1.0.0" timestamp="1622358236">
<description>
<description translatable="no">
<p>
This release features chapter support for m4b files.
</p>
Expand Down
8 changes: 4 additions & 4 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ appstream_file = i18n.merge_file(
install_dir: join_paths(get_option('datadir'), 'metainfo')
)

appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
test('Validate appstream file', appstream_util,
args: ['validate', appstream_file]
appstreamcli = find_program('appstreamcli', required: false)
if appstreamcli.found()
test('Validate appstream file', appstreamcli,
args: ['validate', '--no-net', appstream_file]
)
endif
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project('com.github.geigi.cozy', version: '1.2.1')
project('com.github.geigi.cozy', version: '1.3.0')

python = import('python3')
i18n = import('i18n')
Expand Down
Loading

0 comments on commit 33944e4

Please sign in to comment.