[gnome-dvb-daemon] gnomedvb: Fixed a couple of issues revealed by pylint



commit d02b303e9f7cdd7d0a0bc9c0f04dd819cbe50369
Author: Sebastian Pölsterl <sebp k-d-w org>
Date:   Fri Apr 22 16:23:24 2011 +0200

    gnomedvb: Fixed a couple of issues revealed by pylint

 .../ui/controlcenter/ControlCenterWindow.py        |    2 +-
 client/gnomedvb/ui/recordings/RecordingsDialog.py  |    1 -
 client/gnomedvb/ui/timers/CalendarDialog.py        |    1 -
 client/gnomedvb/ui/timers/EditTimersDialog.py      |    4 +++-
 client/gnomedvb/ui/timers/MessageDialogs.py        |    1 -
 client/gnomedvb/ui/timers/TimerDialog.py           |    2 --
 client/gnomedvb/ui/widgets/CellRendererDatetime.py |   16 ++++++++--------
 client/gnomedvb/ui/widgets/ChannelGroupsStore.py   |    1 -
 client/gnomedvb/ui/widgets/ChannelsStore.py        |    1 +
 client/gnomedvb/ui/widgets/DateTime.py             |    3 +++
 client/gnomedvb/ui/widgets/DetailsDialog.py        |    1 -
 client/gnomedvb/ui/widgets/RunningNextStore.py     |   11 +++++------
 client/gnomedvb/ui/widgets/RunningNextView.py      |    2 +-
 client/gnomedvb/ui/widgets/ScheduleStore.py        |    2 +-
 client/gnomedvb/ui/wizard/SetupWizard.py           |    3 +--
 client/gnomedvb/ui/wizard/pages/AdaptersPage.py    |    1 +
 client/gnomedvb/ui/wizard/pages/ChannelScanPage.py |    1 -
 .../ui/wizard/pages/InitialTuningDataPage.py       |    1 -
 18 files changed, 25 insertions(+), 29 deletions(-)
---
diff --git a/client/gnomedvb/ui/controlcenter/ControlCenterWindow.py b/client/gnomedvb/ui/controlcenter/ControlCenterWindow.py
index 37a54a9..3917434 100644
--- a/client/gnomedvb/ui/controlcenter/ControlCenterWindow.py
+++ b/client/gnomedvb/ui/controlcenter/ControlCenterWindow.py
@@ -506,7 +506,7 @@ class ControlCenterWindow(Gtk.Window):
                     type=Gtk.MessageType.QUESTION, buttons=Gtk.ButtonsType.YES_NO)
                 dialog.set_markup (
                     "<big><span weight=\"bold\">%s</span></big>" % _("Schedule recording for the selected event?"))
-                rec_id = -1
+
                 success = True
                 if dialog.run() == Gtk.ResponseType.YES:
                     event_id = model[aiter][model.COL_EVENT_ID]
diff --git a/client/gnomedvb/ui/recordings/RecordingsDialog.py b/client/gnomedvb/ui/recordings/RecordingsDialog.py
index bb302f1..f0ecfd5 100644
--- a/client/gnomedvb/ui/recordings/RecordingsDialog.py
+++ b/client/gnomedvb/ui/recordings/RecordingsDialog.py
@@ -16,7 +16,6 @@
 # You should have received a copy of the GNU General Public License
 # along with GNOME DVB Daemon.  If not, see <http://www.gnu.org/licenses/>.
 
-import gobject
 from gi.repository import Gdk
 from gi.repository import Gtk
 from gettext import gettext as _
diff --git a/client/gnomedvb/ui/timers/CalendarDialog.py b/client/gnomedvb/ui/timers/CalendarDialog.py
index 702327b..4d1648d 100644
--- a/client/gnomedvb/ui/timers/CalendarDialog.py
+++ b/client/gnomedvb/ui/timers/CalendarDialog.py
@@ -16,7 +16,6 @@
 # You should have received a copy of the GNU General Public License
 # along with GNOME DVB Daemon.  If not, see <http://www.gnu.org/licenses/>.
 
-import gobject
 from gi.repository import Gtk
 from gettext import gettext as _
         
