+
+
+def show_profile(u):
+ """
+ Show a profile
+ """
+ # Retrieve info
+ name = u['name']
+ screen_name = u['screen_name']
+ description = u['description']
+ profile_image_url = u['profile_image_url']
+ location = u['location']
+ url = u['url']
+ created_at = u['created_at']
+ statuses_count = u['statuses_count']
+ friends_count = u['friends_count']
+ followers_count = u['followers_count']
+ # Create content
+ statuses_count = green(str(statuses_count) + ' tweets')
+ friends_count = green(str(friends_count) + ' following')
+ followers_count = green(str(followers_count) + ' followers')
+ count = statuses_count + ' ' + friends_count + ' ' + followers_count
+ user = cycle_color(name) + grey(' ' + screen_name + ' : ') + count
+ profile_image_url = 'Profile photo: ' + cyan(profile_image_url)
+ description = ''.join(map(lambda x: x+' '*4 if x=='\n' else x,description))
+ description = yellow(description)
+ location = 'Location : ' + magenta(location)
+ url = 'URL : ' + (cyan(url) if url else '')
+ created_at = 'Join at ' + white(created_at)
+ # Format
+ line1 = u"{u:>{uw}}".format(
+ u=user,
+ uw=len(user) + 2,
+ )
+ line2 = u"{p:>{pw}}".format(
+ p=profile_image_url,
+ pw=len(profile_image_url) + 4,
+ )
+ line3 = u"{d:>{dw}}".format(
+ d=description,
+ dw=len(description) + 4,
+ )
+ line4 = u"{l:>{lw}}".format(
+ l=location,
+ lw=len(location) + 4,
+ )
+ line5 = u"{u:>{uw}}".format(
+ u=url,
+ uw=len(url) + 4,
+ )
+ line6 = u"{j:>{jw}}".format(
+ j=created_at,
+ jw=len(created_at) + 4,
+ )
+ # Display
+ printNicely('')
+ for line in [line1,line2,line3,line4,line5,line6]:
+ printNicely(line)
+ printNicely('')
+