Advertisement
Guest User

ladonize parent methods in derivated class?

a guest
May 10th, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 KB | None | 0 0
  1. # testservice.py
  2. from ladon.ladonizer import ladonize
  3. #from testservice2 import TestService2
  4. import testservice2
  5.  
  6. class TestService(object):
  7.     """Test service for ladon."""
  8.  
  9.     @ladonize(unicode,rtype=unicode)
  10.     def helloWorld(self,name):
  11.         """Say hello to specific people of the world.
  12.  
  13.        @param name: Your name
  14.        @rtype: Hello to you
  15.        """
  16.  
  17.         return "Hello %(name)s" % locals()
  18.  
  19. class TestService3(TestService):
  20.     """Testing inheritance"""
  21.  
  22.     @ladonize(unicode,rtype=unicode)
  23.     def howRU(self,name):
  24.         """Ask the target how he/she is
  25.  
  26.        @param name: Target's name'"""
  27.  
  28.         return "How are you %(name)s?" % locals()
  29.  
  30.  
  31. #testservice2.py
  32. from ladon.ladonizer import ladonize
  33.  
  34. class TestService2(object):
  35.     """Test service for ladon."""
  36.  
  37.     @ladonize(unicode,rtype=unicode)
  38.     def goodBy(self,name):
  39.         """Say good bye to specific people of the world.
  40.  
  41.        @param name: Your name
  42.        @rtype: Say good bye to you
  43.        """
  44.  
  45.         return "Good bye %(name)s." % locals()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement