Tue, 15 Jul 2008 10:08:16 +0200 <thp@perli.net>

Fix bugs and annoyances when no channels.opml file exists

	* src/gpodder/opml.py: Make sure can save a new channels.opml file
	when no other file exists, and make sure we don't try to parse a file
	that does not exist when opening OPML files



git-svn-id: svn://svn.berlios.de/gpodder/trunk@775 b0d088ad-0a06-0410-aad2-9ed5178a7e87
This commit is contained in:
Thomas Perl 2008-07-15 08:09:18 +00:00
parent e352cb7db2
commit e0828d8fde
2 changed files with 14 additions and 3 deletions

View file

@ -1,3 +1,10 @@
Tue, 15 Jul 2008 10:08:16 +0200 <thp@perli.net>
Fix bugs and annoyances when no channels.opml file exists
* src/gpodder/opml.py: Make sure can save a new channels.opml file
when no other file exists, and make sure we don't try to parse a file
that does not exist when opening OPML files
Tue, 15 Jul 2008 10:06:19 +0200 <thp@perli.net>
Do not hide podcast cover and pill pixbuf in podcast list by default

View file

@ -76,9 +76,13 @@ class Importer(object):
"""
self.items = []
try:
if os.path.exists( url):
if url.startswith('/'):
# assume local filename
doc = xml.dom.minidom.parse( url)
if os.path.exists(url):
doc = xml.dom.minidom.parse( url)
else:
log('Empty/non-existing OPML file', sender=self)
return
else:
doc = xml.dom.minidom.parseString( self.read_url( url))
@ -200,7 +204,7 @@ class Exporter(object):
# try to save the new file, but keep the old one so we
# don't end up with a clobbed, empty opml file.
FREE_DISK_SPACE_AFTER = 1024*512
if util.get_free_disk_space(self.filename) < 2*len(data)+FREE_DISK_SPACE_AFTER:
if util.get_free_disk_space(os.path.dirname(self.filename)) < 2*len(data)+FREE_DISK_SPACE_AFTER:
log('Not enough free disk space to save channel list to %s', self.filename, sender = self)
return False
fp = open(self.filename+'.tmp', 'w')