run pycharms optimize imports over the python modules in the project

Esse commit está contido em:
fossfreedom
2014-06-03 20:04:38 +01:00
commit 3a9589074f
21 arquivos alterados com 75 adições e 87 exclusões
+7 -6
Ver Arquivo
@@ -22,6 +22,12 @@ Structures and managers to work with albums on Rhythmbox. This module provides
the base model for the plugin to work on top of. the base model for the plugin to work on top of.
''' '''
from datetime import datetime, date
import os
import cgi
import tempfile
import gc
from gi.repository import RB from gi.repository import RB
from gi.repository import GObject from gi.repository import GObject
from gi.repository import Gio from gi.repository import Gio
@@ -40,13 +46,8 @@ import coverart_rb3compat as rb3compat
from coverart_utils import uniquify_and_sort from coverart_utils import uniquify_and_sort
from coverart_utils import dumpstack from coverart_utils import dumpstack
from coverart_utils import check_lastfm from coverart_utils import check_lastfm
from datetime import datetime, date
import os
import cgi
import tempfile
import rb import rb
import gc
# default chunk of entries to process when loading albums # default chunk of entries to process when loading albums
+6 -7
Ver Arquivo
@@ -19,14 +19,12 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
import os import os
import urllib.request, urllib.parse import urllib.request
import urllib.parse
import json import json
import gettext
from mako.template import Template from mako.template import Template
import rb
import rb_lastfm as LastFM # from coverart-search-providers
from gi.repository import WebKit from gi.repository import WebKit
from gi.repository import GObject from gi.repository import GObject
from gi.repository import Gtk from gi.repository import Gtk
@@ -34,12 +32,13 @@ from gi.repository import Gdk
from gi.repository import GLib from gi.repository import GLib
from gi.repository import RB from gi.repository import RB
from gi.repository import Gio from gi.repository import Gio
import rb
import rb_lastfm as LastFM # from coverart-search-providers
from coverart_utils import get_stock_size from coverart_utils import get_stock_size
from coverart_widgets import PixbufButton
from coverart_browser_prefs import GSetting from coverart_browser_prefs import GSetting
from coverart_utils import create_button_image from coverart_utils import create_button_image
import gettext
gettext.install('rhythmbox', RB.locale_dir()) gettext.install('rhythmbox', RB.locale_dir())
+4 -7
Ver Arquivo
@@ -17,6 +17,10 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
import os
import tempfile
import shutil
from gi.repository import Gdk from gi.repository import Gdk
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import GLib from gi.repository import GLib
@@ -26,7 +30,6 @@ from gi.repository import GdkPixbuf
from gi.repository import RB from gi.repository import RB
from coverart_browser_prefs import GSetting from coverart_browser_prefs import GSetting
from coverart_album import Cover
from coverart_album import Album from coverart_album import Album
from coverart_album import AlbumsModel from coverart_album import AlbumsModel
from coverart_album import CoverManager from coverart_album import CoverManager
@@ -40,13 +43,7 @@ from coverart_utils import create_pixbuf_from_file_at_size
from coverart_extdb import CoverArtExtDB from coverart_extdb import CoverArtExtDB
import coverart_rb3compat as rb3compat import coverart_rb3compat as rb3compat
from coverart_rb3compat import Menu from coverart_rb3compat import Menu
import rb import rb
import os
from collections import namedtuple
import tempfile, shutil
def create_temporary_copy(path): def create_temporary_copy(path):
+1 -10
Ver Arquivo
@@ -18,30 +18,21 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# define plugin # define plugin
import rb
import locale
import gettext
from gi.repository import GObject from gi.repository import GObject
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import RB from gi.repository import RB
from gi.repository import GdkPixbuf
from gi.repository import Peas from gi.repository import Peas
from gi.repository import Gio from gi.repository import Gio
from gi.repository import GLib from gi.repository import GLib
from coverart_browser_prefs import Preferences import rb
from coverart_browser_prefs import GSetting from coverart_browser_prefs import GSetting
from coverart_browser_prefs import CoverLocale from coverart_browser_prefs import CoverLocale
from coverart_browser_source import CoverArtBrowserSource from coverart_browser_source import CoverArtBrowserSource
from coverart_utils import Theme
from coverart_listview import ListView from coverart_listview import ListView
from coverart_queueview import QueueView from coverart_queueview import QueueView
from coverart_toolbar import TopToolbar from coverart_toolbar import TopToolbar
import coverart_rb3compat as rb3compat
class CoverArtBrowserEntryType(RB.RhythmDBEntryType): class CoverArtBrowserEntryType(RB.RhythmDBEntryType):
''' '''
Entry type for our source. Entry type for our source.
+6 -6
Ver Arquivo
@@ -16,6 +16,12 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
import locale
import gettext
import os
import shutil
import webbrowser
from gi.repository import Gio from gi.repository import Gio
from gi.repository import GObject from gi.repository import GObject
from gi.repository import Gtk from gi.repository import Gtk
@@ -24,11 +30,6 @@ from gi.repository import Peas
from gi.repository import RB from gi.repository import RB
import rb import rb
import locale
import gettext
import os
import shutil
import webbrowser
from stars import ReactiveStar from stars import ReactiveStar
from stars import StarSize from stars import StarSize
import coverart_rb3compat as rb3compat import coverart_rb3compat as rb3compat
@@ -433,7 +434,6 @@ class Preferences(GObject.Object, PeasGtk.Configurable):
# now prepare the genre tab # now prepare the genre tab
from coverart_utils import GenreConfiguredSpriteSheet from coverart_utils import GenreConfiguredSpriteSheet
from coverart_utils import get_stock_size from coverart_utils import get_stock_size
from coverart_utils import GenreType
self._sheet = GenreConfiguredSpriteSheet(plugin, "genre", get_stock_size()) self._sheet = GenreConfiguredSpriteSheet(plugin, "genre", get_stock_size())
+5 -6
Ver Arquivo
@@ -17,7 +17,10 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
import rb import random
from collections import OrderedDict
import unicodedata
import re
from gi.repository import GObject from gi.repository import GObject
from gi.repository import GLib from gi.repository import GLib
@@ -26,8 +29,8 @@ from gi.repository import Gdk
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import RB from gi.repository import RB
import rb
from coverart_album import AlbumManager from coverart_album import AlbumManager
from coverart_browser_prefs import GSetting from coverart_browser_prefs import GSetting
from coverart_browser_prefs import CoverLocale from coverart_browser_prefs import CoverLocale
from coverart_browser_prefs import Preferences from coverart_browser_prefs import Preferences
@@ -47,11 +50,7 @@ from coverart_artistinfo import ArtistInfoPane
from coverart_external_plugins import CreateExternalPluginMenu from coverart_external_plugins import CreateExternalPluginMenu
from coverart_playlists import EchoNestPlaylist from coverart_playlists import EchoNestPlaylist
from coverart_entryview import EntryViewPane from coverart_entryview import EntryViewPane
import coverart_rb3compat as rb3compat import coverart_rb3compat as rb3compat
import random
from collections import OrderedDict
import unicodedata, re
class CoverArtBrowserSource(RB.Source): class CoverArtBrowserSource(RB.Source):
+4 -4
Ver Arquivo
@@ -17,6 +17,10 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
from datetime import date
from collections import OrderedDict
from collections import namedtuple
from gi.repository import GObject from gi.repository import GObject
from gi.repository import Gdk from gi.repository import Gdk
from gi.repository import RB from gi.repository import RB
@@ -31,12 +35,8 @@ from coverart_utils import ConfiguredSpriteSheet
from coverart_utils import get_stock_size from coverart_utils import get_stock_size
from coverart_utils import CaseInsensitiveDict from coverart_utils import CaseInsensitiveDict
from coverart_utils import Theme from coverart_utils import Theme
from datetime import date
from collections import OrderedDict
import rb import rb
import coverart_rb3compat as rb3compat
from collections import namedtuple
MenuNodeT = namedtuple('MenuNode', 'label menutype typevalue') MenuNodeT = namedtuple('MenuNode', 'label menutype typevalue')
+5 -6
Ver Arquivo
@@ -17,22 +17,21 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
import json
import os
from xml.sax.saxutils import escape
from gi.repository import Gdk from gi.repository import Gdk
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import GLib from gi.repository import GLib
from gi.repository import GObject from gi.repository import GObject
from gi.repository import Gio from gi.repository import Gio
from coverart_browser_prefs import GSetting from coverart_browser_prefs import GSetting
from coverart_browser_prefs import webkit_support from coverart_browser_prefs import webkit_support
from coverart_album import AlbumsModel
from coverart_widgets import AbstractView from coverart_widgets import AbstractView
from coverart_widgets import PanedCollapsible from coverart_widgets import PanedCollapsible
import rb import rb
import json
import os
from os.path import expanduser
from xml.sax.saxutils import escape
from collections import namedtuple
class FlowShowingPolicy(GObject.Object): class FlowShowingPolicy(GObject.Object):
+2 -2
Ver Arquivo
@@ -25,8 +25,7 @@ from gi.repository import Gio
from gi.repository import Pango from gi.repository import Pango
from gi.repository import PangoCairo from gi.repository import PangoCairo
from gi.repository import GdkPixbuf from gi.repository import GdkPixbuf
from gi.repository import RB
from gi.repository.GdkPixbuf import Pixbuf
from coverart_widgets import EnhancedIconView from coverart_widgets import EnhancedIconView
from coverart_browser_prefs import GSetting from coverart_browser_prefs import GSetting
from coverart_album import AlbumsModel from coverart_album import AlbumsModel
@@ -35,6 +34,7 @@ from coverart_widgets import PanedCollapsible
import coverart_rb3compat as rb3compat import coverart_rb3compat as rb3compat
import rb import rb
PLAY_SIZE_X = 30 PLAY_SIZE_X = 30
PLAY_SIZE_Y = 30 PLAY_SIZE_Y = 30
+3 -1
Ver Arquivo
@@ -17,6 +17,8 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
from collections import OrderedDict
from gi.repository import RB from gi.repository import RB
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import GObject from gi.repository import GObject
@@ -28,7 +30,6 @@ from coverart_rb3compat import ActionGroup
from coverart_browser_prefs import GSetting from coverart_browser_prefs import GSetting
from coverart_browser_prefs import CoverLocale from coverart_browser_prefs import CoverLocale
from coverart_external_plugins import CreateExternalPluginMenu from coverart_external_plugins import CreateExternalPluginMenu
from collections import OrderedDict
from coverart_playlists import LastFMTrackPlaylist from coverart_playlists import LastFMTrackPlaylist
from coverart_playlists import EchoNestPlaylist from coverart_playlists import EchoNestPlaylist
from coverart_playlists import EchoNestGenrePlaylist from coverart_playlists import EchoNestGenrePlaylist
@@ -38,6 +39,7 @@ from stars import ReactiveStar
from coverart_search import CoverSearchPane from coverart_search import CoverSearchPane
from coverart_widgets import PixbufButton from coverart_widgets import PixbufButton
MIN_IMAGE_SIZE = 100 MIN_IMAGE_SIZE = 100
+5 -6
Ver Arquivo
@@ -17,6 +17,11 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
import shutil
import os
import sys
import subprocess
from gi.repository import GObject from gi.repository import GObject
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import GLib from gi.repository import GLib
@@ -25,15 +30,9 @@ from gi.repository import Gdk
from gi.repository import Peas from gi.repository import Peas
from gi.repository import Gst from gi.repository import Gst
from coverart_album import Album
from coverart_utils import NaturalString from coverart_utils import NaturalString
import rb import rb
import shutil
import coverart_rb3compat as rb3compat import coverart_rb3compat as rb3compat
import os.path
import os
import sys
import subprocess
class CoverArtExport(GObject.Object): class CoverArtExport(GObject.Object):
+2 -4
Ver Arquivo
@@ -20,8 +20,8 @@
from gi.repository import Peas from gi.repository import Peas
from gi.repository import GObject from gi.repository import GObject
import lxml.etree as ET import lxml.etree as ET
import rb import rb
import coverart_rb3compat as rb3compat
from coverart_rb3compat import ActionGroup from coverart_rb3compat import ActionGroup
from coverart_rb3compat import ApplicationShell from coverart_rb3compat import ApplicationShell
from coverart_utils import CaseInsensitiveDict from coverart_utils import CaseInsensitiveDict
@@ -185,9 +185,7 @@ class CreateExternalPluginMenu(GObject.Object):
self._actiongroup = ActionGroup(popup.shell, section_name + '_externalplugins') self._actiongroup = ActionGroup(popup.shell, section_name + '_externalplugins')
# all supported plugins will be defined in the following array by parsing # all supported plugins will be defined in the following array by parsing
# the plugins XML file for the definition. Supported plugins are split between # the plugins XML file for the definition.
# rb2.99 and later and rb2.98 and earlier due to the likelihood that earlier
# plugins may never be updated by their authors
self.supported_plugins = [] self.supported_plugins = []
+2 -1
Ver Arquivo
@@ -17,10 +17,11 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
from coverart_widgets import AbstractView
from gi.repository import GObject from gi.repository import GObject
from gi.repository import GLib from gi.repository import GLib
from coverart_widgets import AbstractView
class ListShowingPolicy(GObject.Object): class ListShowingPolicy(GObject.Object):
''' '''
+7 -4
Ver Arquivo
@@ -17,15 +17,18 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
from gi.repository import RB
from gi.repository import Gtk
from coverart_utils import idle_iterator
import rb
import urllib.parse import urllib.parse
import json import json
import os import os
import random import random
from gi.repository import RB
from gi.repository import Gtk
from coverart_utils import idle_iterator
import rb
LOAD_CHUNK = 50 LOAD_CHUNK = 50
+2 -1
Ver Arquivo
@@ -17,10 +17,11 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
from coverart_widgets import AbstractView
from gi.repository import GObject from gi.repository import GObject
from gi.repository import GLib from gi.repository import GLib
from coverart_widgets import AbstractView
class QueueShowingPolicy(GObject.Object): class QueueShowingPolicy(GObject.Object):
''' '''
+4 -2
Ver Arquivo
@@ -22,14 +22,16 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
import sys
import xml.etree.ElementTree as ET
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import Gio from gi.repository import Gio
from gi.repository import GLib from gi.repository import GLib
from gi.repository import GObject from gi.repository import GObject
from gi.repository import RB from gi.repository import RB
import sys
import rb import rb
import xml.etree.ElementTree as ET
def pygobject_version(): def pygobject_version():
+2 -1
Ver Arquivo
@@ -18,9 +18,10 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
import rb
from gi.repository import Gtk from gi.repository import Gtk
from mako.template import Template from mako.template import Template
import rb
import coverart_rb3compat as rb3compat import coverart_rb3compat as rb3compat
from coverart_album import Album from coverart_album import Album
from coverart_browser_prefs import webkit_support from coverart_browser_prefs import webkit_support
-1
Ver Arquivo
@@ -36,7 +36,6 @@ from coverart_controllers import ArtistSortOrderToggleController
from coverart_controllers import AlbumSearchEntryController from coverart_controllers import AlbumSearchEntryController
from coverart_widgets import SearchEntry from coverart_widgets import SearchEntry
from coverart_browser_prefs import webkit_support from coverart_browser_prefs import webkit_support
import rb import rb
+7 -5
Ver Arquivo
@@ -15,6 +15,12 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
from bisect import bisect_left, bisect_right from bisect import bisect_left, bisect_right
import collections
import re
import logging
import sys
from collections import namedtuple
from gi.repository import GdkPixbuf from gi.repository import GdkPixbuf
from gi.repository import Gdk from gi.repository import Gdk
from gi.repository import Gtk from gi.repository import Gtk
@@ -23,17 +29,13 @@ from gi.repository import RB
from gi.repository import GObject from gi.repository import GObject
from gi.repository import Gio from gi.repository import Gio
import lxml.etree as ET import lxml.etree as ET
import rb import rb
from coverart_browser_prefs import CoverLocale from coverart_browser_prefs import CoverLocale
from coverart_browser_prefs import GSetting from coverart_browser_prefs import GSetting
import collections
import re
import coverart_rb3compat as rb3compat import coverart_rb3compat as rb3compat
import logging
import sys
from coverart_search_providers import lastfm_connected from coverart_search_providers import lastfm_connected
from coverart_search_providers import get_search_providers from coverart_search_providers import get_search_providers
from collections import namedtuple
class FauxTb(object): class FauxTb(object):
-4
Ver Arquivo
@@ -23,11 +23,9 @@ from gi.repository import Gdk
from gi.repository import GLib from gi.repository import GLib
from gi.repository import GObject from gi.repository import GObject
from gi.repository import Gio from gi.repository import Gio
import cairo import cairo
from coverart_browser_prefs import GSetting from coverart_browser_prefs import GSetting
import rb import rb
@@ -548,8 +546,6 @@ class ImageRadioButton(Gtk.RadioButton, OptionsWidget):
#self.set_image(self._controller.get_current_image(Gtk.Buildable.get_name(self))) #self.set_image(self._controller.get_current_image(Gtk.Buildable.get_name(self)))
self.set_tooltip_text("") #self._controller.get_current_description()) self.set_tooltip_text("") #self._controller.get_current_description())
from gi.repository import Gdk
if self.controller.current_key == Gtk.Buildable.get_name(self): if self.controller.current_key == Gtk.Buildable.get_name(self):
self.set_active(True) self.set_active(True)
self._set_colour(Gtk.StateFlags.NORMAL) self._set_colour(Gtk.StateFlags.NORMAL)
+1 -3
Ver Arquivo
@@ -16,12 +16,10 @@
# this program; if not, write to the Free Software Foundation, Inc., # this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
import cairo
import logging import logging
import gettext import gettext
from gettext import gettext as _
import cairo
from gi.repository import Gtk, Gdk, GObject from gi.repository import Gtk, Gdk, GObject
from em import StockEms, em, small_em, big_em from em import StockEms, em, small_em, big_em