~martijnbraam/public-inbox

thumbdrives: Migrate from libhandy-0.1 to libhandy-1 v1 PROPOSED

Stefan Hansson: 2
 Migrate from libhandy-0.1 to libhandy-1
 Migrate from xdg to xdg_base_dirs

 3 files changed, 5 insertions(+), 5 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~martijnbraam/public-inbox/patches/50638/mbox | git am -3
Learn more about email & git

[PATCH thumbdrives 1/2] Migrate from libhandy-0.1 to libhandy-1 Export this patch

libhandy-0.1 is a really old version and most apps have migrated to
libhandy-1 by now. In Alpine in particular, Thumbdrives is the only
package which still depends on libhandy-0.1. As such, migrate it to the
newer version.
---
 meson.build   | 2 +-
 src/window.py | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index a44ec0c..39a5d35 100644
--- a/meson.build
+++ b/meson.build
@@ -5,7 +5,7 @@ project('thumbdrives',
                   ],
)

dependency('libhandy-0.0', version: '>=0.0.10')
dependency('libhandy-1')

i18n = import('i18n')

diff --git a/src/window.py b/src/window.py
index 6223ccc..81d4097 100644
--- a/src/window.py
+++ b/src/window.py
@@ -4,13 +4,13 @@ from pathlib import Path

import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Handy', '0.0')
gi.require_version('Handy', '1')
from gi.repository import Gtk, Handy
import xdg.BaseDirectory

import thumbdrives.vdisk as vdisk

Handy.Column()
Handy.Clamp()

@Gtk.Template(resource_path='/nl/brixit/Thumbdrives/window.ui')
class ThumbdrivesWindow(Gtk.ApplicationWindow):
-- 
2.44.0

[PATCH thumbdrives 2/2] Migrate from xdg to xdg_base_dirs Export this patch

The xdg library has been replaced by xdg-base-dirs upstream due to a
naming conflict.

With this update the relevant function also returns a Path object by
default, so there is no need to manually wrap the return value.

See https://pypi.org/project/xdg
---
 src/window.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/window.py b/src/window.py
index 81d4097..0a4937f 100644
--- a/src/window.py
+++ b/src/window.py
@@ -6,7 +6,7 @@ import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Handy', '1')
from gi.repository import Gtk, Handy
import xdg.BaseDirectory
import xdg_base_dirs

import thumbdrives.vdisk as vdisk

@@ -37,7 +37,7 @@ class ThumbdrivesWindow(Gtk.ApplicationWindow):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        datadir = Path(xdg.BaseDirectory.xdg_data_home) / "thumbdrives"
        datadir = xdg_base_dirs.xdg_data_home() / "thumbdrives"
        if not datadir.is_dir():
            datadir.mkdir()

-- 
2.44.0