Skip to content

Commit

Permalink
Flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
hvelarde committed May 4, 2015
1 parent 78d9217 commit a247305
Show file tree
Hide file tree
Showing 22 changed files with 68 additions and 61 deletions.
2 changes: 1 addition & 1 deletion sc/social/like/browser/socialikes.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, context, request, *args, **kwargs):
self.sheet = getattr(pp, 'sc_social_likes_properties', None)
if self.sheet:
self.enabled_portal_types = self.sheet.getProperty(
"enabled_portal_types"
'enabled_portal_types'
)

@property
Expand Down
4 changes: 2 additions & 2 deletions sc/social/like/browser/viewlets.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def update(self):
class SocialMetadataViewlet(BaseLikeViewlet):
"""Viewlet used to insert metadata into page header
"""
render = ViewPageTemplateFile("templates/metadata.pt")
render = ViewPageTemplateFile('templates/metadata.pt')
render_method = 'metadata'

def enabled(self):
Expand All @@ -67,5 +67,5 @@ def enabled(self):
class SocialLikesViewlet(BaseLikeViewlet):
"""Viewlet used to display the buttons
"""
render = ViewPageTemplateFile("templates/sociallikes.pt")
render = ViewPageTemplateFile('templates/sociallikes.pt')
render_method = 'plugin'
8 changes: 4 additions & 4 deletions sc/social/like/controlpanel/likes.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class IProvidersSchema(Interface):
title=_(u'Content types'),
description=_(
u'help_portal_types',
default=u"Please select content types in which the "
u"viewlet will be applied.",
default=u'Please select content types in which the '
u'viewlet will be applied.',
),
required=True,
value_type=schema.Choice(vocabulary=CONTENT_TYPES)
Expand All @@ -55,7 +55,7 @@ class IProvidersSchema(Interface):
title=_(u'Plugins'),
description=_(
u'help_enabled_plugins',
default=u"Please select which plugins will be used",
default=u'Please select which plugins will be used',
),
required=False,
value_type=schema.Choice(vocabulary='sc.social.likes.plugins')
Expand All @@ -65,7 +65,7 @@ class IProvidersSchema(Interface):
title=_(u'Button style'),
description=_(
u'help_selected_buttons',
default=u"Choose your button style.",
default=u'Choose your button style.',
),
required=True,
default=_(u'horizontal'),
Expand Down
1 change: 1 addition & 0 deletions sc/social/like/interfaces/socialikes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding:utf-8 -*-
from zope.interface import Interface
from zope.i18nmessageid import MessageFactory
_ = MessageFactory('sc.social.like')
Expand Down
6 changes: 3 additions & 3 deletions sc/social/like/locales/es/LC_MESSAGES/sc.social.like.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: sc.social.like\n"
"POT-Creation-Date: 2015-04-30 19:51+0000\n"
"POT-Creation-Date: 2015-05-04 23:38+0000\n"
"PO-Revision-Date: 2015-03-02 16:03-0300\n"
"Last-Translator: Héctor Velarde <hector.velarde@gmail.com>\n"
"Language-Team: Simples Consultoria <products@simplesconsultoria.com.br>\n"
Expand Down Expand Up @@ -141,10 +141,10 @@ msgstr "Seleccione en cuáles tipos de contenido se mostrará el viewlet social.
msgid "help_selected_buttons"
msgstr "Seleccione de la lista."

#. Default: "The verb to display in the facebook button. Currently only 'like' and 'recommend' are supported."
#. Default: "The verb to display in the facebook button. Currently only \"like\" and \"recommend\" are supported."
#: ./sc/social/like/plugins/facebook/controlpanel.py:32
msgid "help_verb_display"
msgstr "Texto que se mostrará en el botón de Facebook. De momento sólo 'Me gusta y 'Recomendar' están soportados."
msgstr "Texto que se mostrará en el botón de Facebook. De momento sólo \"Me gusta\" y \"Recomendar\" están soportados."

#. Default: "Enter your twitter nick. eg. simplesconsultoria"
#: ./sc/social/like/plugins/twitter/controlpanel.py:20
Expand Down
5 changes: 3 additions & 2 deletions sc/social/like/locales/eu/LC_MESSAGES/sc.social.like.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: sc.social.like\n"
"POT-Creation-Date: 2015-04-30 19:51+0000\n"
"POT-Creation-Date: 2015-05-04 23:38+0000\n"
"PO-Revision-Date: 2011-12-12 13:30+0100\n"
"Last-Translator: Mikel Larreategi <mlarreategi@codesyntax.com>\n"
"Language-Team: es <es@li.org>\n"
Expand Down Expand Up @@ -137,8 +137,9 @@ msgstr "Aukeratu zein elementutan agertuko diren loturak"
msgid "help_selected_buttons"
msgstr "Aukeratu botoiaren itxura"

