~cjwatson/lazr.restful/test-fixes

« back to all changes in this revision

Viewing changes to src/lazr/restful/example/wsgi/resources.py

  • Committer: Colin Watson
  • Date: 2016-02-17 01:07:21 UTC
  • Revision ID: cjwatson@canonical.com-20160217010721-4d5fqqml5q97ss59
Switch zope.interface, zope.component, and lazr.delegates users from class advice to class decorators.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
           'PairSet']
7
7
 
8
8
from zope.component import getUtility
9
 
from zope.interface import implements
 
9
from zope.interface import implementer
10
10
from zope.schema import Text
11
11
from zope.location.interfaces import ILocation
12
12
 
34
34
        """Retrieve a key-value pair by its key."""
35
35
 
36
36
 
 
37
@implementer(IKeyValuePair, ILocation)
37
38
class KeyValuePair(object):
38
39
    """An object representing a key-value pair"""
39
 
    implements(IKeyValuePair, ILocation)
40
40
 
41
41
    def __init__(self, set, key, value):
42
42
        self.set = set
53
53
        return self.key
54
54
 
55
55
 
 
56
@implementer(IPairSet, ILocation)
56
57
class PairSet(TraverseWithGet):
57
58
    """A repository for key-value pairs."""
58
 
    implements(IPairSet, ILocation)
59
59
 
60
60
    def __init__(self):
61
61
        self.pairs = []