Skip to content

Commit

Permalink
Follow plone.api conventions on imports and prefer single quote strings
Browse files Browse the repository at this point in the history
  • Loading branch information
hvelarde committed Nov 15, 2013
1 parent b50a734 commit 3456abb
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 27 deletions.
8 changes: 2 additions & 6 deletions src/collective/cover/content.py
@@ -1,13 +1,9 @@
# -*- coding: utf-8 -*-

import json

# XXX: remove these imports?
#from plone.dexterity.events import EditCancelledEvent
#from plone.dexterity.events import EditFinishedEvent
from AccessControl import getSecurityManager
from Acquisition import aq_inner
from collective.cover.controlpanel import ICoverSettings
from collective.cover.interfaces import IGridSystem
from collective.cover.utils import assign_tile_ids
from five import grok
from plone.dexterity.content import Item
Expand All @@ -25,7 +21,7 @@
from zope.event import notify
from zope.interface import implements

from .interfaces import IGridSystem
import json

grok.templatedir('templates')

Expand Down
4 changes: 2 additions & 2 deletions src/collective/cover/interfaces.py
Expand Up @@ -42,5 +42,5 @@ class IGridSystem(Interface):
"""Interface for classes that implement a grid system for collective
cover."""

title = Attribute("""The user-visible title for this grid.""")
ncolums = Attribute("""Number of colums in a grid.""")
title = Attribute('The user-visible title for this grid.')
ncolums = Attribute('Number of colums in a grid.')
12 changes: 6 additions & 6 deletions src/collective/cover/layout.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-

import json

from Acquisition import aq_inner
from collective.cover import _
from collective.cover.content import ICover
from collective.cover.controlpanel import ICoverSettings
from collective.cover.interfaces import IGridSystem
from collective.cover.utils import assign_tile_ids
from five import grok
from plone.registry.interfaces import IRegistry
Expand All @@ -15,8 +15,7 @@
from zope.component import queryUtility
from zope.schema.interfaces import IVocabularyFactory

from .interfaces import IGridSystem
from . import _
import json


class PageLayout(grok.View):
Expand Down Expand Up @@ -219,7 +218,7 @@ class Deco16Grid (grok.GlobalUtility):
grok.name('deco16_grid')
grok.implements(IGridSystem)

title = _('Deco (16 columns, default)')
title = _(u'Deco (16 columns, default)')
ncolumns = 16

row_class = 'row'
Expand All @@ -239,7 +238,8 @@ def transform(self, layout):
element['class'] = 'tile'

def columns_formatter(self, columns):
#this formatter works for deco, but you can implemente a custom one, for you grid system
# This formatter works for Deco; you can implement a custom one
# for you grid system
w = 'width-'
p = 'position-'
offset = 0
Expand Down
7 changes: 3 additions & 4 deletions src/collective/cover/testing.py
@@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-

from App.Common import package_home
from collective.cover import _
from collective.cover.layout import Deco16Grid
from PIL import Image
from PIL import ImageChops
from plone.app.robotframework.testing import AUTOLOGIN_LIBRARY_FIXTURE
Expand All @@ -9,16 +11,13 @@
from plone.app.testing import PLONE_FIXTURE
from plone.app.testing import PloneSandboxLayer
from plone.testing import z2
from zope.component import getGlobalSiteManager
from StringIO import StringIO
from zope.component import getGlobalSiteManager

import os
import pkg_resources
import random

from collective.cover import _
from collective.cover.layout import Deco16Grid

PLONE_VERSION = pkg_resources.require('Plone')[0].version
ALL_CONTENT_TYPES = [
'Collection',
Expand Down
6 changes: 3 additions & 3 deletions src/collective/cover/tests/test_grid.py
@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-

import unittest
import lxml

from collective.cover.controlpanel import ICoverSettings
from collective.cover.testing import MULTIPLE_GRIDS_INTEGRATION_TESTING
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from plone.registry.interfaces import IRegistry
from zope.component import getUtility

import lxml
import unittest


def _has_classes(element, classes):
element_classes = [c.strip() for c in element.attrib['class'].split(' ')]
Expand Down
2 changes: 1 addition & 1 deletion src/collective/cover/tests/test_vocabularies.py
Expand Up @@ -135,4 +135,4 @@ def test_grid_systems(self):

# The layer has setup a second grid.
self.assertIn(u'bootstrap3', grids)
self.assertEqual(grids.getTerm('bootstrap3').title, "Bootstrap 3")
self.assertEqual(grids.getTerm('bootstrap3').title, u'Bootstrap 3')
9 changes: 4 additions & 5 deletions src/collective/cover/upgrades.py
@@ -1,13 +1,12 @@
# -*- coding: utf-8 -*-

import logging

from Products.CMFCore.utils import getToolByName
from collective.cover.config import PROJECTNAME
from collective.cover.controlpanel import ICoverSettings
from plone.registry.interfaces import IRegistry
from Products.CMFCore.utils import getToolByName
from zope.component import getUtility

from collective.cover.config import PROJECTNAME
from collective.cover.controlpanel import ICoverSettings
import logging


def issue_201(context, logger=None):
Expand Down

0 comments on commit 3456abb

Please sign in to comment.