Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
GNOME:STABLE:45
gnome-music
0002-gnome-music-revert-from-future-import-anno...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0002-gnome-music-revert-from-future-import-annotations.patch of Package gnome-music
From 3b3b74ef0778308ad99a49def4f3f4491d870ed3 Mon Sep 17 00:00:00 2001 From: Yifan J <yifanj2007@gmail.com> Date: Sat, 20 Nov 2021 17:55:48 +0800 Subject: [PATCH] Revert from future import annotations --- gnomemusic/coremodel.py | 3 +-- gnomemusic/coresong.py | 3 +-- gnomemusic/grilowrappers/grltrackerwrapper.py | 3 +-- gnomemusic/gstplayer.py | 3 +-- gnomemusic/views/searchview.py | 5 ++--- gnomemusic/widgets/albumwidget.py | 13 ++++++------- gnomemusic/widgets/artistalbumswidget.py | 3 +-- gnomemusic/widgets/disclistboxwidget.py | 5 ++--- gnomemusic/widgets/playlistswidget.py | 7 +++---- gnomemusic/widgets/songwidgetmenu.py | 5 ++--- 10 files changed, 20 insertions(+), 30 deletions(-) Index: gnome-music-45.1/gnomemusic/coremodel.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/coremodel.py +++ gnome-music-45.1/gnomemusic/coremodel.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from typing import Any, Optional, Union import typing @@ -75,7 +74,7 @@ class CoreModel(GObject.GObject): _recent_size = 21 - def __init__(self, application: Application) -> None: + def __init__(self, application: 'Application') -> None: """Initiate the CoreModel object :param Application application: The Application instance to use @@ -168,7 +167,7 @@ class CoreModel(GObject.GObject): user_playlists_sorter.set_sort_func(self._playlists_sort) self._user_playlists_model_sort.set_sorter(user_playlists_sorter) - self._search: Search = application.props.search + self._search: 'Search' = application.props.search self._songs_model.connect( "items-changed", self._on_songs_items_changed) Index: gnome-music-45.1/gnomemusic/coresong.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/coresong.py +++ gnome-music-45.1/gnomemusic/coresong.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from enum import IntEnum from random import randint from typing import Optional @@ -67,7 +66,7 @@ class CoreSong(GObject.GObject): FAILED: int = 2 SUCCEEDED: int = 3 - def __init__(self, application: Application, media: Grl.Media) -> None: + def __init__(self, application: 'Application', media: Grl.Media) -> None: """Initiate the CoreSong object :param Application application: The application object @@ -75,9 +74,9 @@ class CoreSong(GObject.GObject): """ super().__init__() - self._application: Application = application - self._coregrilo: CoreGrilo = application.props.coregrilo - self._coreselection: CoreSelection = application.props.coreselection + self._application: 'Application' = application + self._coregrilo: 'CoreGrilo' = application.props.coregrilo + self._coreselection: 'CoreSelection' = application.props.coreselection self._favorite: bool = False self._selected: bool = False self._thumbnail: Optional[str] = None Index: gnome-music-45.1/gnomemusic/grilowrappers/grltrackerwrapper.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/grilowrappers/grltrackerwrapper.py +++ gnome-music-45.1/gnomemusic/grilowrappers/grltrackerwrapper.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from typing import Callable, Dict, List, Optional import typing @@ -95,7 +94,7 @@ class GrlTrackerWrapper(GObject.GObject) ] def __init__( - self, source: Grl.Source, application: Application, + self, source: Grl.Source, application: 'Application', tracker_wrapper: TrackerWrapper) -> None: """Initialize the Tracker wrapper @@ -106,9 +105,9 @@ class GrlTrackerWrapper(GObject.GObject) super().__init__() self._async_queue = AsyncQueue("GrlTrackerWrapper") - self._application: Application = application - cm: CoreModel = application.props.coremodel - self._log: MusicLogger = application.props.log + self._application: 'Application' = application + cm: 'CoreModel' = application.props.coremodel + self._log: 'MusicLogger' = application.props.log self._songs_model = Gio.ListStore.new(CoreSong) cm.props.songs_proxy.append(self._songs_model) self._source: Optional[Grl.Source] = None @@ -123,8 +122,8 @@ class GrlTrackerWrapper(GObject.GObject) Grl.SourceChangeType, List[str]] = {} self._content_changed_timeout: int = 0 self._tracker_playlists: Optional[GrlTrackerPlaylists] = None - self._tracker_wrapper: TrackerWrapper = tracker_wrapper - self._notificationmanager: NotificationManager = ( + self._tracker_wrapper: 'TrackerWrapper' = tracker_wrapper + self._notificationmanager: 'NotificationManager' = ( application.props.notificationmanager) self._songs_search: Gtk.FilterListModel = Gtk.FilterListModel.new( @@ -1185,7 +1184,7 @@ class GrlTrackerWrapper(GObject.GObject) return query - def get_song_art(self, coresong: CoreSong, storeart: StoreArt) -> None: + def get_song_art(self, coresong: CoreSong, storeart: 'StoreArt') -> None: """Retrieve song art for the given CoreSong Since MediaArt does not really support per-song art this @@ -1227,7 +1226,7 @@ class GrlTrackerWrapper(GObject.GObject) query, self._METADATA_THUMBNAIL_KEYS, self._full_options_lprio, art_retrieved_cb) - def get_album_art(self, corealbum: CoreAlbum, storeart: StoreArt) -> None: + def get_album_art(self, corealbum: CoreAlbum, storeart: 'StoreArt') -> None: """Retrieve album art for the given CoreAlbum :param CoreAlbum corealbum: CoreAlbum to get art for @@ -1259,7 +1258,7 @@ class GrlTrackerWrapper(GObject.GObject) art_retrieved_cb) def get_artist_art( - self, coreartist: CoreArtist, storeart: StoreArt) -> None: + self, coreartist: CoreArtist, storeart: 'StoreArt') -> None: """Retrieve artist art for the given CoreArtist This retrieves art through Grilo online services only. Index: gnome-music-45.1/gnomemusic/gstplayer.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/gstplayer.py +++ gnome-music-45.1/gnomemusic/gstplayer.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from typing import List, Optional from enum import IntEnum import typing @@ -59,7 +58,7 @@ class GstPlayer(GObject.GObject): "stream-start": (GObject.SignalFlags.RUN_FIRST, None, ()) } - def __init__(self, application: Application) -> None: + def __init__(self, application: 'Application') -> None: """Initialize the GStreamer player :param Application application: Application object Index: gnome-music-45.1/gnomemusic/views/searchview.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/views/searchview.py +++ gnome-music-45.1/gnomemusic/views/searchview.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from enum import IntEnum from gettext import gettext as _ from typing import Optional @@ -83,7 +82,7 @@ class SearchView(Gtk.Stack): _view_all_albums = Gtk.Template.Child() _view_all_artists = Gtk.Template.Child() - def __init__(self, application: Application) -> None: + def __init__(self, application: 'Application') -> None: """Initialize SearchView :param GtkApplication application: The Application object @@ -149,7 +148,7 @@ class SearchView(Gtk.Stack): return False - def _create_song_widget(self, coresong: CoreSong) -> Gtk.ListBoxRow: + def _create_song_widget(self, coresong: 'CoreSong') -> Gtk.ListBoxRow: song_widget = SongWidget(coresong, False, True) song_widget.props.show_song_number = False song_widget.props.menu = SongWidgetMenu( @@ -162,7 +161,7 @@ class SearchView(Gtk.Stack): return song_widget - def _create_album_cover(self, corealbum: CoreAlbum) -> AlbumCover: + def _create_album_cover(self, corealbum: 'CoreAlbum') -> AlbumCover: album_cover = AlbumCover(corealbum) album_cover.retrieve() Index: gnome-music-45.1/gnomemusic/widgets/albumwidget.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/widgets/albumwidget.py +++ gnome-music-45.1/gnomemusic/widgets/albumwidget.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from gettext import ngettext from typing import Optional, Union import typing @@ -64,7 +63,7 @@ class AlbumWidget(Adw.Bin): selection_mode = GObject.Property(type=bool, default=False) show_artist_label = GObject.Property(type=bool, default=True) - def __init__(self, application: Application) -> None: + def __init__(self, application: 'Application') -> None: """Initialize the AlbumWidget. :param GtkApplication application: The application object @@ -169,7 +168,7 @@ class AlbumWidget(Adw.Bin): @GObject.Property( type=object, default=None, flags=GObject.ParamFlags.READWRITE) - def active_coreobject(self) -> Optional[Union[CoreAlbum, CoreArtist]]: + def active_coreobject(self) -> Optional[Union[CoreAlbum, 'CoreArtist']]: """Get the current CoreObject. active_coreobject is used to set the Player playlist @@ -188,14 +187,14 @@ class AlbumWidget(Adw.Bin): @active_coreobject.setter # type:ignore def active_coreobject( - self, coreobject: Union[CoreAlbum, CoreArtist]) -> None: + self, coreobject: Union[CoreAlbum, 'CoreArtist']) -> None: """Update CoreOject used for AlbumWidget. :param CoreAlbum corealbum: The CoreAlbum object """ self._active_coreobject = coreobject - def _create_widget(self, disc: CoreDisc) -> DiscBox: + def _create_widget(self, disc: 'CoreDisc') -> DiscBox: disc_box = DiscBox(self._application, self._corealbum, disc) disc_box.connect('song-activated', self._song_activated) @@ -252,7 +251,7 @@ class AlbumWidget(Adw.Bin): self._released_label.props.label = label - def _play(self, coresong: Optional[CoreSong] = None) -> None: + def _play(self, coresong: Optional['CoreSong'] = None) -> None: signal_id = 0 def _on_playlist_loaded(klass, playlist_type): @@ -264,7 +263,7 @@ class AlbumWidget(Adw.Bin): self._coremodel.props.active_core_object = self.props.active_coreobject def _song_activated( - self, widget: Gtk.Widget, song_widget: SongWidget) -> None: + self, widget: Gtk.Widget, song_widget: 'SongWidget') -> None: if self.props.selection_mode: song_widget.props.selected = not song_widget.props.selected return Index: gnome-music-45.1/gnomemusic/widgets/artistalbumswidget.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/widgets/artistalbumswidget.py +++ gnome-music-45.1/gnomemusic/widgets/artistalbumswidget.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from typing import Optional import typing @@ -49,7 +48,7 @@ class ArtistAlbumsWidget(Gtk.Box): selection_mode = GObject.Property(type=bool, default=False) - def __init__(self, application: Application) -> None: + def __init__(self, application: 'Application') -> None: """Initialize the ArtistAlbumsWidget :param Aplication application: The Application object Index: gnome-music-45.1/gnomemusic/widgets/playlistswidget.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/widgets/playlistswidget.py +++ gnome-music-45.1/gnomemusic/widgets/playlistswidget.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations import typing from gi.repository import GObject, Gtk @@ -47,8 +46,8 @@ class PlaylistsWidget(Gtk.Box): _songs_list = Gtk.Template.Child() def __init__( - self, application: Application, - playlists_view: PlaylistsView) -> None: + self, application: 'Application', + playlists_view: 'PlaylistsView') -> None: """Initialize the PlaylistsWidget. :param Application application: The application object @@ -85,7 +84,7 @@ class PlaylistsWidget(Gtk.Box): self._pl_ctrls.props.playlist = playlist def _create_song_widget( - self, coresong: CoreSong, playlist: Playlist) -> Gtk.ListBoxRow: + self, coresong: 'CoreSong', playlist: 'Playlist') -> Gtk.ListBoxRow: can_dnd = not playlist.props.is_smart song_widget = SongWidget(coresong, can_dnd, True) song_widget.props.show_song_number = False Index: gnome-music-45.1/gnomemusic/widgets/songwidgetmenu.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/widgets/songwidgetmenu.py +++ gnome-music-45.1/gnomemusic/widgets/songwidgetmenu.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from typing import Any, Optional, Union, cast import typing @@ -36,7 +35,7 @@ if typing.TYPE_CHECKING: from gnomemusic.application import Application from gnomemusic.corealbum import CoreAlbum from gnomemusic.coresong import CoreSong - CoreObject = Union[CoreAlbum, CoreSong, Playlist] + CoreObject = Union['CoreAlbum', 'CoreSong', Playlist] @Gtk.Template(resource_path="/org/gnome/Music/ui/SongWidgetMenu.ui") @@ -45,9 +44,9 @@ class SongWidgetMenu(Gtk.PopoverMenu): __gtype_name__ = "SongWidgetMenu" def __init__( - self, application: Application, + self, application: 'Application', song_widget: Union[SongWidget, Gtk.ListItem], - coreobject: Optional[CoreObject]) -> None: + coreobject: Optional['CoreObject']) -> None: """Menu to interact with the song of a SongWidget. :param Application application: The application object @@ -63,7 +62,7 @@ class SongWidgetMenu(Gtk.PopoverMenu): self._window = application.props.window self._coreobject = coreobject - self._coresong: CoreSong + self._coresong: 'CoreSong' self._song_widget = song_widget self.props.coreobject = coreobject @@ -88,7 +87,7 @@ class SongWidgetMenu(Gtk.PopoverMenu): self.insert_action_group("songwidget", action_group) - def _play_song(self, action: Gio.Simple, param: Any) -> None: + def _play_song(self, action: 'Gio.Simple', param: Any) -> None: self.popdown() signal_id = 0 @@ -100,7 +99,7 @@ class SongWidgetMenu(Gtk.PopoverMenu): "playlist-loaded", _on_playlist_loaded) self._coremodel.props.active_core_object = self._coreobject - def _add_to_playlist(self, action: Gio.Simple, param: Any) -> None: + def _add_to_playlist(self, action: 'Gio.Simple', param: Any) -> None: def on_response(dialog: PlaylistDialog, response_id: int) -> None: if not self._playlist_dialog: @@ -119,7 +118,7 @@ class SongWidgetMenu(Gtk.PopoverMenu): self._playlist_dialog.connect("response", on_response) self._playlist_dialog.present() - def _remove_from_playlist(self, action: Gio.Simple, param: Any) -> None: + def _remove_from_playlist(self, action: 'Gio.Simple', param: Any) -> None: self.popdown() position = self._song_widget.get_index() SongToast( @@ -127,11 +126,11 @@ class SongWidgetMenu(Gtk.PopoverMenu): self._coresong) @GObject.Property(type=GObject.GObject) - def coreobject(self) -> CoreObject: + def coreobject(self) -> 'CoreObject': return self._coreobject @coreobject.setter # type: ignore - def coreobject(self, coreobject: CoreObject) -> None: + def coreobject(self, coreobject: 'CoreObject') -> None: self._coreobject = coreobject if isinstance(self._song_widget, SongWidget): Index: gnome-music-45.1/gnomemusic/corealbum.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/corealbum.py +++ gnome-music-45.1/gnomemusic/corealbum.py @@ -22,8 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations - import gi gi.require_versions({"Grl": "0.3"}) from gi.repository import Gio, Grl, Gtk, GObject @@ -169,5 +167,5 @@ class CoreAlbum(GObject.GObject): self.props.media.set_thumbnail(self._thumbnail) @GObject.Property(type=object, flags=GObject.ParamFlags.READABLE) - def corealbum(self) -> CoreAlbum: + def corealbum(self) -> 'CoreAlbum': return self Index: gnome-music-45.1/gnomemusic/coverpaintable.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/coverpaintable.py +++ gnome-music-45.1/gnomemusic/coverpaintable.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from typing import Optional, Union import typing @@ -62,7 +61,7 @@ class CoverPaintable(GObject.GObject, Gd super().__init__() self._art_size = art_size - self._coreobject: Optional[CoreObject] = None + self._coreobject: Optional['CoreObject'] = None self._icon_theme = Gtk.IconTheme.new().get_for_display( widget.get_display()) self._icon_type = icon_type @@ -129,7 +128,7 @@ class CoverPaintable(GObject.GObject, Gd self.invalidate_contents() @GObject.Property(type=object, default=None) - def coreobject(self) -> Optional[CoreObject]: + def coreobject(self) -> Optional['CoreObject']: """Get the current core object in use :returns: The corrent coreobject @@ -138,7 +137,7 @@ class CoverPaintable(GObject.GObject, Gd return self._coreobject @coreobject.setter # type: ignore - def coreobject(self, coreobject: CoreObject) -> None: + def coreobject(self, coreobject: 'CoreObject') -> None: """Update the coreobject used for CoverPaintable :param Union[CoreAlbum, CoreArtist, CoreSong] coreobject: @@ -165,7 +164,7 @@ class CoverPaintable(GObject.GObject, Gd self._on_thumbnail_changed(self._coreobject, None) def _on_thumbnail_changed( - self, coreobject: CoreObject, + self, coreobject: 'CoreObject', uri: GObject.ParamSpecString) -> None: thumbnail_uri = coreobject.props.thumbnail Index: gnome-music-45.1/gnomemusic/griloartqueue.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/griloartqueue.py +++ gnome-music-45.1/gnomemusic/griloartqueue.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from typing import Dict, List, Union import typing @@ -47,10 +46,10 @@ class GriloArtQueue(GObject.GObject): __gtype_name__ = "GriloArtQueue" - _queue: Dict[CoreObject, CoreObjectType] = {} - _active_queue: List[CoreObject] = [] + _queue: Dict['CoreObject', CoreObjectType] = {} + _active_queue: List['CoreObject'] = [] - def __init__(self, application: Application) -> None: + def __init__(self, application: 'Application') -> None: """Initialize GriloArtQueue :param Application application: The application instance @@ -62,7 +61,7 @@ class GriloArtQueue(GObject.GObject): self._timeout_id = 0 def queue( - self, coreobject: CoreObject, + self, coreobject: 'CoreObject', coreobjecttype: CoreObjectType) -> None: """Queue Grilo art lookup for the coreobject @@ -99,6 +98,6 @@ class GriloArtQueue(GObject.GObject): return GLib.SOURCE_CONTINUE def _on_async_finished( - self, storeart: StoreArt, coreobject: CoreObject) -> None: + self, storeart: StoreArt, coreobject: 'CoreObject') -> None: if coreobject in self._active_queue: self._active_queue.remove(coreobject) Index: gnome-music-45.1/gnomemusic/mediaartloader.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/mediaartloader.py +++ gnome-music-45.1/gnomemusic/mediaartloader.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from typing import Optional from gi.repository import Gdk, Gio, GLib, GObject Index: gnome-music-45.1/gnomemusic/playlisttoast.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/playlisttoast.py +++ gnome-music-45.1/gnomemusic/playlisttoast.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from typing import Optional import typing @@ -39,7 +38,7 @@ class PlaylistToast(GObject.Object): __gtype_name__ = "PlaylistToast" - def __init__(self, application: Application, playlist: Playlist) -> None: + def __init__(self, application: 'Application', playlist: 'Playlist') -> None: """Initialize the toast for song deletion :param Application application: Application object Index: gnome-music-45.1/gnomemusic/scrobbler.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/scrobbler.py +++ gnome-music-45.1/gnomemusic/scrobbler.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from typing import Dict, Optional, Union, cast from enum import IntEnum from hashlib import md5 Index: gnome-music-45.1/gnomemusic/songtoast.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/songtoast.py +++ gnome-music-45.1/gnomemusic/songtoast.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from typing import Optional import typing @@ -41,8 +40,8 @@ class SongToast(GObject.Object): __gtype_name__ = "SongToast" def __init__( - self, application: Application, playlist: Playlist, position: int, - coresong: CoreSong) -> None: + self, application: 'Application', playlist: 'Playlist', position: int, + coresong: 'CoreSong') -> None: """Initialize the toast for song deletion :param Application application: Application object Index: gnome-music-45.1/gnomemusic/texturecache.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/texturecache.py +++ gnome-music-45.1/gnomemusic/texturecache.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from enum import IntEnum from typing import Dict, Optional, Tuple, Union import time @@ -76,7 +75,7 @@ class TextureCache(GObject.GObject): _memory_monitor = Gio.MemoryMonitor.dup_default() _size = _MAX_CACHE_SIZE _textures: Dict[str, Tuple[ - TextureCache.LoadingState, float, Optional[Gdk.Texture]]] = {} + 'TextureCache.LoadingState', float, Optional[Gdk.Texture]]] = {} def __init__(self) -> None: """Initialize Texturecache Index: gnome-music-45.1/gnomemusic/trackerwrapper.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/trackerwrapper.py +++ gnome-music-45.1/gnomemusic/trackerwrapper.py @@ -21,7 +21,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations import os import typing from enum import IntEnum @@ -45,7 +44,7 @@ class TrackerState(IntEnum): class TrackerWrapper(GObject.GObject): - def __init__(self, application: Application) -> None: + def __init__(self, application: 'Application') -> None: """Create a connection to an instance of Tracker :param Application application: The application object @@ -210,7 +209,7 @@ class TrackerWrapper(GObject.GObject): return query - def _update_favorite(self, media: Grl.Media) -> None: + def _update_favorite(self, media: 'Grl.Media') -> None: """Update favorite state of a song :param Grl.Media media: media which contains updated favorite state @@ -242,7 +241,7 @@ class TrackerWrapper(GObject.GObject): self._local_db.update_async(update, None, _update_favorite_cb) - def _update_play_count(self, media: Grl.Media) -> None: + def _update_play_count(self, media: 'Grl.Media') -> None: update = """ DELETE WHERE { <%(urn)s> nie:usageCounter ?count . @@ -265,7 +264,7 @@ class TrackerWrapper(GObject.GObject): self._local_db.update_async(update, None, _update_play_count_cb) - def _update_last_played(self, media: Grl.Media) -> None: + def _update_last_played(self, media: 'Grl.Media') -> None: last_played = media.get_last_played().format_iso8601() update = """ DELETE WHERE { @@ -289,7 +288,7 @@ class TrackerWrapper(GObject.GObject): self._local_db.update_async(update, None, _update_last_played_cb) - def update_tag(self, media: Grl.Media, tag: str) -> None: + def update_tag(self, media: 'Grl.Media', tag: str) -> None: """Update property of a resource. :param Grl.Media media: media which contains updated tag Index: gnome-music-45.1/gnomemusic/views/albumsview.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/views/albumsview.py +++ gnome-music-45.1/gnomemusic/views/albumsview.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations import typing from gettext import gettext as _ @@ -59,7 +58,7 @@ class AlbumsView(Gtk.Stack): _scrolled_window = Gtk.Template.Child() _gridview = Gtk.Template.Child() - def __init__(self, application: Application) -> None: + def __init__(self, application: 'Application') -> None: """Initialize AlbumsView :param application: The Application object @@ -153,7 +152,7 @@ class AlbumsView(Gtk.Stack): self._set_album_headerbar(corealbum) self.set_visible_child_name("widget") - def _set_album_headerbar(self, corealbum: CoreAlbum) -> None: + def _set_album_headerbar(self, corealbum: 'CoreAlbum') -> None: self._headerbar.props.state = HeaderBar.State.CHILD self._headerbar.set_label_title( corealbum.props.title, corealbum.props.artist) Index: gnome-music-45.1/gnomemusic/views/artistsview.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/views/artistsview.py +++ gnome-music-45.1/gnomemusic/views/artistsview.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations import typing from gettext import gettext as _ @@ -53,7 +52,7 @@ class ArtistsView(Gtk.Paned): _artist_view = Gtk.Template.Child() _sidebar = Gtk.Template.Child() - def __init__(self, application: Application) -> None: + def __init__(self, application: 'Application') -> None: """Initialize :param GtkApplication application: The application object Index: gnome-music-45.1/gnomemusic/views/songsview.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/views/songsview.py +++ gnome-music-45.1/gnomemusic/views/songsview.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations import typing from gettext import gettext as _ @@ -53,7 +52,7 @@ class SongsView(Gtk.Box): _listview = Gtk.Template.Child() - def __init__(self, application: Application) -> None: + def __init__(self, application: 'Application') -> None: """Initialize :param GtkApplication window: The application object Index: gnome-music-45.1/gnomemusic/widgets/artisttile.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/widgets/artisttile.py +++ gnome-music-45.1/gnomemusic/widgets/artisttile.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from typing import Optional from gi.repository import GObject, Gtk Index: gnome-music-45.1/gnomemusic/widgets/discbox.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/widgets/discbox.py +++ gnome-music-45.1/gnomemusic/widgets/discbox.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations from gettext import gettext as _ import typing @@ -56,8 +55,8 @@ class DiscBox(Gtk.ListBoxRow): show_disc_label = GObject.Property(type=bool, default=False) def __init__( - self, application: Application, corealbum: CoreAlbum, - coredisc: CoreDisc) -> None: + self, application: 'Application', corealbum: 'CoreAlbum', + coredisc: 'CoreDisc') -> None: """Initialize :param Application coredisc: The Application object Index: gnome-music-45.1/gnomemusic/widgets/songwidget.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/widgets/songwidget.py +++ gnome-music-45.1/gnomemusic/widgets/songwidget.py @@ -22,8 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations - from enum import IntEnum from typing import Optional @@ -180,7 +178,7 @@ class SongWidget(Gtk.ListBoxRow): @Gtk.Template.Callback() def _on_drop( self, target: Gtk.DropTarget, - source_widget: SongWidget, x: float, y: float) -> bool: + source_widget: 'SongWidget', x: float, y: float) -> bool: self._drag_widget = None self._drag_x = 0. self._drag_y = 0. Index: gnome-music-45.1/gnomemusic/windowplacement.py =================================================================== --- gnome-music-45.1.orig/gnomemusic/windowplacement.py +++ gnome-music-45.1/gnomemusic/windowplacement.py @@ -22,7 +22,6 @@ # code, but you are not obligated to do so. If you do not wish to do so, # delete this exception statement from your version. -from __future__ import annotations import typing from gi.repository import GLib, GObject @@ -69,12 +68,12 @@ class WindowPlacement(GObject.GObject): self._window.maximize() def _on_size_change( - self, window: Window, size: GObject.ParamSpecInt) -> None: + self, window: 'Window', size: GObject.ParamSpecInt) -> None: if self._window_placement_update_timeout == 0: self._window_placement_update_timeout = GLib.timeout_add( 500, self._store_size, window) - def _store_size(self, window: Window) -> bool: + def _store_size(self, window: 'Window') -> bool: width = window.get_width() height = window.get_height() self._settings.set_value(
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor