Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_unframework.py 2.7KB

1 year ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. ###############################################################################
  2. #
  3. # The MIT License (MIT)
  4. #
  5. # Copyright (c) typedef int GmbH
  6. #
  7. # Permission is hereby granted, free of charge, to any person obtaining a copy
  8. # of this software and associated documentation files (the "Software"), to deal
  9. # in the Software without restriction, including without limitation the rights
  10. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11. # copies of the Software, and to permit persons to whom the Software is
  12. # furnished to do so, subject to the following conditions:
  13. #
  14. # The above copyright notice and this permission notice shall be included in
  15. # all copies or substantial portions of the Software.
  16. #
  17. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  23. # THE SOFTWARE.
  24. #
  25. ###############################################################################
  26. """
  27. This provides a version of the API which only throws exceptions;
  28. this is the default so that you have to pick asyncio or twisted
  29. explicitly by calling .use_twisted() or .use_asyncio()
  30. """
  31. from txaio import _Config
  32. using_twisted = False
  33. using_asyncio = False
  34. config = _Config()
  35. def _throw_usage_error(*args, **kw):
  36. raise RuntimeError(
  37. "To use txaio, you must first select a framework "
  38. "with .use_twisted() or .use_asyncio()"
  39. )
  40. # all the txaio API methods just raise the error
  41. with_config = _throw_usage_error
  42. create_future = _throw_usage_error
  43. create_future_success = _throw_usage_error
  44. create_future_error = _throw_usage_error
  45. create_failure = _throw_usage_error
  46. as_future = _throw_usage_error
  47. is_future = _throw_usage_error
  48. reject = _throw_usage_error
  49. cancel = _throw_usage_error
  50. resolve = _throw_usage_error
  51. add_callbacks = _throw_usage_error
  52. gather = _throw_usage_error
  53. is_called = _throw_usage_error
  54. call_later = _throw_usage_error
  55. failure_message = _throw_usage_error
  56. failure_traceback = _throw_usage_error
  57. failure_format_traceback = _throw_usage_error
  58. make_batched_timer = _throw_usage_error
  59. make_logger = _throw_usage_error
  60. start_logging = _throw_usage_error
  61. set_global_log_level = _throw_usage_error
  62. get_global_log_level = _throw_usage_error
  63. add_log_categories = _throw_usage_error
  64. IFailedFuture = _throw_usage_error
  65. ILogger = _throw_usage_error
  66. sleep = _throw_usage_error
  67. time_ns = _throw_usage_error
  68. perf_counter_ns = _throw_usage_error