]> kaliko git repositories - mpd-goodies.git/blobdiff - crop
* [mfade] convert mfade to use the new framework
[mpd-goodies.git] / crop
diff --git a/crop b/crop
index 4a77bbbdcdccc2a3ff006b8d95b9ec1807d082b6..9a08eb1e0b2c743f9e784e1850a4b3e4330db5d5 100755 (executable)
--- a/crop
+++ b/crop
@@ -32,7 +32,7 @@ CROP_OPTS = list([
         'sw': ['-n', '--nbtracks'],
         'type': 'int',
         'dest': 'nb_tracks',
-        'default': 60,
+        'default': 6,
         'metavar': '<n>',
         'help': 'keep <n> tracks before currently played.'},
     ])
@@ -42,20 +42,20 @@ class Crop(StartOpt, MPDClass):
     """
     script_info = dict({
         'version': VERSION,
-        'prog_name': 'crop',
+        'prog_name': NAME,
         'description': 'Keep <n> tracks before currently played, removed others.',
         })
 
     def __init__(self):
         """"""
-        StartOpt.__init__(self, Crop.script_info, CROP_OPTS)
+        StartOpt.__init__(self, self.__class__.script_info, CROP_OPTS)
         MPDClass.__init__(self)
         self._run()
 
     def _run(self):
         """"""
         print 'Connecting %s:%i' % (self.cli_options.host, self.cli_options.port)
-        self.mpdConnect({'host':self.cli_options.host, 'port':self.cli_options.port})
+        self.mpdConnect()
         current_pos = int(self.client.currentsong().get('pos'))
         if current_pos <=  self.cli_options.nb_tracks:
             self.client.disconnect()