#. Default: "The verb to display in the facebook button. Currently only 'like' and 'recommend' are supported."
#. Default: "The verb to display in the facebook button. Currently only \"like\" and \"recommend\" are supported."
#: ./sc/social/like/plugins/facebook/controlpanel.py:32
#, fuzzy
msgid "help_verb_display"
msgstr "Zein hitz agertuko den Facebook botoian. Momentuz 'Atsegin dut' eta 'Gomendatu' bakarrik erabili daitezke."

Expand Down
5 changes: 3 additions & 2 deletions sc/social/like/locales/it/LC_MESSAGES/sc.social.like.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2015-04-30 19:51+0000\n"
"POT-Creation-Date: 2015-05-04 23:38+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: Luca Fabbri <keul@redturtle.it>\n"
"Language-Team: RedTurtle Technology <sviluppoplone@redturtle.it>\n"
Expand Down Expand Up @@ -139,8 +139,9 @@ msgstr "Prego selezionare su quali tipi di contenuto la viewlet verrà applicata
msgid "help_selected_buttons"
msgstr "Seleziona lo stile del bottone"

#. Default: "The verb to display in the facebook button. Currently only 'like' and 'recommend' are supported."
#. Default: "The verb to display in the facebook button. Currently only \"like\" and \"recommend\" are supported."
#: ./sc/social/like/plugins/facebook/controlpanel.py:32
#, fuzzy
msgid "help_verb_display"
msgstr "Il verbo da visualizzare nel bottone di Facebook. Al momento solo 'Mi piace' e 'Consigliato' sono supportati."

Expand Down
7 changes: 4 additions & 3 deletions sc/social/like/locales/pt_BR/LC_MESSAGES/sc.social.like.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: sc.social.like\n"
"POT-Creation-Date: 2015-04-30 19:51+0000\n"
"POT-Creation-Date: 2015-05-04 23:38+0000\n"
"PO-Revision-Date: 2015-03-02 15:59-0300\n"
"Last-Translator: Héctor Velarde <hector.velarde@gmail.com>\n"
"Language-Team: Simples Consultoria <products@simplesconsultoria.com.br>\n"
Expand Down Expand Up @@ -139,10 +139,11 @@ msgstr "Indique quais tipos de conteúdo terão o viewlet de ações sociais."
msgid "help_selected_buttons"
msgstr "Qual o estilo dos botões."

#. Default: "The verb to display in the facebook button. Currently only 'like' and 'recommend' are supported."
#. Default: "The verb to display in the facebook button. Currently only \"like\" and \"recommend\" are supported."
#: ./sc/social/like/plugins/facebook/controlpanel.py:32
#, fuzzy
msgid "help_verb_display"
msgstr "Verbo a ser exibido no botão do Facebook. Atualmente apenas 'curtir' e 'recomendar' estão habilitados"
msgstr "Verbo a ser exibido no botão do Facebook. Atualmente apenas \"curtir\" e \"recomendar\" estão habilitados"

#. Default: "Enter your twitter nick. eg. simplesconsultoria"
#: ./sc/social/like/plugins/twitter/controlpanel.py:20
Expand Down
4 changes: 2 additions & 2 deletions sc/social/like/locales/sc.social.like.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2015-04-30 19:51+0000\n"
"POT-Creation-Date: 2015-05-04 23:38+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -135,7 +135,7 @@ msgstr ""
msgid "help_selected_buttons"
msgstr ""

#. Default: "The verb to display in the facebook button. Currently only 'like' and 'recommend' are supported."
#. Default: "The verb to display in the facebook button. Currently only \"like\" and \"recommend\" are supported."
#: ./sc/social/like/plugins/facebook/controlpanel.py:32
msgid "help_verb_display"
msgstr ""
Expand Down
20 changes: 10 additions & 10 deletions sc/social/like/plugins/facebook/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class PluginView(BrowserView):
fbshow_like = True
fbshow_share = False

metadata = ViewPageTemplateFile("templates/metadata.pt")
plugin = ViewPageTemplateFile("templates/plugin.pt")
metadata = ViewPageTemplateFile('templates/metadata.pt')
plugin = ViewPageTemplateFile('templates/plugin.pt')

