__init__.py 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # File: __init__.py
  2. # Library: DOPAL - DO Python Azureus Library
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; version 2 of the License.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details ( see the COPYING file ).
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. __version__ = (0, 6, 0)
  17. __version_str__ = '%s.%s' % (__version__[0], ''.join([str(part) for part in __version__[1:]]))
  18. __user_agent__ = 'DOPAL/' + __version_str__
  19. __all__ = [
  20. # Module variables.
  21. '__version__', '__version_str__', '__user_agent__',
  22. # Front-end modules.
  23. 'interact', 'main', 'scripting',
  24. # Core-level modules.
  25. 'aztypes', 'core', 'debug', 'errors', 'utils', 'xmlutils',
  26. # Object-level modules.
  27. 'classes', 'class_defs', 'convert', 'objects', 'obj_impl', 'persistency',
  28. 'logutils',
  29. ]
  30. # Mode definitions:
  31. # 0 - Normal behaviour - should always be distributed with this value.
  32. # 1 - Debug mode - raise debug errors when appropriate.
  33. # 2 - Epydoc mode - used when Epydoc API documentation is being generated.
  34. __dopal_mode__ = 0
  35. __doc__ = '''
  36. DOPAL - DO Python Azureus Library (version %(__version_str__)s)
  37. @var __version__: DOPAL version as a tuple.
  38. @var __version_str__: DOPAL version as a string.
  39. @var __user_agent__: User agent string used by DOPAL when communicating with
  40. Azureus.
  41. @var __dopal_mode__: Debug internal variable which controls some of the
  42. behaviour of how DOPAL works - not meant for external use.
  43. @group Front-end modules: interact, main, scripting
  44. @group Core-level modules: aztypes, core, debug, errors, utils, xmlutils
  45. @group Object-level modules: classes, class_defs, convert, objects, obj_impl,
  46. persistency, logutils
  47. ''' % vars()
  48. # If we are in debug mode, auto-detect whether Epydoc is running and adjust the
  49. # mode accordingly.
  50. import sys
  51. if __dopal_mode__ == 1 and 'epydoc' in sys.modules:
  52. __dopal_mode__ = 2
  53. del sys