__init__.py 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # -*- coding: utf-8 -*-
  2. from hapic.hapic import Hapic
  3. _hapic_default = Hapic()
  4. with_api_doc = _hapic_default.with_api_doc
  5. input_headers = _hapic_default.input_headers
  6. input_body = _hapic_default.input_body
  7. input_path = _hapic_default.input_path
  8. input_query = _hapic_default.input_query
  9. input_forms = _hapic_default.input_forms
  10. output_headers = _hapic_default.output_headers
  11. output_body = _hapic_default.output_body
  12. # with_api_doc_bis = _hapic_default.with_api_doc_bis
  13. generate_doc = _hapic_default.generate_doc
  14. handle_exception = _hapic_default.handle_exception
  15. # from hapic.hapic import with_api_doc
  16. # from hapic.hapic import with_api_doc_bis
  17. # from hapic.hapic import generate_doc
  18. # from hapic.hapic import output_body
  19. # from hapic.hapic import input_body
  20. # from hapic.hapic import input_query
  21. # from hapic.hapic import input_path
  22. # from hapic.hapic import input_headers
  23. # from hapic.context import BottleContext
  24. # from hapic.hapic import set_fake_default_context
  25. # from hapic.hapic import error_schema
  26. # class FakeSetContext(object):
  27. # def bottle_context(self):
  28. # hapic.set_fake_default_context(BottleContext())
  29. # def decorator(func):
  30. # def wrapper(*args, **kwargs):
  31. # return func(*args, **kwargs)
  32. # return wrapper
  33. # return decorator
  34. #
  35. #
  36. # class FakeExt(object):
  37. # bottle = FakeSetContext()
  38. #
  39. #
  40. # ext = FakeExt()