X-Git-Url: http://git.kaliko.me/?p=mpd-goodies.git;a=blobdiff_plain;f=src%2Fmfade;fp=mfade;h=0ffd9dfd452184331e720c0ef8aaefc4a943b8ef;hp=de84f141dfc21be9cfc252af9bd885b179a2a0e8;hb=8c680f357953b22043895a3b49f9e58981504669;hpb=6729b0a3c9607c8ee6a8dd352ec601ad22cacaf2 diff --git a/mfade b/src/mfade similarity index 92% rename from mfade rename to src/mfade index de84f14..0ffd9df 100755 --- a/mfade +++ b/src/mfade @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (c) 2009, 2010 Efrim {{{ +# Copyright (c) 2009, 2010 Efrim # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# }}} """ DOC: @@ -49,16 +48,16 @@ class Sleep(StartOpt, MPDClass): 'usage': USAGE, }) - def __init__(self):#{{{ + def __init__(self): """""" StartOpt.__init__(self, self.__class__.script_info, []) MPDClass.__init__(self) self.tempo = int(10) self.volum = None self._consume_args() - self._run()#}}} + self._run() - def _consume_args(self):#{{{ + def _consume_args(self): """""" if (len(self.cli_args) < 1 or len(self.cli_args) > 2): @@ -69,9 +68,9 @@ class Sleep(StartOpt, MPDClass): except IndexError: pass except ValueError, err: - self.parser.error('wrong option passed (%s)' % err)#}}} + self.parser.error('wrong option passed (%s)' % err) - def _run(self):#{{{ + def _run(self): """""" self.mpdConnect() self.mpd_state = str(self.client.status().get('state')) @@ -92,9 +91,9 @@ class Sleep(StartOpt, MPDClass): self.mpd_vol = 0 self.client.play() self.fade() - sleep(1)#}}} + sleep(1) - def fade(self):#{{{ + def fade(self): """""" # TODO: handle possible lost connections span = float(self.volum - self.mpd_vol) @@ -109,7 +108,7 @@ class Sleep(StartOpt, MPDClass): if abs(vol - self.volum) < 1: self.client.setvol(self.volum) return True - sleep(1)#}}} + sleep(1) # Script starts here