<s> from siteuser . utils import LazyList <EOL> from siteuser . settings import USING_SOCIAL_LOGIN , SOCIALOAUTH_SITES <EOL> if USING_SOCIAL_LOGIN : <EOL> from socialoauth import SocialSites <EOL> def social_sites ( request ) : <EOL> def _social_sites ( ) : <EOL> def make_site ( site_class ) : <EOL> s = socialsites . get_site_object_by_class ( site_class ) <EOL> return { <EOL> '<STR_LIT>' : s . site_name , <EOL> '<STR_LIT>' : s . site_name_zh , <EOL> '<STR_LIT>' : s . authorize_url , <EOL> } <EOL> socialsites = SocialSites ( SOCIALOAUTH_SITES ) <EOL> return [ make_site ( site_class ) for site_class in socialsites . list_sites_class ( ) ] <EOL> if SOCIALOAUTH_SITES : <EOL> return { '<STR_LIT>' : LazyList ( _social_sites ) } <EOL> return { '<STR_LIT>' : [ ] } </s>
