__init__.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. """
  2. This framework allows data to be logged to a given data store i.e :
  3. - disk, cloud (google, dropbox, box, sugarsync or s3) or a queue server
  4. The intent of the framework is to work as a standalone or embedded in code as a logging framework
  5. usage:
  6. dependencies :
  7. data-transport pip install git+https://dev.the-phi.com/git/steve/data-transport.git
  8. """
  9. import smart.top
  10. import smart.folder
  11. import smart.logger
  12. # from transport import factory
  13. # class logger :
  14. # """
  15. # This class is a basic logger, it will log data regardless of the types of data, We will have subclasses that will implement various data extraction schemas:
  16. # - processes (top),
  17. # """
  18. # def __init__(self,**args):
  19. # """
  20. # :store data store (disk,mongo,couch,google,dropbox)
  21. # :args arguments to pass for the data-store (read transport documentation)
  22. # :notify function that returns true/false for notification
  23. # """
  24. # self.store = factory.instance(type=store,args=args['args'])
  25. # if 'notify' in args :
  26. # self.notify = args
  27. # pass
  28. # def log(self,row):
  29. # """
  30. # This function will log data to a data store
  31. # :row row to be stored
  32. # """
  33. # self.store.write(row=row)
  34. # if(hasattr(self,'notify')):
  35. # if (self.notify(row)) :
  36. # #
  37. # # Let us notify the backend by generating a report and submitting it
  38. # #
  39. # stream = self.get.report()
  40. # pass
  41. # else:
  42. # pass
  43. # def report(self) :