+
+
+def print_list(group):
+ """
+ Display a list
+ """
+ for grp in group:
+ # Format
+ name = grp['full_name']
+ name = color_func(c['GROUP']['name'])(name + ' : ')
+ member = str(grp['member_count'])
+ member = color_func(c['GROUP']['member'])(member + ' member')
+ subscriber = str(grp['subscriber_count'])
+ subscriber = color_func(
+ c['GROUP']['subscriber'])(
+ subscriber +
+ ' subscriber')
+ description = grp['description'].strip()
+ description = color_func(c['GROUP']['description'])(description)
+ mode = grp['mode']
+ mode = color_func(c['GROUP']['mode'])('Type: ' + mode)
+ created_at = grp['created_at']
+ date = parser.parse(created_at)
+ date = date - datetime.timedelta(seconds=time.timezone)
+ clock = date.strftime('%Y/%m/%d %H:%M:%S')
+ clock = 'Created at ' + color_func(c['GROUP']['clock'])(clock)
+
+ # Create lines
+ line1 = ' ' * 2 + name + member + ' ' + subscriber
+ line2 = ' ' * 4 + description
+ line3 = ' ' * 4 + mode
+ line4 = ' ' * 4 + clock
+
+ # Display
+ printNicely('')
+ printNicely(line1)
+ printNicely(line2)
+ printNicely(line3)
+ printNicely(line4)
+
+ printNicely('')
+
+
+def show_calendar(month, date, rel):
+ """
+ Show the calendar in rainbow mode
+ """
+ month = random_rainbow(month)
+ date = ' '.join([cycle_color(i) for i in date.split(' ')])
+ today = str(int(os.popen('date +\'%d\'').read().strip()))
+ # Display
+ printNicely(month)
+ printNicely(date)
+ for line in rel:
+ ary = line.split(' ')
+ ary = lmap(
+ lambda x: color_func(c['CAL']['today'])(x)
+ if x == today
+ else color_func(c['CAL']['days'])(x),
+ ary)
+ printNicely(' '.join(ary))
+
+
+# Start the color cycle
+start_cycle()