Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(14)  |  Call(10)  |  Derive(0)  |  Import(4)

        def info(s):
    print(colorize('[info] ', 'green', bold=True) + s)
        


src/m/p/mpdc-HEAD/mpdc/mpdc_database.py   mpdc(Download)
 
from mpdc.initialize import mpd, collectionsmanager, lastfm, cache, colors
from mpdc.libs.utils import repr_tags, info, warning, colorize
 
 
def lastfm_update_artists(args):
    tags = lastfm.artists_tags
    artists = sorted(mpd.list_artists())
    extra_artists = [artist for artist in tags if artist not in artists]
    info('{} extra artist(s)'.format(len(extra_artists)))
    else:
        missing_artists = artists
    info('{} missing artist(s)'.format(len(missing_artists)))
    for artist in missing_artists:
        print('Fetching {}'.format(artist))
def lastfm_update_albums(args):
    tags = lastfm.albums_tags
    albums = sorted(mpd.list_albums(), key=operator.itemgetter(1))
    extra_albums = [album for album in tags if album not in albums]
    info('{} extra album(s)'.format(len(extra_albums)))
    else:
        missing_albums = albums
    info('{} missing album(s)'.format(len(missing_albums)))
    for album, artist in missing_albums:
        print('Fetching {} / {}'.format(artist, album))

src/m/p/mpdc-HEAD/mpdc/mpdc_collections.py   mpdc(Download)
from mpdc.initialize import mpd, collectionsmanager, cache, colors, columns, \
                            enable_pager, pager
from mpdc.libs.utils import input_box, esc_quotes, info, warning, colorize, \
                            columns_width
from mpdc.libs.parser import parser
def show(args):
    if args.alias in collectionsmanager.c:
        collection = collectionsmanager.c[args.alias]
        if 'mpd_playlist' in collection:
            info('This collection is stored as a MPD playlist\n')
        elif 'sort' in collection:
            info('This collection is sorted automatically\n')
        elif 'special' in collection:
            info('This is a special collection\n')

src/m/p/mpdc-HEAD/mpdc/mpdc_configure.py   mpdc(Download)
from configparser import ConfigParser
 
from mpdc.libs.utils import info, warning
 
 
        with open(filepath, 'w') as configfile:
            config.write(configfile)
            info('Writing configuration file in: ' + filepath)
    except IOError:
        warning('Cannot write configuration file in: ' + filepath)
        with open(filepath, 'w') as configfile:
            config.write(configfile)
            info('Writing configuration file in: ' + filepath)
    except IOError:
        warning('Cannot write configuration file in: ' + filepath)

src/m/p/mpdc-HEAD/mpdc/libs/collectionsmanager.py   mpdc(Download)
 
from mpdc.initialize import mpd, cache
from mpdc.libs.utils import repr_tags, info, warning
 
 
                mpd.add_songs_stored_playlist(alias, songs_files)
        else:
            info('Collection [{}] will be created'.format(alias))
            self.collections[alias] = {}
            self.collections[alias]['songs'] = songs_files