def format_quote(tweet):
 screen_name = tweet['user']['screen_name']
 text = tweet['text']
 tid = str(tweet['id'])
 if ('#owner' not in c['QUOTE_FORMAT']):
  printNicely(light_magenta('Quote should contains #owner'))
  return False
 if ('#comment' not in c['QUOTE_FORMAT']):
  printNicely(light_magenta('Quote format should have #comment'))
  return False
 formater = ''
 try:
  formater = c['QUOTE_FORMAT']
  formater = formater.replace('#owner', screen_name)
  formater = formater.replace('#tweet', text)
  formater = formater.replace('#tid', tid)
  formater = emojize(formater)
 except:
  pass
 notice = formater.split()
 notice = lmap((lambda x: (light_green(x) if (x == '#comment') else x)), notice)
 notice = lmap((lambda x: (color_func(c['TWEET']['rt'])(x) if (x == 'RT') else x)), notice)
 notice = lmap((lambda x: (cycle_color(x) if (x[0] == '@') else x)), notice)
 notice = lmap((lambda x: (color_func(c['TWEET']['link'])(x) if (x[0:4] == 'http') else x)), notice)
 notice = lmap((lambda x: (color_func(c['TWEET']['hashtag'])(x) if x.startswith('#') else x)), notice)
 notice = ' '.join(notice)
 notice = ((light_magenta('Quoting: "') + notice) + light_magenta('"'))
 printNicely(notice)
 return formater

def format_quote ( tweet ) : screen_name = tweet [ 'user' ] [ 'screen_name' ] text = tweet [ 'text' ] tid = str ( tweet [ 'id' ] ) if ( '#owner' not in c [ 'QUOTE_FORMAT' ] ) : printNicely ( light_magenta ( 'Quote should contains #owner' ) ) return False if ( '#comment' not in c [ 'QUOTE_FORMAT' ] ) : printNicely ( light_magenta ( 'Quote format should have #comment' ) ) return False formater = '' try : formater = c [ 'QUOTE_FORMAT' ] formater = formater . replace ( '#owner' , screen_name ) formater = formater . replace ( '#tweet' , text ) formater = formater . replace ( '#tid' , tid ) formater = emojize ( formater ) except : pass notice = formater . split ( ) notice = lmap ( ( lambda x : ( light_green ( x ) if ( x == '#comment' ) else x ) ) , notice ) notice = lmap ( ( lambda x : ( color_func ( c [ 'TWEET' ] [ 'rt' ] ) ( x ) if ( x == 'RT' ) else x ) ) , notice ) notice = lmap ( ( lambda x : ( cycle_color ( x ) if ( x [ 0 ] == '@' ) else x ) ) , notice ) notice = lmap ( ( lambda x : ( color_func ( c [ 'TWEET' ] [ 'link' ] ) ( x ) if ( x [ 0 : 4 ] == 'http' ) else x ) ) , notice ) notice = lmap ( ( lambda x : ( color_func ( c [ 'TWEET' ] [ 'hashtag' ] ) ( x ) if x . startswith ( '#' ) else x ) ) , notice ) notice = ' ' . join ( notice ) notice = ( ( light_magenta ( 'Quoting: "' ) + notice ) + light_magenta ( '"' ) ) printNicely ( notice ) return formater
returns a formatted string of a quote .