diff --git a/sc/social/like/browser/socialikes.py b/sc/social/like/browser/socialikes.py index 4319d577..1cea0023 100644 --- a/sc/social/like/browser/socialikes.py +++ b/sc/social/like/browser/socialikes.py @@ -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 diff --git a/sc/social/like/browser/viewlets.py b/sc/social/like/browser/viewlets.py index 2dfa5b72..2250761b 100644 --- a/sc/social/like/browser/viewlets.py +++ b/sc/social/like/browser/viewlets.py @@ -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): @@ -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' diff --git a/sc/social/like/controlpanel/likes.py b/sc/social/like/controlpanel/likes.py index 76672d1b..15cc3cb1 100644 --- a/sc/social/like/controlpanel/likes.py +++ b/sc/social/like/controlpanel/likes.py @@ -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) @@ -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') @@ -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'), diff --git a/sc/social/like/interfaces/socialikes.py b/sc/social/like/interfaces/socialikes.py index c1647fed..1c2769f7 100644 --- a/sc/social/like/interfaces/socialikes.py +++ b/sc/social/like/interfaces/socialikes.py @@ -1,3 +1,4 @@ +# -*- coding:utf-8 -*- from zope.interface import Interface from zope.i18nmessageid import MessageFactory _ = MessageFactory('sc.social.like') diff --git a/sc/social/like/locales/es/LC_MESSAGES/sc.social.like.po b/sc/social/like/locales/es/LC_MESSAGES/sc.social.like.po index 65eb972f..f4fc8a3b 100644 --- a/sc/social/like/locales/es/LC_MESSAGES/sc.social.like.po +++ b/sc/social/like/locales/es/LC_MESSAGES/sc.social.like.po @@ -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 \n" "Language-Team: Simples Consultoria \n" @@ -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 diff --git a/sc/social/like/locales/eu/LC_MESSAGES/sc.social.like.po b/sc/social/like/locales/eu/LC_MESSAGES/sc.social.like.po index d388330d..bd848827 100644 --- a/sc/social/like/locales/eu/LC_MESSAGES/sc.social.like.po +++ b/sc/social/like/locales/eu/LC_MESSAGES/sc.social.like.po @@ -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 \n" "Language-Team: es \n" @@ -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." diff --git a/sc/social/like/locales/it/LC_MESSAGES/sc.social.like.po b/sc/social/like/locales/it/LC_MESSAGES/sc.social.like.po index 63c08203..4929d54d 100644 --- a/sc/social/like/locales/it/LC_MESSAGES/sc.social.like.po +++ b/sc/social/like/locales/it/LC_MESSAGES/sc.social.like.po @@ -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 \n" "Language-Team: RedTurtle Technology \n" @@ -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." diff --git a/sc/social/like/locales/pt_BR/LC_MESSAGES/sc.social.like.po b/sc/social/like/locales/pt_BR/LC_MESSAGES/sc.social.like.po index 8ec0d9f8..50a0ad63 100644 --- a/sc/social/like/locales/pt_BR/LC_MESSAGES/sc.social.like.po +++ b/sc/social/like/locales/pt_BR/LC_MESSAGES/sc.social.like.po @@ -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 \n" "Language-Team: Simples Consultoria \n" @@ -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 diff --git a/sc/social/like/locales/sc.social.like.pot b/sc/social/like/locales/sc.social.like.pot index 92d9b85e..1f2240c2 100644 --- a/sc/social/like/locales/sc.social.like.pot +++ b/sc/social/like/locales/sc.social.like.pot @@ -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 \n" "Language-Team: LANGUAGE \n" @@ -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 "" diff --git a/sc/social/like/plugins/facebook/browser.py b/sc/social/like/plugins/facebook/browser.py index 4e3e57c3..f77a9761 100644 --- a/sc/social/like/plugins/facebook/browser.py +++ b/sc/social/like/plugins/facebook/browser.py @@ -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) @@ -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): @@ -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' @@ -121,5 +121,5 @@ def _isPortal(self): def type(self): if self._isPortal(): - return "website" - return "article" + return 'website' + return 'article' diff --git a/sc/social/like/plugins/facebook/controlpanel.py b/sc/social/like/plugins/facebook/controlpanel.py index 0a98ff5c..ad1ed50f 100644 --- a/sc/social/like/plugins/facebook/controlpanel.py +++ b/sc/social/like/plugins/facebook/controlpanel.py @@ -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', @@ -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, ) @@ -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, ) @@ -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, ) diff --git a/sc/social/like/plugins/gplus/browser.py b/sc/social/like/plugins/gplus/browser.py index 3c7ebf49..5d0456e7 100644 --- a/sc/social/like/plugins/gplus/browser.py +++ b/sc/social/like/plugins/gplus/browser.py @@ -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) @@ -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: diff --git a/sc/social/like/plugins/linkedin/browser.py b/sc/social/like/plugins/linkedin/browser.py index bc843abe..074ed245 100644 --- a/sc/social/like/plugins/linkedin/browser.py +++ b/sc/social/like/plugins/linkedin/browser.py @@ -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) @@ -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: diff --git a/sc/social/like/plugins/pinterest/browser.py b/sc/social/like/plugins/pinterest/browser.py index 397e5df7..564e29fc 100644 --- a/sc/social/like/plugins/pinterest/browser.py +++ b/sc/social/like/plugins/pinterest/browser.py @@ -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) @@ -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 @@ -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: diff --git a/sc/social/like/plugins/twitter/browser.py b/sc/social/like/plugins/twitter/browser.py index 6bcc4017..c1e4eea4 100644 --- a/sc/social/like/plugins/twitter/browser.py +++ b/sc/social/like/plugins/twitter/browser.py @@ -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) @@ -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( diff --git a/sc/social/like/plugins/twitter/controlpanel.py b/sc/social/like/plugins/twitter/controlpanel.py index 79b09e82..41f8ad63 100644 --- a/sc/social/like/plugins/twitter/controlpanel.py +++ b/sc/social/like/plugins/twitter/controlpanel.py @@ -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, ) diff --git a/sc/social/like/plugins/whatsapp/browser.py b/sc/social/like/plugins/whatsapp/browser.py index b1a9236d..93b5495a 100644 --- a/sc/social/like/plugins/whatsapp/browser.py +++ b/sc/social/like/plugins/whatsapp/browser.py @@ -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) diff --git a/sc/social/like/tests/__init__.py b/sc/social/like/tests/__init__.py index e69de29b..380474e0 100644 --- a/sc/social/like/tests/__init__.py +++ b/sc/social/like/tests/__init__.py @@ -0,0 +1 @@ +# -*- coding:utf-8 -*- diff --git a/sc/social/like/tests/test_plugin_facebook.py b/sc/social/like/tests/test_plugin_facebook.py index cdd517c1..85258782 100644 --- a/sc/social/like/tests/test_plugin_facebook.py +++ b/sc/social/like/tests/test_plugin_facebook.py @@ -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 diff --git a/sc/social/like/upgrades/v3000/__init__.py b/sc/social/like/upgrades/v3000/__init__.py index e69de29b..380474e0 100644 --- a/sc/social/like/upgrades/v3000/__init__.py +++ b/sc/social/like/upgrades/v3000/__init__.py @@ -0,0 +1 @@ +# -*- coding:utf-8 -*- diff --git a/sc/social/like/upgrades/v3010/__init__.py b/sc/social/like/upgrades/v3010/__init__.py index e69de29b..380474e0 100644 --- a/sc/social/like/upgrades/v3010/__init__.py +++ b/sc/social/like/upgrades/v3010/__init__.py @@ -0,0 +1 @@ +# -*- coding:utf-8 -*- diff --git a/sc/social/like/utils.py b/sc/social/like/utils.py index 3e2e48a8..5a8cec22 100644 --- a/sc/social/like/utils.py +++ b/sc/social/like/utils.py @@ -7,7 +7,7 @@ def get_images_view(context): request = getRequest() - key = "cache-view-%s" % (context) + key = 'cache-view-%s' % (context) cache = IAnnotations(request) value = cache.get(key, None) if not value: @@ -21,9 +21,9 @@ def get_images_view(context): if field: field = field[0] # if a content has an image field that isn't an ImageField - # (for example a relation field), set field="" to avoid errors - if schema[field].type not in ["image", "blob"]: - field = "" + # (for example a relation field), set field='' to avoid errors + if schema[field].type not in ['image', 'blob']: + field = '' value = (view, field) if (view and field) else (None, None) cache[key] = value return value @@ -35,7 +35,7 @@ def get_content_image(context, height=None): request = getRequest() modification = context.ModificationDate() - key = "cache-%s-%s-%s-%s-%s" % (context, modification, scale, width, height) + key = 'cache-%s-%s-%s-%s-%s' % (context, modification, scale, width, height) cache = IAnnotations(request) img = cache.get(key, None) if not img: