]> kaliko git repositories - mpd-sima.git/blob - sima/plugins/internal/crop.py
Allow choosing internal plugins from config file
[mpd-sima.git] / sima / plugins / internal / crop.py
1 # -*- coding: utf-8 -*-
2 """Crops playlist
3 """
4
5 # standart library import
6 #from select import select
7
8 # third parties componants
9
10 # local import
11 from ...lib.plugin import Plugin
12
13 class Crop(Plugin):
14     """
15     Crop playlist on next track
16     kinda MPD's consume
17     """
18
19     def callback_playlist(self):
20         player = self._Plugin__daemon.player
21         target_lengh = 10
22         while player.currentsong().pos > target_lengh:
23             self.log.debug('cropping playlist')
24             player.remove()
25
26
27 # VIM MODLINE
28 # vim: ai ts=4 sw=4 sts=4 expandtab