diff --git a/client/gnomedvb/ui/timers/EditTimersDialog.py b/client/gnomedvb/ui/timers/EditTimersDialog.py
index 242342f..0a76a03 100644
--- a/client/gnomedvb/ui/timers/EditTimersDialog.py
+++ b/client/gnomedvb/ui/timers/EditTimersDialog.py
@@ -45,6 +45,8 @@ class EditTimersDialog(Gtk.Dialog):
         Gtk.Dialog.__init__(self, title=_("Recording schedule"),
             parent=parent)
 
+        self.recorder = None
+
         self.set_modal(True)
         self.set_destroy_with_parent(True)
         self.device_group = device_group
@@ -269,7 +271,7 @@ class EditTimersDialog(Gtk.Dialog):
         duration_str = gnomedvb.seconds_to_time_duration_string(duration)
         cell.set_property("text", duration_str)
 
-    def _datetime_sort_func(treemodel, iter1, iter2):
+    def _datetime_sort_func(self, treemodel, iter1, iter2):
         d1 = treemodel[iter1][self.COL_START]
         d2 = treemodel[iter2][self.COL_START]
         return cmp(d1, d2)
diff --git a/client/gnomedvb/ui/timers/MessageDialogs.py b/client/gnomedvb/ui/timers/MessageDialogs.py
index e1ea50c..a693bb3 100644
--- a/client/gnomedvb/ui/timers/MessageDialogs.py
+++ b/client/gnomedvb/ui/timers/MessageDialogs.py
@@ -16,7 +16,6 @@
 # You should have received a copy of the GNU General Public License
 # along with GNOME DVB Daemon.  If not, see <http://www.gnu.org/licenses/>.
 
-import gobject
 from gi.repository import Gtk
 from gettext import gettext as _
 
diff --git a/client/gnomedvb/ui/timers/TimerDialog.py b/client/gnomedvb/ui/timers/TimerDialog.py
index a6eb8a8..c520375 100644
--- a/client/gnomedvb/ui/timers/TimerDialog.py
+++ b/client/gnomedvb/ui/timers/TimerDialog.py
@@ -17,10 +17,8 @@
 # along with GNOME DVB Daemon.  If not, see <http://www.gnu.org/licenses/>.
 
 import datetime
-import gobject
 from gi.repository import Gtk
 from gettext import gettext as _
-from gnomedvb.ui.timers.CalendarDialog import CalendarDialog
 from gnomedvb.ui.widgets.ChannelsStore import ChannelsStore
 from gnomedvb.ui.widgets.ChannelsView import ChannelsView
 from gnomedvb.ui.widgets.Frame import TextFieldLabel
diff --git a/client/gnomedvb/ui/widgets/CellRendererDatetime.py b/client/gnomedvb/ui/widgets/CellRendererDatetime.py
index f1a7d8a..6ad75de 100644
--- a/client/gnomedvb/ui/widgets/CellRendererDatetime.py
+++ b/client/gnomedvb/ui/widgets/CellRendererDatetime.py
@@ -37,23 +37,23 @@ class CellRendererDatetime(Gtk.CellRendererText):
         self._format = "%c"
         self.set_property("text", "")
         
-    def do_get_property(self, property):
-        if property.name == 'datetime':
+    def do_get_property(self, prop):
+        if prop.name == 'datetime':
             return self._datetime
-        elif property.name == 'format':
+        elif prop.name == 'format':
             return self._format
         else:
-            raise AttributeError, 'unknown property %s' % property.name
+            raise AttributeError, 'unknown property %s' % prop.name
 
-    def do_set_property(self, property, value):
-        if property.name == 'datetime':
+    def do_set_property(self, prop, value):
+        if prop.name == 'datetime':
             self._datetime = value
             self._set_text()
-        elif property.name == 'format':
+        elif prop.name == 'format':
             self._format = value
             self._set_text()
         else:
-            raise AttributeError, 'unknown property %s' % property.name
+            raise AttributeError, 'unknown property %s' % prop.name
 
     def _set_text(self):
         if self._datetime == None:
diff --git a/client/gnomedvb/ui/widgets/ChannelGroupsStore.py b/client/gnomedvb/ui/widgets/ChannelGroupsStore.py
index cb834be..b253528 100644
--- a/client/gnomedvb/ui/widgets/ChannelGroupsStore.py
+++ b/client/gnomedvb/ui/widgets/ChannelGroupsStore.py
@@ -16,7 +16,6 @@
 # You should have received a copy of the GNU General Public License
 # along with GNOME DVB Daemon.  If not, see <http://www.gnu.org/licenses/>.
 
