[conduit] Remove some print statements



commit c54188805fdafbbde133b42fee7f3014cd601298
Author: John Stowers <john stowers gmail com>
Date:   Wed Sep 22 18:02:00 2010 +1200

    Remove some print statements

 conduit/dataproviders/DataProvider.py       |    1 -
 conduit/dataproviders/HalFactory.py         |    9 +++++++++
 conduit/dataproviders/MediaPlayerFactory.py |    2 +-
 conduit/dataproviders/SimpleFactory.py      |    2 --
 conduit/modules/iPodModule/iPodModule.py    |   10 +++++++---
 5 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/conduit/dataproviders/DataProvider.py b/conduit/dataproviders/DataProvider.py
index 5fbb95f..bc27682 100644
--- a/conduit/dataproviders/DataProvider.py
+++ b/conduit/dataproviders/DataProvider.py
@@ -572,7 +572,6 @@ class DataProviderFactory(gobject.GObject):
         Emits the dataprovider-added signal for the given class with the
         given conctruction arguments
         """
-        print "emit_added",klass,initargs,category,customKey
         dpw = ModuleWrapper.ModuleWrapper(   
                     klass=klass,
                     initargs=initargs,
diff --git a/conduit/dataproviders/HalFactory.py b/conduit/dataproviders/HalFactory.py
index 2801ea4..8fe7db2 100644
--- a/conduit/dataproviders/HalFactory.py
+++ b/conduit/dataproviders/HalFactory.py
@@ -25,6 +25,8 @@ class HalFactory(SimpleFactory.SimpleFactory):
         self.vm = gio.volume_monitor_get()
 
     def _print_device(self, device):
+        return
+
         print "subsystem", device.get_subsystem()
         print "devtype", device.get_devtype()
         print "name", device.get_name()
@@ -44,10 +46,17 @@ class HalFactory(SimpleFactory.SimpleFactory):
     def _on_uevent(self, client, action, device):
         self._print_device(device)
         if action == "add":
+            log.debug("Device added")
+            self._maybe_new(device)
+        elif action == "change":
+            log.debug("Device changed")
             self._maybe_new(device)
         elif action == "remove":
+            log.debug("Device removed")
             sysfs_path = self.get_sysfs_path_for_device(device)
             self.item_removed(sysfs_path)
+        else:
+            log.info("Device unknown action: %s" % action)
 
     def _get_device_properties(self, device):
         props = {}
diff --git a/conduit/dataproviders/MediaPlayerFactory.py b/conduit/dataproviders/MediaPlayerFactory.py
index 3273caa..9ac2cf5 100644
--- a/conduit/dataproviders/MediaPlayerFactory.py
+++ b/conduit/dataproviders/MediaPlayerFactory.py
@@ -56,7 +56,7 @@ class MediaPlayerFactory(HalFactory.HalFactory):
                 self.item_added(sysfs_path, **props)
 
         except KeyError:
-            log.debug("Device not media player")
+            log.debug("Device not media player (%s)" % props.get("ID_SERIAL", props.get("ID_VENDOR","")))
 
     def get_mpi_access_protocol(self, props):
         return props.get(self.MPI_ACCESS_PROTOCOL[2], "")
diff --git a/conduit/dataproviders/SimpleFactory.py b/conduit/dataproviders/SimpleFactory.py
index d504dd3..c5573a9 100644
--- a/conduit/dataproviders/SimpleFactory.py
+++ b/conduit/dataproviders/SimpleFactory.py
@@ -20,9 +20,7 @@ class SimpleFactory(DataProvider.DataProviderFactory):
         idxs = []
         for klass in self.get_dataproviders(key, **kwargs):
             args = self.get_args(key, **kwargs)
-            print "emit_added"
             idx = self.emit_added(klass, args, cat)
-            print "emmitted"
             idxs.append(idx)
         self.items[key] = idxs
 
diff --git a/conduit/modules/iPodModule/iPodModule.py b/conduit/modules/iPodModule/iPodModule.py
index f41e83d..3a733e6 100644
--- a/conduit/modules/iPodModule/iPodModule.py
+++ b/conduit/modules/iPodModule/iPodModule.py
@@ -118,7 +118,6 @@ class iPhoneFactory(HalFactory.HalFactory):
 
     def get_category(self, key, **props):
         """ Return a category to contain these dataproviders """
-        print "get_category", props.get(PROPS_KEY_MOUNT)
         return DataProviderCategory.DataProviderCategory(
                     _get_apple_label(props),
                     _get_apple_icon(props),
@@ -126,16 +125,21 @@ class iPhoneFactory(HalFactory.HalFactory):
     
     def get_dataproviders(self, key, **props):
         """ Return a list of dataproviders for this class of device """
-        print "get_dataproviders", props.get(PROPS_KEY_MOUNT)
         return [IPodDummy, IPodPhotoSink]
 
     def get_args(self, key, **props):
-        print "get_args", props.get(PROPS_KEY_MOUNT)
         return (props[PROPS_KEY_MOUNT], key)
 
 class iPodFactory(MediaPlayerFactory.MediaPlayerFactory):
 
     def is_interesting(self, sysfs_path, props):
+        #FIXME:
+        #
+        # THIS ONLY WORKS DURING PROBE. NO IDEA WHY.
+        # When called in response to a Udev added event, gioVolumeMonitor does
+        # not return the newly added volumes. There appears to be some sort of
+        # race condition
+        #
         #just like rhythmbox, we let media-player-info do the matching, and
         #instead just check if it has told us that the media player uses the
         #ipod storage protocol



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