View Single Post
Old 04-22-2008, 03:21 PM   #202
astrodad
Guru
astrodad ought to be getting tired of karma fortunes by now.astrodad ought to be getting tired of karma fortunes by now.astrodad ought to be getting tired of karma fortunes by now.astrodad ought to be getting tired of karma fortunes by now.astrodad ought to be getting tired of karma fortunes by now.astrodad ought to be getting tired of karma fortunes by now.astrodad ought to be getting tired of karma fortunes by now.astrodad ought to be getting tired of karma fortunes by now.astrodad ought to be getting tired of karma fortunes by now.astrodad ought to be getting tired of karma fortunes by now.astrodad ought to be getting tired of karma fortunes by now.
 
astrodad's Avatar
 
Posts: 962
Karma: 568242
Join Date: Dec 2007
Device: Kindle Oasis 3, Kindle Paperwhite 1, iPad, iPhone
Kovid,

I've created a new class called DefaultTagEditor and I think I have the right code to implement TagEditor so that I can override the _init_ to change the way it reads the existing tags. I'm getting an error, though. Here's the code:
Quote:
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
from PyQt4.QtCore import SIGNAL, Qt
from PyQt4.QtGui import QDialog, QMessageBox

from libprs500.gui2.dialogs.tag_editor_ui import Ui_TagEditor
from libprs500.gui2 import qstring_to_unicode
from libprs500.gui2 import question_dialog, error_dialog
from libprs500.gui2.dialogs import TagEditor

class DefaultTagEditor(QDialog, Ui_TagEditor, TagEditor):

def __init__(self, window, db, tagStrings):
QDialog.__init__(self, window)
Here's the error:
Quote:
Traceback (most recent call last):
File "/home/javier/workspace/libprs500/src/libprs500/gui2/main.py", line 34, in <module>
from libprs500.gui2.dialogs.config import ConfigDialog
File "/home/javier/workspace/libprs500/src/libprs500/gui2/dialogs/config.py", line 12, in <module>
from libprs500.gui2.dialogs.default_tag_editor import DefaultTagEditor
File "/home/javier/workspace/libprs500/src/libprs500/gui2/dialogs/default_tag_editor.py", line 9, in <module>
from libprs500.gui2.dialogs import TagEditor
ImportError: cannot import name TagEditor
astrodad is offline   Reply With Quote