Plugin Developer Question
I have one piece of code that for support purposes, plays 3 roles. First it can be run standalone as a command line tool, second it can be imported into other python code (for code reuse) and last it can be a plugin for calibre.
I can use __name__ = '__main__' for detecting it as a standalone, but I need to a way to determine if imported from some other python code versus imported by the calibre python code.
So is there some string in __name__ that will definitely tell me I am being imported as a plugin from calibre code that won't change with where calibre is installed or from version to version of calibre (because keeping up with your release schedule would kill any normal human being).