Ejemplo n.º 1
0
def manual_search(singleton):
    """Input either an artist and album (for full albums) or artist and
    track name (for singletons) for manual search.
    """
    artist = input_('Artist:')
    name = input_('Track:' if singleton else 'Album:')
    return artist.strip(), name.strip()
Ejemplo n.º 2
0
def manual_search(singleton):
    """Input either an artist and album (for full albums) or artist and
    track name (for singletons) for manual search.
    """
    artist = input_('Artist:')
    name = input_('Track:' if singleton else 'Album:')
    return artist.strip(), name.strip()
Ejemplo n.º 3
0
def automigrate():
    """Migrate the configuration, database, and state files. If any
    migration occurs, print out a notice with some helpful next steps.
    """
    config_fn = migrate_config()
    db_fn = migrate_db()
    migrate_state()

    if config_fn:
        ui.print_(ui.colorize('fuchsia', u'MIGRATED CONFIGURATION'))

        ui.print_(
            CONFIG_MIGRATED_MESSAGE.format(
                newconfig=util.displayable_path(config_fn)))
        if db_fn:
            ui.print_(
                DB_MIGRATED_MESSAGE.format(newdb=util.displayable_path(db_fn)))

        ui.input_(ui.colorize('fuchsia', u'Press ENTER to continue:'))
        ui.print_()
Ejemplo n.º 4
0
def automigrate():
    """Migrate the configuration, database, and state files. If any
    migration occurs, print out a notice with some helpful next steps.
    """
    config_fn = migrate_config()
    db_fn = migrate_db()
    migrate_state()

    if config_fn:
        ui.print_(ui.colorize('fuchsia', u'MIGRATED CONFIGURATION'))

        ui.print_(CONFIG_MIGRATED_MESSAGE.format(
            newconfig=util.displayable_path(config_fn))
        )
        if db_fn:
            ui.print_(DB_MIGRATED_MESSAGE.format(
                newdb=util.displayable_path(db_fn)
            ))

        ui.input_(ui.colorize('fuchsia', u'Press ENTER to continue:'))
        ui.print_()
Ejemplo n.º 5
0
def manual_id(singleton):
    """Input a MusicBrainz ID, either for an album ("release") or a
    track ("recording"). If no valid ID is entered, returns None.
    """
    prompt = "Enter MusicBrainz %s ID:" % ("recording" if singleton else "release")
    entry = input_(prompt).strip()

    # Find the first thing that looks like a UUID/MBID.
    match = re.search("[a-f0-9]{8}(-[a-f0-9]{4}){3}-[a-f0-9]{12}", entry)
    if match:
        return match.group()
    else:
        log.error("Invalid MBID.")
        return None
Ejemplo n.º 6
0
def manual_id(singleton):
    """Input a MusicBrainz ID, either for an album ("release") or a
    track ("recording"). If no valid ID is entered, returns None.
    """
    prompt = 'Enter MusicBrainz %s ID:' % \
             ('recording' if singleton else 'release')
    entry = input_(prompt).strip()

    # Find the first thing that looks like a UUID/MBID.
    match = re.search('[a-f0-9]{8}(-[a-f0-9]{4}){3}-[a-f0-9]{12}', entry)
    if match:
        return match.group()
    else:
        log.error('Invalid MBID.')
        return None
Ejemplo n.º 7
0
 def set_albumartist(self, default_albumartist):
   input_options = None
   if self.albumartist is None or self.albumartist == "":
     self.albumartist = default_albumartist
     input_options = (u'Accept as-is', u'Edit')
     ui.print_(u'Default Virtual Album Artist:')
   else:
     if self.albumartist == default_albumartist:
       input_options = (u'Accept as-is', u'Edit')
     else:
       input_options = (u'Accept as-is', u'Edit', u'Default value')
     ui.print_(u'Current Virtual Album Artist:')
   ui.print_(u'    {}'.format(self.albumartist))
   
   sel = ui.input_options(input_options)
   if sel == u'a':
     pass
   elif sel == u'e':
     self.albumartist = ui.input_(u'Virtual Album Artist:').strip()
   elif sel == u'd':
     self.albumartist = default_albumartist
   else:
     assert False
Ejemplo n.º 8
0
def manual_id(singleton):
    """Input an ID, either for an album ("release") or a track ("recording").
    """
    prompt = u'Enter {0} ID:'.format('recording' if singleton else 'release')
    return input_(prompt).strip()
Ejemplo n.º 9
0
def manual_id(singleton):
    """Input an ID, either for an album ("release") or a track ("recording").
    """
    prompt = 'Enter %s ID:' % \
             ('recording' if singleton else 'release')
    return input_(prompt).strip()
Ejemplo n.º 10
0
 def set_url():
     url = ui.input_('Enter rateyourmusic url:')
     return { 'href': url }
Ejemplo n.º 11
0
 def set_url():
     url = ui.input_('Enter rateyourmusic url:')
     return {'href': url}