def collect_emojis():
 emojis = dict()
 full_path = os.path.join(_basedir, 'static', 'emoji')
 if (not os.path.exists(full_path)):
  return emojis
 for emoji in os.listdir(full_path):
  (name, ending) = emoji.split('.')
  if (ending in ['png', 'gif', 'jpg', 'jpeg']):
   emojis[name] = emoji
 return emojis

def collect_emojis ( ) : emojis = dict ( ) full_path = os . path . join ( _basedir , 'static' , 'emoji' ) if ( not os . path . exists ( full_path ) ) : return emojis for emoji in os . listdir ( full_path ) : ( name , ending ) = emoji . split ( '.' ) if ( ending in [ 'png' , 'gif' , 'jpg' , 'jpeg' ] ) : emojis [ name ] = emoji return emojis
returns a dictionary containing all emojis with their name and filename .