def load(): """ static method to create new settings class from xml file """ fname = os.path.expanduser("~")+"/.pyqlogger/settings.xml" if os.path.exists(fname): try: return XMLObject.instanceFromXml(open(fname).read()) except Exception, e: print "Couldn't read settings. Either empty of borken! (%s)"% e import traceback traceback.print_exc()
def load(): """ static method to create new settings class from xml file """ fname = os.path.expanduser("~") + "/.pyqlogger/settings.xml" if os.path.exists(fname): try: return XMLObject.instanceFromXml(open(fname).read()) except Exception, e: print "Couldn't read settings. Either empty of borken! (%s)" % e import traceback traceback.print_exc()
def load(parent): """ Create a fresh copy of initialized Manager class """ paths = ["/home/reflog/.pyqlogger/plugins","/usr/share/pyqlogger/plugins"] l = importClasses(paths, parent) sys.path += paths file = os.path.expanduser("~")+"/.pyqlogger/plugins.xml" if os.path.exists(file): try: m = XMLObject.instanceFromXml(open(file).read()) except Exception, e: parent.log.error("Couldn't read plugin data. Either empty of borken!",exc_info=1)
def load(parent): """ Create a fresh copy of initialized Manager class """ paths = [ "/home/reflog/.pyqlogger/plugins", "/usr/share/pyqlogger/plugins" ] l = importClasses(paths, parent) sys.path += paths file = os.path.expanduser("~") + "/.pyqlogger/plugins.xml" if os.path.exists(file): try: m = XMLObject.instanceFromXml(open(file).read()) except Exception, e: parent.log.error( "Couldn't read plugin data. Either empty of borken!", exc_info=1)