[gnome-applets] invest-applet: Remove unused imports



commit 7a101ef7bdba4a808c77f87da2c529794b71722f
Author: Dmitry Shachnev <mitya57 gmail com>
Date:   Mon Oct 13 19:54:45 2014 +0400

    invest-applet: Remove unused imports
    
    Remove all imports that are not actually used, and replace
    star imports with proper enumerations to keep the namespace
    clean (so that tools like PyFlakes can work).

 invest-applet/invest/__init__.py       |    4 ++--
 invest-applet/invest/about.py          |    2 +-
 invest-applet/invest/applet.py         |    5 ++---
 invest-applet/invest/chart.py          |    5 +----
 invest-applet/invest/invest-applet.py  |    5 +----
 invest-applet/invest/networkmanager.py |    1 -
 invest-applet/invest/quotes.py         |    2 +-
 invest-applet/invest/test.py           |    2 +-
 invest-applet/invest/widgets.py        |    5 +----
 9 files changed, 10 insertions(+), 21 deletions(-)
---
diff --git a/invest-applet/invest/__init__.py b/invest-applet/invest/__init__.py
index 3dcc94b..8eabc75 100644
--- a/invest-applet/invest/__init__.py
+++ b/invest-applet/invest/__init__.py
@@ -3,12 +3,12 @@ import os, sys, traceback
 from os.path import join, exists, isdir, isfile, dirname, abspath, expanduser
 from types import ListType
 import datetime
-from gi.repository import GObject, Gtk, Gdk, Gio
+from gi.repository import Gio
 import cPickle
 from . import networkmanager
 
 # Autotools set the actual data_dir in defs.py
-from invest.defs import *
+from .defs import DATA_DIR, BUILDERDIR
 
 DEBUGGING = False
 
diff --git a/invest-applet/invest/about.py b/invest-applet/invest/about.py
index 7f85921..718c078 100644
--- a/invest-applet/invest/about.py
+++ b/invest-applet/invest/about.py
@@ -3,7 +3,7 @@ from os.path import join
 from gettext import gettext as _
 from invest.defs import VERSION
 import invest
-from gi.repository import Gtk, Gdk, GdkPixbuf
+from gi.repository import Gtk, GdkPixbuf
 
 invest_logo = None
 try:
diff --git a/invest-applet/invest/applet.py b/invest-applet/invest/applet.py
index 7b9fe55..a77ed8e 100644
--- a/invest-applet/invest/applet.py
+++ b/invest-applet/invest/applet.py
@@ -1,5 +1,4 @@
-import os, time
-from os.path import *
+from os.path import join
 
 from gi.repository import GObject, Gtk, Gdk, GdkPixbuf, PanelApplet
 GObject.threads_init()
@@ -8,7 +7,7 @@ from gettext import gettext as _
 
 import invest, invest.about, invest.chart, invest.preferences, invest.defs
 from invest.quotes import QuoteUpdater
-from invest.widgets import *
+from invest.widgets import InvestWidget
 
 Gtk.Window.set_default_icon_from_file(join(invest.ART_DATA_DIR, "invest_neutral.svg"))
 
diff --git a/invest-applet/invest/chart.py b/invest-applet/invest/chart.py
index 9da45e9..4e8c25d 100644
--- a/invest-applet/invest/chart.py
+++ b/invest-applet/invest/chart.py
@@ -1,15 +1,12 @@
 #!/usr/bin/python
 
-from gi.repository import GObject, Gtk, Gdk, GdkPixbuf, Gio
+from gi.repository import GObject, Gtk, GdkPixbuf
 import os
 import invest
 from gettext import gettext as _
-from invest import *
-import sys
 from os.path import join
 import urllib
 from threading import Thread
-import time
 
 AUTOREFRESH_TIMEOUT = 20*60*1000 # 15 minutes
 
diff --git a/invest-applet/invest/invest-applet.py b/invest-applet/invest/invest-applet.py
index dd68235..6cc8eb3 100755
--- a/invest-applet/invest/invest-applet.py
+++ b/invest-applet/invest/invest-applet.py
@@ -1,8 +1,7 @@
 #!/usr/bin/python
 
-from gi.repository import GObject, Gtk
 import getopt, sys
-from os.path import *
+from os.path import abspath, dirname, exists, isdir, isfile, join
 
 # Allow to use uninstalled
 def _check(path):
@@ -31,8 +30,6 @@ gettext.textdomain(invest.defs.GETTEXT_PACKAGE)
 locale.bindtextdomain(invest.defs.GETTEXT_PACKAGE, invest.defs.GNOMELOCALEDIR)
 locale.textdomain(invest.defs.GETTEXT_PACKAGE)
 
-from gettext import gettext as _
-
 def applet_factory(applet, iid, data):
        invest.debug('Starting invest instance: %s %s %s'% ( applet, iid, data ))
        invest.applet.InvestApplet(applet)
diff --git a/invest-applet/invest/networkmanager.py b/invest-applet/invest/networkmanager.py
index fef939b..1e05735 100644
--- a/invest-applet/invest/networkmanager.py
+++ b/invest-applet/invest/networkmanager.py
@@ -1,4 +1,3 @@
-import invest
 from gi.repository import Gio
 
 class NetworkManager:
diff --git a/invest-applet/invest/quotes.py b/invest-applet/invest/quotes.py
index c93f0e4..6470add 100644
--- a/invest-applet/invest/quotes.py
+++ b/invest-applet/invest/quotes.py
@@ -1,6 +1,6 @@
 from __future__ import absolute_import
 from os.path import join, getmtime
-from gi.repository import GObject, Gtk, Gdk, GdkPixbuf, PanelApplet
+from gi.repository import GObject, Gtk, GdkPixbuf
 from gettext import gettext as _
 import csv
 import locale
diff --git a/invest-applet/invest/test.py b/invest-applet/invest/test.py
index ebd8250..1cf2242 100755
--- a/invest-applet/invest/test.py
+++ b/invest-applet/invest/test.py
@@ -2,7 +2,7 @@
 
 from __future__ import absolute_import
 import unittest
-from os.path import *
+from os.path import abspath, dirname
 import sys
 
 # Make sure we run the local version
diff --git a/invest-applet/invest/widgets.py b/invest-applet/invest/widgets.py
index e4fe590..868d5be 100644
--- a/invest-applet/invest/widgets.py
+++ b/invest-applet/invest/widgets.py
@@ -1,9 +1,6 @@
-import os, time
-from os.path import *
-from gi.repository import GObject, Gtk, Gdk, GdkPixbuf, PanelApplet, Pango
+from gi.repository import GObject, Gtk, GdkPixbuf, Pango
 from gettext import gettext as _
 import locale
-import csv
 import invest, invest.about, invest.chart
 
 COLORSCALE_POSITIVE = [


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]