Reformat using black
This commit is contained in:
parent
efee4ad081
commit
a87fb49918
221 changed files with 19127 additions and 7310 deletions
|
@ -1,13 +1,29 @@
|
|||
from django.template.loader import get_template
|
||||
from django.utils.safestring import mark_safe
|
||||
from django_social_share.templatetags.social_share import post_to_facebook_url, post_to_gplus_url, post_to_twitter_url
|
||||
from django_social_share.templatetags.social_share import (
|
||||
post_to_facebook_url,
|
||||
post_to_gplus_url,
|
||||
post_to_twitter_url,
|
||||
)
|
||||
|
||||
from . import registry
|
||||
|
||||
SHARES = [
|
||||
('post_to_twitter', 'django_social_share/templatetags/post_to_twitter.html', post_to_twitter_url),
|
||||
('post_to_facebook', 'django_social_share/templatetags/post_to_facebook.html', post_to_facebook_url),
|
||||
('post_to_gplus', 'django_social_share/templatetags/post_to_gplus.html', post_to_gplus_url),
|
||||
(
|
||||
"post_to_twitter",
|
||||
"django_social_share/templatetags/post_to_twitter.html",
|
||||
post_to_twitter_url,
|
||||
),
|
||||
(
|
||||
"post_to_facebook",
|
||||
"django_social_share/templatetags/post_to_facebook.html",
|
||||
post_to_facebook_url,
|
||||
),
|
||||
(
|
||||
"post_to_gplus",
|
||||
"django_social_share/templatetags/post_to_gplus.html",
|
||||
post_to_gplus_url,
|
||||
),
|
||||
# For future versions:
|
||||
# ('post_to_linkedin', 'django_social_share/templatetags/post_to_linkedin.html', post_to_linkedin_url),
|
||||
# ('post_to_reddit', 'django_social_share/templatetags/post_to_reddit.html', post_to_reddit_url),
|
||||
|
@ -17,7 +33,7 @@ SHARES = [
|
|||
def make_func(name, template, url_func):
|
||||
def func(request, *args):
|
||||
link_text = args[-1]
|
||||
context = {'request': request, 'link_text': mark_safe(link_text)}
|
||||
context = {"request": request, "link_text": mark_safe(link_text)}
|
||||
context = url_func(context, *args[:-1])
|
||||
return mark_safe(get_template(template).render(context))
|
||||
|
||||
|
@ -31,4 +47,6 @@ for name, template, url_func in SHARES:
|
|||
|
||||
@registry.function
|
||||
def recaptcha_init(language=None):
|
||||
return get_template('snowpenguin/recaptcha/recaptcha_init.html').render({'explicit': False, 'language': language})
|
||||
return get_template("snowpenguin/recaptcha/recaptcha_init.html").render(
|
||||
{"explicit": False, "language": language}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue