Skip to content

Commit

Permalink
Cleanup imports marked as unused by pyflakes
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Apr 25, 2017
1 parent aa7edff commit a8ec98a
Show file tree
Hide file tree
Showing 35 changed files with 20 additions and 95 deletions.
8 changes: 1 addition & 7 deletions xl/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,14 @@
from gi.repository import GObject
from gi.repository import Gio
import logging
import os
import os.path
import shutil
import threading
import time

from xl.nls import gettext as _
from xl import (
common,
event,
metadata,
settings,
trax,
xdg
trax
)

logger = logging.getLogger(__name__)
Expand Down
3 changes: 1 addition & 2 deletions xl/dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
import random
import time

from xl.nls import gettext as _
from xl import xdg, common, event, providers, settings, metadata
from xl import xdg, providers, settings
from xl.trax import search

logger = logging.getLogger(__name__)
Expand Down
3 changes: 0 additions & 3 deletions xl/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,13 @@
"""

from datetime import date
from gi.repository import Gio
from gi.repository import GLib
from gi.repository import GObject
import re
from string import Template, _TemplateMetaclass

from xl import (
common,
event,
main,
providers,
settings,
trax
Expand Down
1 change: 0 additions & 1 deletion xl/metadata/_matroska.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ def gio_location(location):
return location

if __name__ == '__main__':
import sys
location = gio_location(sys.argv[1])
dump_tags(location)

Expand Down
1 change: 0 additions & 1 deletion xl/metadata/mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@


from xl.metadata._base import BaseFormat
from mutagen import FileType

import os

Expand Down
1 change: 0 additions & 1 deletion xl/metadata/sid.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@


from xl.metadata._base import BaseFormat
from mutagen import FileType

class SidFormat(BaseFormat):
writable = False
Expand Down
6 changes: 0 additions & 6 deletions xl/player/gst/sink_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,8 @@
For plugins like the Preview Device, this is critical.
'''


import os.path
import platform
from gi.repository import GLib
from gi.repository import Gst

from xl.nls import gettext as _

import logging
logger = logging.getLogger(__name__)

Expand Down
7 changes: 3 additions & 4 deletions xl/playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
in playlists as well as methods to import and export from various file formats.
"""

from gi.repository import Gio

import cgi
from collections import namedtuple
from collections import deque, namedtuple
from datetime import datetime, timedelta
from gi.repository import Gio
import logging
import os
import random
Expand All @@ -46,7 +47,6 @@
import pickle

