Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Jun 11, 2017
1 parent d28a349 commit 72e0825
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
3.0.2 - unreleased
------------------

* More PEP8 compliance.


3.0.1 - 2017-05-27
Expand Down
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
ignore =
*.cfg
bootstrap.py

[flake8]
ignore = N802
exclude = bootstrap.py
5 changes: 5 additions & 0 deletions src/five/localsitemanager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from Products.Five.component import enableSite
from Products.Five.component.interfaces import IObjectManagerSite


def make_site(obj, iface=ISite):
"""Give the specified object required qualities to identify it as a proper
ISite.
Expand All @@ -40,12 +41,14 @@ def make_site(obj, iface=ISite):
obj.setSiteManager(components)
components.__parent__ = aq_base(obj)


def make_objectmanager_site(obj):
"""Just a bit of sugar coating to make an unnofficial objectmanager
based site.
"""
make_site(obj, IObjectManagerSite)


# Original version: zope.site.site._findNextSiteManager
def find_next_sitemanager(site):
"""Find the closest sitemanager that is not the specified site's
Expand All @@ -59,6 +62,7 @@ def find_next_sitemanager(site):
if ISite.providedBy(site):
return site.getSiteManager()


def update_sitemanager_bases(site):
"""Formulate the most appropriate __bases__ value for a site's site manager
by asking find_next_sitemanager what the next appropriate site manager
Expand All @@ -71,6 +75,7 @@ def update_sitemanager_bases(site):
sm = site.getSiteManager()
sm.__bases__ = (next,)


# Original version: zope.site.site.changeSiteConfigurationAfterMove
def update_sitemanager_bases_handler(site, event):
"""After a site is moved, its site manager links have to be updated."""
Expand Down
8 changes: 4 additions & 4 deletions src/five/localsitemanager/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _uncached_subscriptions(self, required, provided):

_subscriptions(byorder[order], required, extendors, u'',
result, 0, order)
result = [ _wrap(r, registry) for r in result ]
result = [_wrap(r, registry) for r in result]

self._subscribe(*required)

Expand Down Expand Up @@ -239,8 +239,8 @@ def registeredUtilities(self):
reg.component = _wrap(reg.component, self)
yield reg

def registerUtility(self, component=None, provided=None, name=u'', info=u'',
event=True, factory=None):
def registerUtility(self, component=None, provided=None, name=u'',
info=u'', event=True, factory=None):
if factory:
if component:
raise TypeError("Can't specify factory and component.")
Expand Down Expand Up @@ -295,7 +295,7 @@ def registerUtility(self, component=None, provided=None, name=u'', info=u'',
zope.event.notify(zope.component.interfaces.Registered(
UtilityRegistration(
self, provided, name, component, info, factory)
))
))

def unregisterUtility(self, component=None, provided=None, name=u'',
factory=None):
Expand Down
4 changes: 3 additions & 1 deletion src/five/localsitemanager/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
from Testing.ZopeTestCase import ZopeDocFileSuite
from Testing.ZopeTestCase import FunctionalDocFileSuite


def test_suite():
return unittest.TestSuite([
ZopeDocFileSuite('localsitemanager.txt',
package="five.localsitemanager"),
FunctionalDocFileSuite('browser.txt',
package="five.localsitemanager")
])
])


if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
1 change: 1 addition & 0 deletions src/five/localsitemanager/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

_marker = object()


def get_parent(obj, default=_marker):
"""Returns the container the object was traversed via.
Expand Down

0 comments on commit 72e0825

Please sign in to comment.