#!/usr/bin/env python3
# -*- coding: utf-8 -*-
+"""Core Object dealing with plugins and player client
+"""
+
+__version__ = '0.12.0.b'
+__author__ = 'kaliko jack'
+__url__ = 'git://git.kaliko.me/sima.git'
+
+from logging import getLogger
from .client import PlayerClient
"""
def __init__(self):
+ self.log = getLogger('sima')
self.plugins = list()
self.player = None
self.connect_player()
+ self.current_track = None
def register_plugin(self, plugin_class):
self.plugins.append(plugin_class(self))
getattr(plugin, method)(*args, **kwds)
def connect_player(self):
- """Instanciate player client and connect it
+ """Instanciate player client and connect
"""
self.player = PlayerClient() # Player client
self.player.connect()
def run(self):
"""Dispatching callbacks to plugins
"""
- print(self.player.status())
+ self.log.debug(self.player.status())
+ self.log.info(self.player.current)
while 42:
# hanging here untill a monitored event is raised in the player
changed = self.player.monitor()
- print(changed)
- print(self.player.current)
if 'playlist' in changed:
self.foreach_plugin('callback_playlist')
if 'player' in changed:
- pass
-
+ self.log.info(self.player.current)
# VIM MODLINE