Skip to content

Commit

Permalink
Merge bba52eb into 637e885
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Jul 10, 2019
2 parents 637e885 + bba52eb commit 930419b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ CHANGES

- Add support for Python 3.7.

- Fix deprecation warning about importing IRegistered/IUnregistered from
their old locations in zope.component.interfaces instead of their current
locations in zope.interface.interfaces.


4.0.0 (2017-05-25)
------------------
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def read(*rnames):
'zope.container >= 4.1.0',
'zope.i18n >= 4.2.0, < 4.5.0',
'zope.i18nmessageid >= 4.1.0',
'zope.interface',
'zope.interface >= 3.8.0',
'zope.publisher >= 4.3.2',
'zope.security',
],
Expand Down
4 changes: 2 additions & 2 deletions src/zope/app/i18n/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@

<subscriber
for=".interfaces.ILocalTranslationDomain
zope.component.interfaces.IRegistered"
zope.interface.interfaces.IRegistered"
handler=".translationdomain.setDomainOnActivation"
/>

<subscriber
for=".interfaces.ILocalTranslationDomain
zope.component.interfaces.IUnregistered"
zope.interface.interfaces.IUnregistered"
handler=".translationdomain.unsetDomainOnDeactivation"
/>

Expand Down
8 changes: 5 additions & 3 deletions src/zope/app/i18n/tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import time
from io import BytesIO


from zope.component.testing import PlacelessSetup
from zope.component.interfaces import IFactory
from zope.component.factory import Factory
Expand All @@ -35,6 +34,7 @@
from zope.app.i18n.filters import ParseError
from zope.app.i18n.filters import parseGetText


GETTEXT_IMPORT_DATA = b'''
msgid ""
Expand Down Expand Up @@ -98,6 +98,7 @@ def test_bad_export_argument(self):
exp = GettextExportFilter(self._domain)
self.assertRaises(TypeError, exp.exportMessages, ['1', '2'])


class TestParseGetText(unittest.TestCase):

def setUp(self):
Expand All @@ -110,7 +111,6 @@ def _check_error(self, data, state):

self.assertEqual(exc.exception.state, state)


def test_bad_start_state(self):
data = [b'bad first line']
self._check_error(data, 0)
Expand All @@ -130,14 +130,16 @@ def test_bad_state_after_str(self):
def test_multiline_msgid(self):
data = [b'msgid "a"', b'"b"', b'msgstr ""']
_, ids, _, _ = parseGetText(data)
self.assertEquals(ids, [b'a', b'b'])
self.assertEqual(ids, [b'a', b'b'])


class TestParseError(unittest.TestCase):

def test_str(self):
error = ParseError("state", 10, 'data')
self.assertEqual("state state, line num 10: 'data'", str(error))


def test_suite():
return unittest.defaultTestLoader.loadTestsFromName(__name__)

Expand Down
3 changes: 2 additions & 1 deletion src/zope/app/i18n/tests/test_translationdomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@
from zope.app.i18n.translationdomain import TranslationDomain

from zope.site.site import SiteManagerAdapter
from zope.component.interfaces import IComponentLookup
from zope.interface.interfaces import IComponentLookup
from zope.interface import Interface


def setUpSiteManagerLookup():
provideAdapter(SiteManagerAdapter, (Interface,),
IComponentLookup)
Expand Down
8 changes: 4 additions & 4 deletions src/zope/app/i18n/translationdomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ def setDomainOnActivation(domain, event):
>>> domain1.domain
'<domain not activated>'
>>> import zope.component.interfaces
>>> event = zope.component.interfaces.Registered(
>>> import zope.interface.interfaces
>>> event = zope.interface.interfaces.Registered(
... Registration(domain1, 'domain1'))
Now we pass the event into this function, and the id of the domain should
Expand All @@ -266,8 +266,8 @@ def unsetDomainOnDeactivation(domain, event):
>>> domain1 = TranslationDomain()
>>> domain1.domain = 'domain1'
>>> import zope.component.interfaces
>>> event = zope.component.interfaces.Unregistered(
>>> import zope.interface.interfaces
>>> event = zope.interface.interfaces.Unregistered(
... Registration(domain1, 'domain1'))
Now we pass the event into this function, and the id of the role should be
Expand Down

0 comments on commit 930419b

Please sign in to comment.