-import gobject
 from gi.repository import Gtk
 
 class ChannelGroupsStore(Gtk.ListStore):
diff --git a/client/gnomedvb/ui/widgets/ChannelsStore.py b/client/gnomedvb/ui/widgets/ChannelsStore.py
index 35aa250..99ea678 100644
--- a/client/gnomedvb/ui/widgets/ChannelsStore.py
+++ b/client/gnomedvb/ui/widgets/ChannelsStore.py
@@ -22,6 +22,7 @@ import gnomedvb
 from gnomedvb import global_error_handler
 from gnomedvb.Callback import Callback
 from cgi import escape
+from gettext import gettext as _
 
 class ChannelsStore(Gtk.ListStore):
 
diff --git a/client/gnomedvb/ui/widgets/DateTime.py b/client/gnomedvb/ui/widgets/DateTime.py
index b3ab0c8..1eecb9e 100644
--- a/client/gnomedvb/ui/widgets/DateTime.py
+++ b/client/gnomedvb/ui/widgets/DateTime.py
@@ -159,6 +159,9 @@ class DateTimeBox(Gtk.Bin):
     def __init__(self, dt=None):
         gobject.GObject.__init__(self)
 
+        self.valid_color = None
+        self.invalid_color = None
+
         self.hbox = Gtk.HBox()
 
         self.entry = Gtk.Entry()
diff --git a/client/gnomedvb/ui/widgets/DetailsDialog.py b/client/gnomedvb/ui/widgets/DetailsDialog.py
index 566c685..035853d 100644
--- a/client/gnomedvb/ui/widgets/DetailsDialog.py
+++ b/client/gnomedvb/ui/widgets/DetailsDialog.py
@@ -17,7 +17,6 @@
 # along with GNOME DVB Daemon.  If not, see <http://www.gnu.org/licenses/>.
 
 import datetime
-import gobject
 from gi.repository import Gtk
 import gnomedvb
 from gettext import gettext as _
diff --git a/client/gnomedvb/ui/widgets/RunningNextStore.py b/client/gnomedvb/ui/widgets/RunningNextStore.py
index ffb0e65..6209c13 100644
--- a/client/gnomedvb/ui/widgets/RunningNextStore.py
+++ b/client/gnomedvb/ui/widgets/RunningNextStore.py
@@ -16,7 +16,6 @@
 # You should have received a copy of the GNU General Public License
 # along with GNOME DVB Daemon.  If not, see <http://www.gnu.org/licenses/>.
 
-import gobject
 from gi.repository import Gtk
 from gnomedvb import global_error_handler
 from cgi import escape
@@ -56,16 +55,16 @@ class RunningNextStore(Gtk.ListStore):
                 sched = self._group.get_schedule(sid)
                 now = sched.now_playing()
                 if now != 0:
-                    next, name, duration, short_desc = sched.get_informations(now)[0][1:]
+                    next_id, name, duration, short_desc = sched.get_informations(now)[0][1:]
                     
                     self.set_value(aiter, self.COL_RUNNING_START, sched.get_local_start_timestamp(now)[0])
                     self.set_value(aiter, self.COL_RUNNING, escape(name))
                     self.set_value(aiter, self.COL_RUNNING_EVENT, now)
-                    if next != 0:
-                        name, duration, short_desc = sched.get_informations(next)[0][2:]
-                        self.set_value(aiter, self.COL_NEXT_START, sched.get_local_start_timestamp(next)[0])
+                    if next_id != 0:
+                        name, duration, short_desc = sched.get_informations(next_id)[0][2:]
+                        self.set_value(aiter, self.COL_NEXT_START, sched.get_local_start_timestamp(next_id)[0])
                         self.set_value(aiter, self.COL_NEXT, escape(name))
-                        self.set_value(aiter, self.COL_NEXT_EVENT, next)
+                        self.set_value(aiter, self.COL_NEXT_EVENT, next_id)
         
         channellist.get_channel_infos(result_handler=add_channels,
             error_handler=global_error_handler)
diff --git a/client/gnomedvb/ui/widgets/RunningNextView.py b/client/gnomedvb/ui/widgets/RunningNextView.py
index 1c0a660..6c624e7 100644
--- a/client/gnomedvb/ui/widgets/RunningNextView.py
+++ b/client/gnomedvb/ui/widgets/RunningNextView.py
@@ -81,7 +81,7 @@ class RunningNextView(Gtk.TreeView):
             data, success = result
             if not success:
                 return