def __init__(self, context, request):
super(PluginView, self).__init__(context, request)
Expand All @@ -45,11 +45,11 @@ def __init__(self, context, request):
self.sheet = getattr(pp, 'sc_social_likes_properties', None)
self.image = get_content_image(context, width=1200, height=630)
if self.sheet:
self.fbaction = self.sheet.getProperty("fbaction", "")
self.fbapp_id = self.sheet.getProperty("fbapp_id", "")
self.fbadmins = self.sheet.getProperty("fbadmins", "")
self.fbshow_like = 'Like' in self.sheet.getProperty("fbbuttons", [])
self.fbshow_share = 'Share' in self.sheet.getProperty("fbbuttons", [])
self.fbaction = self.sheet.getProperty('fbaction', '')
self.fbapp_id = self.sheet.getProperty('fbapp_id', '')
self.fbadmins = self.sheet.getProperty('fbadmins', '')
self.fbshow_like = 'Like' in self.sheet.getProperty('fbbuttons', [])
self.fbshow_share = 'Share' in self.sheet.getProperty('fbbuttons', [])
self.button = self.typebutton

def fbjs(self):
Expand Down Expand Up @@ -97,7 +97,7 @@ def image_url(self):

@property
def typebutton(self):
typebutton = self.sheet.getProperty("typebutton", "")
typebutton = self.sheet.getProperty('typebutton', '')
if typebutton == 'horizontal':
typebutton = 'button_count'
self.width = '90px'
Expand All @@ -121,5 +121,5 @@ def _isPortal(self):

def type(self):
if self._isPortal():
return "website"
return "article"
return 'website'
return 'article'
14 changes: 7 additions & 7 deletions sc/social/like/plugins/facebook/controlpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class IFacebookSchema(Interface):
title=_(u'Verb to display'),
description=_(
u'help_verb_display',
default=u"The verb to display in the facebook button. "
u"Currently only 'like' and 'recommend' are "
u"supported.",
default=u'The verb to display in the facebook button. '
u'Currently only "like" and "recommend" are '
u'supported.',
),
required=True,
default=u'like',
Expand All @@ -44,8 +44,8 @@ class IFacebookSchema(Interface):
title=_(u'Admins'),
description=_(
u'help_admins',
default=u"A comma-separated list of either the "
u"Facebook IDs of page administrators.",
default=u'A comma-separated list of either the '
u'Facebook IDs of page administrators.',
),
required=False,
)
Expand All @@ -54,7 +54,7 @@ class IFacebookSchema(Interface):
title=_(u'Application ID'),
description=_(
u'help_appid',
default=u"A Facebook Platform application ID.",
default=u'A Facebook Platform application ID.',
),
required=False,
)
Expand All @@ -66,7 +66,7 @@ class IFacebookSchema(Interface):
default=u'Select buttons to be shown',
),
value_type=schema.Choice(vocabulary=buttons),
default=(u"Like", ),
default=(u'Like', ),
required=True,
)

Expand Down
6 changes: 3 additions & 3 deletions sc/social/like/plugins/gplus/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class PluginView(BrowserView):
gp_enabled = True
language = 'en'

metadata = ViewPageTemplateFile("templates/metadata.pt")
plugin = ViewPageTemplateFile("templates/plugin.pt")
metadata = ViewPageTemplateFile('templates/metadata.pt')
plugin = ViewPageTemplateFile('templates/plugin.pt')

def __init__(self, context, request):
super(PluginView, self).__init__(context, request)
Expand All @@ -32,7 +32,7 @@ def __init__(self, context, request):

@property
def typebutton(self):
typebutton = self.sheet.getProperty("typebutton", "")
typebutton = self.sheet.getProperty('typebutton', '')
if typebutton == 'horizontal':
typebutton = 'medium'
else:
Expand Down
6 changes: 3 additions & 3 deletions sc/social/like/plugins/linkedin/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class PluginView(BrowserView):
linkedin_enabled = True
language = 'en'

metadata = ViewPageTemplateFile("templates/metadata.pt")
plugin = ViewPageTemplateFile("templates/plugin.pt")
metadata = ViewPageTemplateFile('templates/metadata.pt')
plugin = ViewPageTemplateFile('templates/plugin.pt')

def __init__(self, context, request):
super(PluginView, self).__init__(context, request)
Expand All @@ -32,7 +32,7 @@ def __init__(self, context, request):

