mongodb.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # ============================================================================
  2. # This file is part of Pwman3.
  3. #
  4. # Pwman3 is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License, version 2
  6. # as published by the Free Software Foundation;
  7. #
  8. # Pwman3 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.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with Pwman3; if not, write to the Free Software
  15. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. # ============================================================================
  17. # Copyright (C) 2015 Oz Nahum Tiram <nahumoz@gmail.com>
  18. # ============================================================================
  19. from pwman.data.database import Database, __DB_FORMAT__
  20. import pymongo
  21. class MongoDB(Database):
  22. @classmethod
  23. def check_db_version(cls, dburi):
  24. pass
  25. def __init__(self, mongodb_uri, dbformat=__DB_FORMAT__):
  26. self.uri = mongodb_uri
  27. def _open(self):
  28. self._con = pymongo.Connection(self.uri)
  29. def getnodes(self, ids):
  30. pass
  31. def listnodes(self, filter=None):
  32. pass
  33. def add_node(self, node):
  34. pass
  35. def listtags(self):
  36. pass
  37. def editnode(self, nid, **kwargs):
  38. pass
  39. def removenodes(self, nid):
  40. pass
  41. def fetch_crypto_info(self):
  42. pass
  43. def savekey(self, key):
  44. pass
  45. def loadkey(self):
  46. pass
  47. def close(self):
  48. pass