ui: Fixed python code style
[maevies] / ui / maeviesui / util / moviemanager.py
index 4689eee..d5148c9 100644 (file)
@@ -36,7 +36,7 @@ WATC = 1
 
 class MovieManager:
 
-    def __init__(self, response_received_cb = None):
+    def __init__(self, response_received_cb=None):
         self.response_received_cb = response_received_cb
         self._bus = None
         self._provider = None
@@ -52,12 +52,12 @@ class MovieManager:
         provider_proxy = self._bus.get_object(MINFO_PROVIDER_BUS_NAME,
                                              '/MInfoProvider')
         provider_interface = dbus.Interface(provider_proxy,
-                                            dbus_interface = MINFO_PROVIDER_INTERFACE)
-        provider_interface.connect_to_signal("ResponseReceived",
+                                            dbus_interface=MINFO_PROVIDER_INTERFACE)
+        provider_interface.connect_to_signal('ResponseReceived',
                                              self._on_response_received)
         return provider_interface
 
-    def query(self, movie_name = '', query_type = TMDB):
+    def query(self, movie_name='', query_type=TMDB):
         try:
             self._get_provider().Query(query_type, movie_name)
         except DBusException:
@@ -76,26 +76,26 @@ class MovieProxy:
     def __init__(self, bus, object_path):
         self._bus = bus
         self.interface = self._create_movie_interface(object_path)
-        self.fields = ["Title", "Release date", "Rating", "Popularity"]
+        self.fields = ['Title', 'Release date', 'Rating', 'Popularity']
 
     def _create_movie_interface(self, object_path):
         proxy = self._bus.get_object(TMDB_MOVIE_BUS_NAME,
                                     object_path)
         interface = dbus.Interface(proxy,
-                                   dbus_interface = TMDB_MOVIE_INTERFACE)
+                                   dbus_interface=TMDB_MOVIE_INTERFACE)
         return interface
 
     def get_value(self, field):
-        if field == "Title":
+        if field == 'Title':
             return self.get_title()
-        elif field == "Release date":
+        elif field == 'Release date':
             return self.get_released()
-        elif field == "Rating":
+        elif field == 'Rating':
             return self.get_rating()
-        elif field == "Popularity":
+        elif field == 'Popularity':
             return self.get_popularity()
         else:
-            return ""
+            return ''
 
     def get_title(self):
         return self.interface.GetTitle()
@@ -110,11 +110,13 @@ class MovieProxy:
         return self.interface.GetReleased()
 
     def get_info(self):
-        return "<b>%(title)s</b>\n<small><i>Popularity: </i>%(popularity)s\
-    <i>Rating: </i>%(rating)s    <i>Released: </i>%(released)s</small>" % {'title' : self.get_title(),
-                                                                           'popularity' : self.get_popularity(),
-                                                                           'rating' : self.get_rating(),
-                                                                           'released' : self.get_released()}
+        return ('<b>%(title)s</b>\n<small><i>Popularity: </i>%(popularity)s'
+                '    <i>Rating: </i>%(rating)s    <i>Released: </i>'
+                '%(released)s</small>' %
+                {'title' : self.get_title(),
+                 'popularity' : self.get_popularity(),
+                 'rating' : self.get_rating(),
+                 'released' : self.get_released()})
 
     def get_overview(self):
         return self.interface.GetOverview()