@property
def typebutton(self):
typebutton = self.sheet.getProperty("typebutton", "")
typebutton = self.sheet.getProperty('typebutton', '')
if typebutton == 'horizontal':
typebutton = 'right'
else:
Expand Down
10 changes: 5 additions & 5 deletions sc/social/like/plugins/pinterest/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class PluginView(BrowserView):
pinterest_enabled = False
language = 'en'

metadata = ViewPageTemplateFile("templates/metadata.pt")
plugin = ViewPageTemplateFile("templates/plugin.pt")
metadata = ViewPageTemplateFile('templates/metadata.pt')
plugin = ViewPageTemplateFile('templates/plugin.pt')

def __init__(self, context, request):
super(PluginView, self).__init__(context, request)
Expand All @@ -44,8 +44,8 @@ def share_url(self):
)

def image_url(self):
""" Return url to image
"""
''' Return url to image
'''
img = self.image
if img:
return img.url
Expand All @@ -54,7 +54,7 @@ def image_url(self):

@property
def typebutton(self):
typebutton = self.sheet.getProperty("typebutton", "")
typebutton = self.sheet.getProperty('typebutton', '')
if typebutton == 'horizontal':
typebutton = 'beside'
else:
Expand Down
8 changes: 4 additions & 4 deletions sc/social/like/plugins/twitter/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class PluginView(BrowserView):
twittvia = ''
language = 'en'

metadata = ViewPageTemplateFile("templates/metadata.pt")
plugin = ViewPageTemplateFile("templates/plugin.pt")
metadata = ViewPageTemplateFile('templates/metadata.pt')
plugin = ViewPageTemplateFile('templates/plugin.pt')

def __init__(self, context, request):
super(PluginView, self).__init__(context, request)
Expand All @@ -34,8 +34,8 @@ def __init__(self, context, request):
self.language = get_language(context)
self.sheet = getattr(pp, 'sc_social_likes_properties', None)
if self.sheet:
self.typebutton = self.sheet.getProperty("typebutton", "")
self.twittvia = self.sheet.getProperty("twittvia", "")
self.typebutton = self.sheet.getProperty('typebutton', '')
self.twittvia = self.sheet.getProperty('twittvia', '')
self.urlnoscript = (
u'http://twitter.com/home?status=' +
url_quote(u'{0} - {1} via {2}'.format(
Expand Down
2 changes: 1 addition & 1 deletion sc/social/like/plugins/twitter/controlpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ITwitterSchema(Interface):
title=_(u'Twitter nick'),
description=_(
u'help_your_twitter_nick',
default=u"Enter your twitter nick. eg. simplesconsultoria",
default=u'Enter your twitter nick. eg. simplesconsultoria',
),
required=False,
)
Expand Down
4 changes: 2 additions & 2 deletions sc/social/like/plugins/whatsapp/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class PluginView(BrowserView):
gp_enabled = True
language = 'en'

metadata = ViewPageTemplateFile("templates/metadata.pt")
plugin = ViewPageTemplateFile("templates/plugin.pt")
metadata = ViewPageTemplateFile('templates/metadata.pt')
plugin = ViewPageTemplateFile('templates/plugin.pt')

def __init__(self, context, request):
super(PluginView, self).__init__(context, request)
Expand Down
1 change: 1 addition & 0 deletions sc/social/like/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# -*- coding:utf-8 -*-
4 changes: 2 additions & 2 deletions sc/social/like/tests/test_plugin_facebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ def setup_content(self, portal):
self.newsitem = portal['my-newsitem']
self.newsitem.setImage(load_image(1024, 768))
self.newsitem_bmp = portal['my-newsitem-bmp']
self.newsitem_bmp.setImage(load_image(640, 480, format="BMP"))
self.newsitem_bmp.setImage(load_image(640, 480, format='BMP'))
self.image = portal['my-image']
self.image.setImage(load_image(1024, 768))
self.image_bmp = portal['my-image-bmp']
self.image_bmp.setImage(load_image(640, 480, format="BMP"))
self.image_bmp.setImage(load_image(640, 480, format='BMP'))

def test_config_view(self):
plugin = self.plugin
Expand Down
1 change: 1 addition & 0 deletions sc/social/like/upgrades/v3000/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# -*- coding:utf-8 -*-
1 change: 1 addition & 0 deletions sc/social/like/upgrades/v3010/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# -*- coding:utf-8 -*-
Loading

0 comments on commit a247305

Please sign in to comment.