summaryrefslogtreecommitdiff
path: root/plugins/Tabs.py
diff options
context:
space:
mode:
authorjerous <jerous@gmail.com>2008-06-13 20:09:48 +0200
committerjerous <jerous@gmail.com>2008-06-13 20:09:48 +0200
commitdaa2b041a0d725ca7860bc3c617c39dcd361ea06 (patch)
tree4e84c77664f4f046274a59359d682e983b03f535 /plugins/Tabs.py
parent4119943efd6ff43fb2e15389102c61687ce94764 (diff)
fix when saving
Diffstat (limited to 'plugins/Tabs.py')
-rw-r--r--plugins/Tabs.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/plugins/Tabs.py b/plugins/Tabs.py
index be485e0..e0ebbab 100644
--- a/plugins/Tabs.py
+++ b/plugins/Tabs.py
@@ -78,13 +78,13 @@ class wgTabs(QtGui.QWidget):
save_dir=settings.get('tabs.dir', '/holy_grail')
fInfo=QtCore.QFileInfo(save_dir)
if fInfo.isDir():
- lyFName='%s/%s - %s.txt'%(save_dir,song.getArtist(),song.getTitle())
+ tabsFName='%s/%s - %s.txt'%(save_dir,song.getArtist(),song.getTitle())
else:
- lyFName=None
+ tabsFName=None
# does the file exist? if yes, read that one!
try:
# we have it: load, and return!
- file=open(lyFName, 'r')
+ file=open(tabsFName, 'r')
QtCore.QCoreApplication.postEvent(self, AddHtmlEvent(file.read()))
file.close()
self._fetchCnt=0
@@ -107,11 +107,14 @@ class wgTabs(QtGui.QWidget):
if ret:
txt='<pre>%s<br /><br /><a href="%s">%s</a></pre>'%(ret[0],ret[1],ret[1])
# save for later use!
- if lyFName:
+ if tabsFName:
# we can't save if the path isn't correct
- file=open(lyFName, 'w')
- file.write(ret[0])
- file.close()
+ try:
+ file=open(tabsFName, 'w')
+ file.write(ret[0])
+ file.close()
+ except:
+ pass
else:
txt="No tabs found :'("