View Single Post
Old 03-29-2014, 10:21 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,419
Karma: 27757236
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can just do this:

Code:
try:
    from calibre_plugins.count_pages.common_utils import (get_library_uuid, CustomColumnComboBox,
                                     KeyboardConfigDialog, KeyValueComboBox, PrefsViewerDialog)
except ImportError:
    from common_utils import (get_library_uuid, CustomColumnComboBox,
                                     KeyboardConfigDialog, KeyValueComboBox, PrefsViewerDialog)
And if you want to detect if you are running in a full calibre environment, use this:

Code:
import sys
in_calibre = hasattr(sys, 'extensions_location')

Last edited by kovidgoyal; 03-29-2014 at 11:48 PM.
kovidgoyal is online now   Reply With Quote