PageRenderTime 50ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/py/__init__.py

https://bitbucket.org/dac_io/pypy
Python | 148 lines | 112 code | 15 blank | 21 comment | 0 complexity | 81829ac9d382423e79504e5392a8dd07 MD5 | raw file
  1. """
  2. py.test and pylib: rapid testing and development utils
  3. this module uses apipkg.py for lazy-loading sub modules
  4. and classes. The initpkg-dictionary below specifies
  5. name->value mappings where value can be another namespace
  6. dictionary or an import path.
  7. (c) Holger Krekel and others, 2004-2010
  8. """
  9. __version__ = '1.4.7'
  10. from py import _apipkg
  11. # so that py.error.* instances are picklable
  12. import sys
  13. sys.modules['py.error'] = _apipkg.AliasModule("py.error", "py._error", 'error')
  14. _apipkg.initpkg(__name__, attr={'_apipkg': _apipkg}, exportdefs={
  15. # access to all standard lib modules
  16. 'std': '._std:std',
  17. # access to all posix errno's as classes
  18. 'error': '._error:error',
  19. '_pydir' : '.__metainfo:pydir',
  20. 'version': 'py:__version__', # backward compatibility
  21. # pytest-2.0 has a flat namespace, we use alias modules
  22. # to keep old references compatible
  23. 'test' : 'pytest',
  24. 'test.collect' : 'pytest',
  25. 'test.cmdline' : 'pytest',
  26. # hook into the top-level standard library
  27. 'process' : {
  28. '__doc__' : '._process:__doc__',
  29. 'cmdexec' : '._process.cmdexec:cmdexec',
  30. 'kill' : '._process.killproc:kill',
  31. 'ForkedFunc' : '._process.forkedfunc:ForkedFunc',
  32. },
  33. 'apipkg' : {
  34. 'initpkg' : '._apipkg:initpkg',
  35. 'ApiModule' : '._apipkg:ApiModule',
  36. },
  37. 'iniconfig' : {
  38. 'IniConfig' : '._iniconfig:IniConfig',
  39. 'ParseError' : '._iniconfig:ParseError',
  40. },
  41. 'path' : {
  42. '__doc__' : '._path:__doc__',
  43. 'svnwc' : '._path.svnwc:SvnWCCommandPath',
  44. 'svnurl' : '._path.svnurl:SvnCommandPath',
  45. 'local' : '._path.local:LocalPath',
  46. 'SvnAuth' : '._path.svnwc:SvnAuth',
  47. },
  48. # python inspection/code-generation API
  49. 'code' : {
  50. '__doc__' : '._code:__doc__',
  51. 'compile' : '._code.source:compile_',
  52. 'Source' : '._code.source:Source',
  53. 'Code' : '._code.code:Code',
  54. 'Frame' : '._code.code:Frame',
  55. 'ExceptionInfo' : '._code.code:ExceptionInfo',
  56. 'Traceback' : '._code.code:Traceback',
  57. 'getfslineno' : '._code.source:getfslineno',
  58. 'getrawcode' : '._code.code:getrawcode',
  59. 'patch_builtins' : '._code.code:patch_builtins',
  60. 'unpatch_builtins' : '._code.code:unpatch_builtins',
  61. '_AssertionError' : '._code.assertion:AssertionError',
  62. '_reinterpret_old' : '._code.assertion:reinterpret_old',
  63. '_reinterpret' : '._code.assertion:reinterpret',
  64. '_reprcompare' : '._code.assertion:_reprcompare',
  65. '_format_explanation' : '._code.assertion:_format_explanation',
  66. },
  67. # backports and additions of builtins
  68. 'builtin' : {
  69. '__doc__' : '._builtin:__doc__',
  70. 'enumerate' : '._builtin:enumerate',
  71. 'reversed' : '._builtin:reversed',
  72. 'sorted' : '._builtin:sorted',
  73. 'any' : '._builtin:any',
  74. 'all' : '._builtin:all',
  75. 'set' : '._builtin:set',
  76. 'frozenset' : '._builtin:frozenset',
  77. 'BaseException' : '._builtin:BaseException',
  78. 'GeneratorExit' : '._builtin:GeneratorExit',
  79. '_sysex' : '._builtin:_sysex',
  80. 'print_' : '._builtin:print_',
  81. '_reraise' : '._builtin:_reraise',
  82. '_tryimport' : '._builtin:_tryimport',
  83. 'exec_' : '._builtin:exec_',
  84. '_basestring' : '._builtin:_basestring',
  85. '_totext' : '._builtin:_totext',
  86. '_isbytes' : '._builtin:_isbytes',
  87. '_istext' : '._builtin:_istext',
  88. '_getimself' : '._builtin:_getimself',
  89. '_getfuncdict' : '._builtin:_getfuncdict',
  90. '_getcode' : '._builtin:_getcode',
  91. 'builtins' : '._builtin:builtins',
  92. 'execfile' : '._builtin:execfile',
  93. 'callable' : '._builtin:callable',
  94. },
  95. # input-output helping
  96. 'io' : {
  97. '__doc__' : '._io:__doc__',
  98. 'dupfile' : '._io.capture:dupfile',
  99. 'TextIO' : '._io.capture:TextIO',
  100. 'BytesIO' : '._io.capture:BytesIO',
  101. 'FDCapture' : '._io.capture:FDCapture',
  102. 'StdCapture' : '._io.capture:StdCapture',
  103. 'StdCaptureFD' : '._io.capture:StdCaptureFD',
  104. 'TerminalWriter' : '._io.terminalwriter:TerminalWriter',
  105. 'ansi_print' : '._io.terminalwriter:ansi_print',
  106. 'get_terminal_width' : '._io.terminalwriter:get_terminal_width',
  107. 'saferepr' : '._io.saferepr:saferepr',
  108. },
  109. # small and mean xml/html generation
  110. 'xml' : {
  111. '__doc__' : '._xmlgen:__doc__',
  112. 'html' : '._xmlgen:html',
  113. 'Tag' : '._xmlgen:Tag',
  114. 'raw' : '._xmlgen:raw',
  115. 'Namespace' : '._xmlgen:Namespace',
  116. 'escape' : '._xmlgen:escape',
  117. },
  118. 'log' : {
  119. # logging API ('producers' and 'consumers' connected via keywords)
  120. '__doc__' : '._log:__doc__',
  121. '_apiwarn' : '._log.warning:_apiwarn',
  122. 'Producer' : '._log.log:Producer',
  123. 'setconsumer' : '._log.log:setconsumer',
  124. '_setstate' : '._log.log:setstate',
  125. '_getstate' : '._log.log:getstate',
  126. 'Path' : '._log.log:Path',
  127. 'STDOUT' : '._log.log:STDOUT',
  128. 'STDERR' : '._log.log:STDERR',
  129. 'Syslog' : '._log.log:Syslog',
  130. },
  131. })