__init__.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. """
  2. /***************************************************************************
  3. Name : DB Manager
  4. Description : Database manager plugin for QGIS
  5. Date : May 23, 2011
  6. copyright : (C) 2011 by Giuseppe Sucameli
  7. email : brush.tyler@gmail.com
  8. ***************************************************************************/
  9. /***************************************************************************
  10. * *
  11. * This program is free software; you can redistribute it and/or modify *
  12. * it under the terms of the GNU General Public License as published by *
  13. * the Free Software Foundation; either version 2 of the License, or *
  14. * (at your option) any later version. *
  15. * *
  16. ***************************************************************************/
  17. """
  18. import os
  19. from importlib import import_module
  20. current_dir = os.path.dirname(__file__)
  21. def load(db, mainwindow):
  22. for name in os.listdir(current_dir):
  23. if not os.path.isdir(os.path.join(current_dir, name)):
  24. continue
  25. if name in ('__pycache__'):
  26. continue
  27. try:
  28. plugin_module = import_module('.'.join((__package__, name)))
  29. except ImportError:
  30. continue
  31. plugin_module.load(db, mainwindow)