Author: duncan
Date: Thu Nov 15 04:16:10 2007
New Revision: 10128

Log:
Some bug fixes from John's testing


Modified:
   branches/rel-1-7/freevo/src/config.py
   branches/rel-1-7/freevo/src/plugins/usb.py
   branches/rel-1-7/freevo/src/video/plugins/dvdbackup.py
   branches/rel-1/freevo/src/config.py
   branches/rel-1/freevo/src/plugins/usb.py
   branches/rel-1/freevo/src/video/plugins/dvdbackup.py

Modified: branches/rel-1-7/freevo/src/config.py
==============================================================================
--- branches/rel-1-7/freevo/src/config.py       (original)
+++ branches/rel-1-7/freevo/src/config.py       Thu Nov 15 04:16:10 2007
@@ -121,7 +121,8 @@
 
     def write(self, msg):
         global lock
-        lock.acquire()
+        if lock:
+            lock.acquire()
         try:
             if isinstance(msg, unicode):
                 msg = msg.encode(LOCALE, 'replace')
@@ -130,7 +131,8 @@
             self.fp.write(msg)
             self.fp.flush()
         finally:
-            lock.release()
+            if lock:
+                lock.release()
         return
 
     def log(self, msg):
@@ -398,7 +400,8 @@
         return
     global lock
     global DEBUG_STDOUT
-    lock.acquire()
+    if lock:
+        lock.acquire()
     try:
         try:
             # add the current trace to the string
@@ -426,7 +429,8 @@
         except Exception, e:
             print "_debug_ failed: %r" % e
     finally:
-        lock.release()
+        if lock:
+            lock.release()
 
 
 __builtin__.__dict__['_debug_'] = _debug_function_

Modified: branches/rel-1-7/freevo/src/plugins/usb.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugins/usb.py  (original)
+++ branches/rel-1-7/freevo/src/plugins/usb.py  Thu Nov 15 04:16:10 2007
@@ -77,7 +77,7 @@
             try:
                 self.devices.remove(d)
             except ValueError:
-                print 'usb.py: new device %s' %d
+                _debug_('new device %s' % (d))
                 for device, message, action in config.USB_HOTPLUG:
                     if d == device:
                         pop = PopupBox(text=message)
@@ -90,7 +90,7 @@
 
         for d in self.devices:
             changes = True
-            print 'usb.py: removed device %s' % d
+            _debug_('removed device %s' % (d))
 
         if changes:
             rc.post_event(plugin.event('USB'))

Modified: branches/rel-1-7/freevo/src/video/plugins/dvdbackup.py
==============================================================================
--- branches/rel-1-7/freevo/src/video/plugins/dvdbackup.py      (original)
+++ branches/rel-1-7/freevo/src/video/plugins/dvdbackup.py      Thu Nov 15 
04:16:10 2007
@@ -99,7 +99,7 @@
         #title = int(self.item.url[6:])
         fname = join(config.VIDEO_ITEMS[0][1], "%s_%s.avi" % 
(self.item.parent.name, self.title))
         #_debug_('title=%s, fname=%s' % (title, fname))
-        _debug_('arg=%r' % (arg))
+        _debug_('arg=%r' % (arg,))
         #unwrap settings tupple
         vcodecnr, tgtsize, mpass, vbitrate = arg
 

Modified: branches/rel-1/freevo/src/config.py
==============================================================================
--- branches/rel-1/freevo/src/config.py (original)
+++ branches/rel-1/freevo/src/config.py Thu Nov 15 04:16:10 2007
@@ -121,7 +121,8 @@
 
     def write(self, msg):
         global lock
-        lock.acquire()
+        if lock:
+            lock.acquire()
         try:
             if isinstance(msg, unicode):
                 msg = msg.encode(LOCALE, 'replace')
@@ -130,7 +131,8 @@
             self.fp.write(msg)
             self.fp.flush()
         finally:
-            lock.release()
+            if lock:
+                lock.release()
         return
 
     def log(self, msg):
@@ -432,7 +434,8 @@
         return
     global lock
     global DEBUG_STDOUT
-    lock.acquire()
+    if lock:
+        lock.acquire()
     try:
         try:
             # add the current trace to the string
@@ -460,7 +463,8 @@
         except Exception, e:
             print "_debug_ failed: %r" % e
     finally:
-        lock.release()
+        if lock:
+            lock.release()
 
 
 __builtin__.__dict__['_debug_'] = _debug_function_

Modified: branches/rel-1/freevo/src/plugins/usb.py
==============================================================================
--- branches/rel-1/freevo/src/plugins/usb.py    (original)
+++ branches/rel-1/freevo/src/plugins/usb.py    Thu Nov 15 04:16:10 2007
@@ -77,7 +77,7 @@
             try:
                 self.devices.remove(d)
             except ValueError:
-                print 'usb.py: new device %s' %d
+                _debug_('new device %s' % (d))
                 for device, message, action in config.USB_HOTPLUG:
                     if d == device:
                         pop = PopupBox(text=message)
@@ -90,7 +90,7 @@
 
         for d in self.devices:
             changes = True
-            print 'usb.py: removed device %s' % d
+            _debug_('removed device %s' % (d))
 
         if changes:
             rc.post_event(plugin.event('USB'))

Modified: branches/rel-1/freevo/src/video/plugins/dvdbackup.py
==============================================================================
--- branches/rel-1/freevo/src/video/plugins/dvdbackup.py        (original)
+++ branches/rel-1/freevo/src/video/plugins/dvdbackup.py        Thu Nov 15 
04:16:10 2007
@@ -99,7 +99,7 @@
         #title = int(self.item.url[6:])
         fname = join(config.VIDEO_ITEMS[0][1], "%s_%s.avi" % 
(self.item.parent.name, self.title))
         #_debug_('title=%s, fname=%s' % (title, fname))
-        _debug_('arg=%r' % (arg))
+        _debug_('arg=%r' % (arg,))
         #unwrap settings tupple
         vcodecnr, tgtsize, mpass, vbitrate = arg
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to