-            event_id, next, name, duration, desc = data
+            event_id, next_id, name, duration, desc = data
             
             ext_desc, success = schedule.get_extended_description(event_id)
             if success:
diff --git a/client/gnomedvb/ui/widgets/ScheduleStore.py b/client/gnomedvb/ui/widgets/ScheduleStore.py
index cc90214..b8f43f7 100644
--- a/client/gnomedvb/ui/widgets/ScheduleStore.py
+++ b/client/gnomedvb/ui/widgets/ScheduleStore.py
@@ -83,7 +83,7 @@ class ScheduleStore(Gtk.ListStore):
         return (dt.hour, dt.minute,)
         
     def _append_event(self, event):
-        event_id, next, name, duration, short_desc = event
+        event_id, next_id, name, duration, short_desc = event
         name = escape(name)
         short_desc = escape(short_desc)
         
diff --git a/client/gnomedvb/ui/wizard/SetupWizard.py b/client/gnomedvb/ui/wizard/SetupWizard.py
index d979911..c0f8302 100644
--- a/client/gnomedvb/ui/wizard/SetupWizard.py
+++ b/client/gnomedvb/ui/wizard/SetupWizard.py
@@ -21,7 +21,6 @@ import gobject
 from gi.repository import Gtk
 from gettext import gettext as _
 from gnomedvb.DVBModel import DVBModel
-from gnomedvb.ui.wizard import DVB_TYPE_TO_DESC
 from gnomedvb.ui.wizard.pages.IntroPage import IntroPage
 from gnomedvb.ui.wizard.pages.AdaptersPage import AdaptersPage
 from gnomedvb.ui.wizard.pages.InitialTuningDataPage import InitialTuningDataPage
@@ -171,7 +170,7 @@ class SetupWizard(Gtk.Assistant):
                 success, summary = self.setup_page.get_summary()
             page.set_device_name_and_details(self.__adapter_info["name"],
                 summary, success)
-            self.__apdater_info = None
+            self.__adapter_info = None
 
         self.set_page_title(page, page.get_page_title())
         
diff --git a/client/gnomedvb/ui/wizard/pages/AdaptersPage.py b/client/gnomedvb/ui/wizard/pages/AdaptersPage.py
index 9c72946..adae44c 100644
--- a/client/gnomedvb/ui/wizard/pages/AdaptersPage.py
+++ b/client/gnomedvb/ui/wizard/pages/AdaptersPage.py
@@ -38,6 +38,7 @@ class AdaptersPage(BasePage):
         self.__use_configured = True
         self.__model = model
         self._progressbar = None
+        self._progressbar_timer = None
         self.devicesview = None
         self.frame = None
         
diff --git a/client/gnomedvb/ui/wizard/pages/ChannelScanPage.py b/client/gnomedvb/ui/wizard/pages/ChannelScanPage.py
index 1ff4a34..aab3390 100644
--- a/client/gnomedvb/ui/wizard/pages/ChannelScanPage.py
+++ b/client/gnomedvb/ui/wizard/pages/ChannelScanPage.py
@@ -16,7 +16,6 @@
 # You should have received a copy of the GNU General Public License
 # along with GNOME DVB Daemon.  If not, see <http://www.gnu.org/licenses/>.
 
-import gnomedvb
 from gi.repository import GdkPixbuf
 from gi.repository import Gtk
 import gobject
diff --git a/client/gnomedvb/ui/wizard/pages/InitialTuningDataPage.py b/client/gnomedvb/ui/wizard/pages/InitialTuningDataPage.py
index b4c98e8..9dc71aa 100644
--- a/client/gnomedvb/ui/wizard/pages/InitialTuningDataPage.py
+++ b/client/gnomedvb/ui/wizard/pages/InitialTuningDataPage.py
@@ -25,7 +25,6 @@ import gettext
 import locale
 from gettext import gettext as _
 from gnomedvb.ui.wizard.pages.BasePage import BasePage
-from gnomedvb.ui.widgets.Frame import TextFieldLabel
 
 DVB_APPS_DIRS = ("/usr/share/dvb",
                  "/usr/share/dvb-apps",



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