Applied two patches from A. Tauch <contrib@maisondubonheur.com> (fixing to bugs) - thanks!

git-svn-id: svn://svn.berlios.de/gpodder@41 b0d088ad-0a06-0410-aad2-9ed5178a7e87
This commit is contained in:
Thomas Perl 2006-03-19 14:21:48 +00:00
parent d596c9c7ef
commit dd9e7dc990
4 changed files with 21 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Sun, 19 Mar 2006 15:11:32 +0100 <thp@perli.net>
+ Applied two patches from A. Tauch <contrib@maisondubonheur.com>:
* fix for local db writer's encoding -> is now really iso-8859-1)
* fixed race condition bug which made some episodes to disappear
Sat, 04 Mar 2006 21:36:56 +0100 <thp@perli.net>
+ Added channel info + general/advanced tabs to channel editor
+ Added channel info/edit button to gPodder main window view

View File

@ -12,6 +12,7 @@
#
import gtk
import thread
from xml.sax.saxutils import DefaultHandler
from xml.sax import make_parser
@ -31,9 +32,18 @@ from libpodcasts import podcastChannel
# TODO: while developing a new version, set this to "True"
debugging = True
# global lock for thread exclusion
globalLock = thread.allocate_lock()
def isDebugging():
return debugging
def getLock():
globalLock.acquire()
def releaseLock():
globalLock.release()
class gPodderLib( object):
gpodderdir = ""
downloaddir = ""

View File

@ -11,13 +11,15 @@
#
#
import codecs
from datetime import datetime
class writeLocalDB( object):
ofile = None
def __init__( self, filename, channel):
self.ofile = open( filename, "w")
self.ofile = codecs.open( filename, "w", 'iso-8859-1')
self.ofile.write( '<?xml version="1.0" encoding="ISO-8859-1"?>'+"\n")
self.ofile.write( '<!-- local download database, generated by gPodder -->'+"\n")
self.ofile.write( '<rss version="2.0">'+"\n")

View File

@ -63,6 +63,8 @@ class podcastChannel(object):
self.items.append( item)
def addDownloadedItem( self, item):
# no mulitithreaded access
libgpodder.getLock()
localdb = self.index_file
if libgpodder.isDebugging():
print "localdb: " + localdb
@ -77,6 +79,7 @@ class podcastChannel(object):
self.downloaded.items.append( item)
writeLocalDB( localdb, self.downloaded)
libgpodder.releaseLock()
def printChannel( self):
print '- Channel: "' + self.title + '"'