def __init__(self): """Create a new gPodder API instance Connects to the database and loads the configuration. """ util.make_directory(gpodder.home) gpodder.load_plugins() self._db = dbsqlite.Database(gpodder.database_file) self._config = config.Config(gpodder.config_file)
def __init__(self, config_class=config.Config, database_class=dbsqlite.Database, model_class=model.Model): # Initialize the gPodder home directory util.make_directory(gpodder.home) # Open the database and configuration file self.db = database_class(gpodder.database_file) self.model = model_class(self.db) self.config = config_class(gpodder.config_file) # Load extension modules and install the extension manager gpodder.user_extensions = extensions.ExtensionManager(self) # Load installed/configured plugins gpodder.load_plugins() # Update the current device in the configuration self.config.mygpo.device.type = util.detect_device_type()
def __init__(self, config_class=config.Config, database_class=dbsqlite.Database, model_class=model.Model): # Initialize the gPodder home directory util.make_directory(gpodder.home) # Load hook modules and install the hook manager gpodder.user_hooks = hooks.HookManager() # Load installed/configured plugins gpodder.load_plugins() # Open the database and configuration file self.db = database_class(gpodder.database_file) self.model = model_class(self.db) self.config = config_class(gpodder.config_file) # Update the current device in the configuration self.config.mygpo_device_type = util.detect_device_type()
def __init__(self, config_class=config.Config, database_class=dbsqlite.Database, model_class=model.Model): # Initialize the gPodder home directory util.make_directory(gpodder.home) # Open the database and configuration file self.db = database_class(gpodder.database_file) self.model = model_class(self.db) self.config = config_class(gpodder.config_file) # Load extension modules and install the extension manager gpodder.user_extensions = extensions.ExtensionManager(self) # Load installed/configured plugins gpodder.load_plugins() # Update the current device in the configuration self.config.mygpo.device.type = util.detect_device_type() # Initialize Flattr integration self.flattr = flattr.Flattr(self.config.flattr)