Fix import statements and order (see #103)

This commit is contained in:
coderkun 2024-05-27 18:33:59 +02:00
parent a1f8b73590
commit 4ebfc12f0e
10 changed files with 13 additions and 27 deletions

View file

@ -4,7 +4,6 @@ import gi
gi.require_version('Gtk', '4.0') gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1') gi.require_version('Adw', '1')
from gi.repository import Gtk, GObject, Adw from gi.repository import Gtk, GObject, Adw

View file

@ -5,7 +5,7 @@ import gi
gi.require_version('Gtk', '4.0') gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1') gi.require_version('Adw', '1')
from gi.repository import Gio, Gtk, Gdk, GLib, Adw from gi.repository import Gio, Gtk, Gdk, Adw
from .window import Window from .window import Window

View file

@ -1,13 +1,11 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import gi import gi
import locale
gi.require_version('Gtk', '4.0') gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1') gi.require_version('Adw', '1')
import locale from gi.repository import Gtk, GObject, Adw
from gi.repository import Gtk, Gio, GObject, Adw
from mcg.zeroconf import ZeroconfProvider from mcg.zeroconf import ZeroconfProvider

View file

@ -1,11 +1,9 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import gi import gi
gi.require_version('Gtk', '4.0')
import logging
import math import math
gi.require_version('Gtk', '4.0')
from gi.repository import Gtk, Gdk, GObject, GdkPixbuf from gi.repository import Gtk, Gdk, GObject, GdkPixbuf
from mcg.utils import Utils from mcg.utils import Utils

View file

@ -1,14 +1,13 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import gi import gi
gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1')
import locale import locale
import logging import logging
import math import math
import threading import threading
gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1')
from gi.repository import Gtk, Gdk, GObject, GdkPixbuf, Gio, Adw from gi.repository import Gtk, Gdk, GObject, GdkPixbuf, Gio, Adw
from mcg import client from mcg import client
from mcg.albumheaderbar import AlbumHeaderbar from mcg.albumheaderbar import AlbumHeaderbar

View file

@ -1,13 +1,11 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import gi import gi
gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1')
import logging
import math import math
import threading import threading
gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1')
from gi.repository import Gtk, Gdk, Gio, GObject, GdkPixbuf, Adw from gi.repository import Gtk, Gdk, Gio, GObject, GdkPixbuf, Adw
from mcg import client from mcg import client
from mcg.albumheaderbar import AlbumHeaderbar from mcg.albumheaderbar import AlbumHeaderbar

View file

@ -4,7 +4,6 @@ import gi
gi.require_version('Gtk', '4.0') gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1') gi.require_version('Adw', '1')
from gi.repository import Gtk, Adw, GObject from gi.repository import Gtk, Adw, GObject

View file

@ -1,13 +1,11 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import gi import gi
gi.require_version('Gtk', '4.0')
import hashlib import hashlib
import locale import locale
import os import os
import urllib
gi.require_version('Gtk', '4.0')
from gi.repository import Gdk, GdkPixbuf, GObject, Gtk from gi.repository import Gdk, GdkPixbuf, GObject, Gtk

View file

@ -1,20 +1,17 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import gi import gi
gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1')
try: try:
import keyring import keyring
use_keyring = True use_keyring = True
except: except ImportError:
use_keyring = False use_keyring = False
use_keyring = False use_keyring = False
import locale import locale
import logging
gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1')
from gi.repository import Gtk, Adw, Gdk, GObject, GLib, Gio from gi.repository import Gtk, Adw, Gdk, GObject, GLib, Gio
from . import client from . import client
from .shortcutsdialog import ShortcutsDialog from .shortcutsdialog import ShortcutsDialog
from .connectionpanel import ConnectionPanel from .connectionpanel import ConnectionPanel

View file

@ -5,7 +5,7 @@ try:
gi.require_version('Avahi', '0.6') gi.require_version('Avahi', '0.6')
from gi.repository import Avahi from gi.repository import Avahi
use_avahi = True use_avahi = True
except: except ValueError | ImportError:
use_avahi = False use_avahi = False
import logging import logging