PageRenderTime 236ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/logilab-astng-0.23.1/test/data2/clientmodule_test.py

#
Python | 51 lines | 21 code | 8 blank | 22 comment | 0 complexity | 9ac1ad9dd1dac7a988f79ceb2f99a2ac MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
  1. # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
  2. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
  3. # copyright 2003-2010 Sylvain Thenault, all rights reserved.
  4. # contact mailto:thenault@gmail.com
  5. #
  6. # This file is part of logilab-astng.
  7. #
  8. # logilab-astng is free software: you can redistribute it and/or modify it
  9. # under the terms of the GNU Lesser General Public License as published by the
  10. # Free Software Foundation, either version 2.1 of the License, or (at your
  11. # option) any later version.
  12. #
  13. # logilab-astng is distributed in the hope that it will be useful, but
  14. # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
  16. # for more details.
  17. #
  18. # You should have received a copy of the GNU Lesser General Public License along
  19. # with logilab-astng. If not, see <http://www.gnu.org/licenses/>.
  20. """ docstring for file clientmodule.py """
  21. from data2.suppliermodule_test import Interface as IFace, DoNothing
  22. class Toto: pass
  23. class Ancestor:
  24. """ Ancestor method """
  25. __implements__ = (IFace,)
  26. def __init__(self, value):
  27. local_variable = 0
  28. self.attr = 'this method shouldn\'t have a docstring'
  29. self.__value = value
  30. def get_value(self):
  31. """ nice docstring ;-) """
  32. return self.__value
  33. def set_value(self, value):
  34. self.__value = value
  35. return 'this method shouldn\'t have a docstring'
  36. class Specialization(Ancestor):
  37. TYPE = 'final class'
  38. top = 'class'
  39. def __init__(self, value, _id):
  40. Ancestor.__init__(self, value)
  41. self._id = _id
  42. self.relation = DoNothing()
  43. self.toto = Toto()