from xl import (
collection,
common,
dynamic,
event,
Expand Down Expand Up @@ -680,7 +680,6 @@ class ASXPlaylistParser(object):
for parsing ASX playlists case-insensitive
"""
def __init__(self):
from collections import deque
self._stack = deque()

self._playlistdata = {
Expand Down
3 changes: 1 addition & 2 deletions xl/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
import tarfile

from xl.nls import gettext as _
from xl import (
common,
from xl import (
event,
settings,
xdg
Expand Down
2 changes: 0 additions & 2 deletions xl/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
import os
import sys

from gi.repository import GLib

logger = logging.getLogger(__name__)

from xl import event, xdg
Expand Down
2 changes: 0 additions & 2 deletions xl/trax/trackdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@

from copy import deepcopy

from gi.repository import GLib

from xl import common, event
from xl.nls import gettext as _

Expand Down
3 changes: 2 additions & 1 deletion xl/trax/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

from gi.repository import Gio
from gi.repository import GLib
from xl import metadata, settings

from xl import metadata
from xl.trax.track import Track
from xl.trax.search import search_tracks, TracksMatcher

Expand Down
1 change: 0 additions & 1 deletion xl/xldbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import dbus
import dbus.service
from gi.repository import Gio
from gi.repository import GObject

# Be VERY careful what you import here! This module gets loaded even if
# we are just issuing a dbus command to a running instance, so we need
Expand Down
10 changes: 3 additions & 7 deletions xlgui/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@
from gi.repository import Gio
from gi.repository import Gtk
import logging
import os

from xl.nls import gettext as _
from xl import (
collection,
xdg
)
from xl import xdg
from xlgui.widgets import dialogs
from xlgui.guiutil import GtkTemplate

Expand Down Expand Up @@ -124,8 +120,8 @@ def on_add_button_clicked(self, widget):

for row in self.model:
library_location = Gio.File.new_for_uri(row[0])
monitored = row[1]
scan_on_startup = row[2]
#monitored = row[1]
#scan_on_startup = row[2]

if location.has_prefix(library_location):
self.message.show_warning(
Expand Down
6 changes: 1 addition & 5 deletions xlgui/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@
# from your version.

import logging
import threading

from gi.repository import GdkPixbuf
from gi.repository import Gtk

from xl.nls import gettext as _
from xl import xdg, settings, event, devices
from xlgui import collection
from xl import event
from xlgui.guiutil import GtkTemplate

logger = logging.getLogger(__name__)
Expand Down
6 changes: 2 additions & 4 deletions xlgui/guiutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,17 @@
# do so. If you do not wish to do so, delete this exception statement
# from your version.

from collections import namedtuple
from gi.repository import Gio
from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gi.repository import GObject
from gi.repository import GLib
from gi.repository import Gtk

import logging
import os
import os.path
import threading

from xl import event, settings, xdg
from xl import settings, xdg
from xlgui import icons

# moved idle_add to common, useful for more than just GUI stuff :)
Expand Down
2 changes: 0 additions & 2 deletions xlgui/icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
Provides methods for convenient icons and image handling
"""

import cairo
import glob
from gi.repository import (
Gdk,
Expand All @@ -41,7 +40,6 @@

from xl import (
common,
event,
settings,
xdg
)
Expand Down
5 changes: 0 additions & 5 deletions xlgui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@
# do so. If you do not wish to do so, delete this exception statement
# from your version.

import datetime
import logging
import os
import re
import threading

import cairo
from gi.repository import Gdk
from gi.repository import GLib
from gi.repository import GObject
Expand Down
7 changes: 2 additions & 5 deletions xlgui/panel/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
)
from xlgui.panel import menus
from xlgui.widgets.common import DragTreeView
from xlgui.widgets import (
info
)

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -426,9 +423,9 @@ def button_press(self, widget, event):
"""
Called when the user clicks on the tree
"""
selection = self.tree.get_selection()
#selection = self.tree.get_selection()
(x, y) = map(int, event.get_coords())
path = self.tree.get_path_at_pos(x, y)
#path = self.tree.get_path_at_pos(x, y)
if event.type == Gdk.EventType._2BUTTON_PRESS:
replace = settings.get_option('playlist/replace_content', False)
self.append_to_playlist(replace=replace)
Expand Down
3 changes: 0 additions & 3 deletions xlgui/panel/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
# do so. If you do not wish to do so, delete this exception statement
# from your version.

import threading

from gi.repository import GLib
from gi.repository import GObject
from gi.repository import Gtk

Expand Down
1 change: 0 additions & 1 deletion xlgui/panel/flatplaylist.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
# do so. If you do not wish to do so, delete this exception statement
# from your version.

from gi.repository import Gdk
from gi.repository import GObject
from gi.repository import Gtk

Expand Down
2 changes: 0 additions & 2 deletions xlgui/panels.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
# do so. If you do not wish to do so, delete this exception statement
# from your version.

from gi.repository import GLib
from gi.repository import Gtk
import logging

from xl.nls import gettext as _
Expand Down
5 changes: 0 additions & 5 deletions xlgui/playlist_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,19 @@
# from your version.

from gi.repository import Gdk
from gi.repository import GLib
from gi.repository import GObject
from gi.repository import Gtk

import re
from datetime import datetime
from xl.nls import gettext as _
from xl import (
common,
event,
providers,
settings,
xdg
)
from xl.playlist import Playlist, PlaylistManager
from xlgui.widgets import menu
from xlgui.accelerators import Accelerator
from xlgui.widgets.common import AttachedWindow
from xlgui.widgets.notebook import (
SmartNotebook,
NotebookTab,
Expand Down
2 changes: 0 additions & 2 deletions xlgui/preferences/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

from gi.repository import Gtk

from xl import xdg
from xl.nls import gettext as _
from xlgui.preferences import widgets
Expand Down
5 changes: 1 addition & 4 deletions xlgui/preferences/playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@
# do so. If you do not wish to do so, delete this exception statement
# from your version.

from gi.repository import GObject
from gi.repository import Gtk

from xlgui.preferences import widgets
from xl import main, xdg
from xl import xdg
from xl.nls import gettext as _

# TODO: If we ever add another engine, need to make sure that
Expand Down
3 changes: 0 additions & 3 deletions xlgui/preferences/playlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@
# do so. If you do not wish to do so, delete this exception statement
# from your version.

from gi.repository import Gtk

from xl import xdg
from xl.nls import gettext as _
from xlgui import icons
from xlgui.preferences import widgets

name = _('Playlists')
Expand Down
2 changes: 1 addition & 1 deletion xlgui/preferences/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from gi.repository import Pango

from xl.nls import gettext as _
from xl import event, main, settings, xdg
from xl import event, main, settings
from xlgui import guiutil
from xlgui.widgets import dialogs
from xlgui.guiutil import GtkTemplate
Expand Down
1 change: 0 additions & 1 deletion xlgui/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
# do so. If you do not wish to do so, delete this exception statement
# from your version.

import copy
from collections import OrderedDict
import datetime
import io
Expand Down
2 changes: 1 addition & 1 deletion xlgui/tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
)
from xl.nls import gettext as _
from xlgui.widgets.info import TrackToolTip
from xlgui.widgets import rating, menu, menuitems, playlist, playback
from xlgui.widgets import menu, menuitems, playlist, playback

logger = logging.getLogger(__name__)

Expand Down

0 comments on commit a8ec98a

Please sign in to comment.