'sw': ['-n', '--nbtracks'],
'type': 'int',
'dest': 'nb_tracks',
- 'default': 60,
+ 'default': 6,
'metavar': '<n>',
'help': 'keep <n> tracks before currently played.'},
])
"""
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()