__init__.py 966B

12345678910111213141516171819202122232425262728293031323334353637
  1. # -*- coding: utf-8 -*-
  2. # from hapic.hapic import Hapic
  3. # _hapic_default = Hapic()
  4. #
  5. # with_api_doc = _hapic_default.with_api_doc
  6. # with_api_doc_bis = _hapic_default.with_api_doc_bis
  7. # generate_doc = _hapic_default.generate_doc
  8. from hapic.hapic import with_api_doc
  9. from hapic.hapic import with_api_doc_bis
  10. from hapic.hapic import generate_doc
  11. from hapic.hapic import output
  12. from hapic.hapic import input_body
  13. from hapic.hapic import input_query
  14. from hapic.hapic import input_path
  15. from hapic.hapic import input_headers
  16. from hapic.hapic import BottleContext
  17. from hapic.hapic import set_fake_default_context
  18. class FakeSetContext(object):
  19. def bottle_context(self):
  20. hapic.set_fake_default_context(BottleContext())
  21. def decorator(func):
  22. def wrapper(*args, **kwargs):
  23. return func(*args, **kwargs)
  24. return wrapper
  25. return decorator
  26. class FakeExt(object):
  27. bottle = FakeSetContext()
  28. ext = FakeExt()