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(-)

diff --git a/gnomemusic/coremodel.py b/gnomemusic/coremodel.py
index b9110a8..31f9635 100644
--- a/gnomemusic/coremodel.py
+++ b/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 Optional, Union
 import typing
 
@@ -78,7 +77,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
diff --git a/gnomemusic/coresong.py b/gnomemusic/coresong.py
index 585f28e..9e2e607 100644
--- a/gnomemusic/coresong.py
+++ b/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
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index 469ee77..c6cdf76 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/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
 
diff --git a/gnomemusic/gstplayer.py b/gnomemusic/gstplayer.py
index aaff3ed..18880ac 100644
--- a/gnomemusic/gstplayer.py
+++ b/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
diff --git a/gnomemusic/views/searchview.py b/gnomemusic/views/searchview.py
index bea6095..02f21ed 100644
--- a/gnomemusic/views/searchview.py
+++ b/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
@@ -82,7 +81,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
@@ -156,7 +155,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(
diff --git a/gnomemusic/widgets/albumwidget.py b/gnomemusic/widgets/albumwidget.py
index 3c7e2a9..0d4c0a5 100644
--- a/gnomemusic/widgets/albumwidget.py
+++ b/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
@@ -65,7 +64,7 @@ class AlbumWidget(Handy.Clamp):
     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
@@ -162,7 +161,7 @@ class AlbumWidget(Handy.Clamp):
 
     @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
@@ -181,14 +180,14 @@ class AlbumWidget(Handy.Clamp):
 
     @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)
 
@@ -244,7 +243,7 @@ class AlbumWidget(Handy.Clamp):
 
         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):
@@ -256,7 +255,7 @@ class AlbumWidget(Handy.Clamp):
         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
diff --git a/gnomemusic/widgets/artistalbumswidget.py b/gnomemusic/widgets/artistalbumswidget.py
index 4f21315..c5b922a 100644
--- a/gnomemusic/widgets/artistalbumswidget.py
+++ b/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
 import typing
 
 from gi.repository import GObject, Gtk, Handy
@@ -49,7 +48,7 @@ class ArtistAlbumsWidget(Handy.Clamp):
     selection_mode = GObject.Property(type=bool, default=False)
 
     def __init__(
-            self, coreartist: CoreArtist, application: Application) -> None:
+            self, coreartist: 'CoreArtist', application: 'Application') -> None:
         """Initialize the ArtistAlbumsWidget
 
         :param CoreArtist coreartist: The CoreArtist object
diff --git a/gnomemusic/widgets/disclistboxwidget.py b/gnomemusic/widgets/disclistboxwidget.py
index 251c2c1..f21f9ec 100644
--- a/gnomemusic/widgets/disclistboxwidget.py
+++ b/gnomemusic/widgets/disclistboxwidget.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
 
@@ -57,8 +56,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
diff --git a/gnomemusic/widgets/playlistswidget.py b/gnomemusic/widgets/playlistswidget.py
index 930ec0c..2c8c98a 100644
--- a/gnomemusic/widgets/playlistswidget.py
+++ b/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 Gdk, GObject, Gtk
@@ -48,8 +47,8 @@ class PlaylistsWidget(Gtk.Box):
     _songs_list_ctrlr = 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
@@ -86,7 +85,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
diff --git a/gnomemusic/widgets/songwidgetmenu.py b/gnomemusic/widgets/songwidgetmenu.py
index fea83d1..5fa1ea2 100644
--- a/gnomemusic/widgets/songwidgetmenu.py
+++ b/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 Union
 import typing
 
@@ -46,8 +45,8 @@ class SongWidgetMenu(Gtk.PopoverMenu):
     _remove_from_playlist_button = Gtk.Template.Child()
 
     def __init__(
-            self, application: Application, song_widget: SongWidget,
-            coreobject: Union[CoreAlbum, CoreSong, Playlist]) -> None:
+            self, application: 'Application', song_widget: 'SongWidget',
+            coreobject: Union['CoreAlbum', 'CoreSong', Playlist]) -> None:
         """Menu to interact with the song of a SongWidget.
 
         :param Application application: The application object
-- 
2.33.1

