__init__.py 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #!/usr/bin/env python3.5
  2. # Copyright 2017 Digital
  3. #
  4. # This file is part of BeeWatch.
  5. #
  6. # BeeWatch is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # BeeWatch is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with BeeWatch. If not, see <http://www.gnu.org/licenses/>.
  18. ## Imports
  19. # Python imports
  20. import logging
  21. import logging.handlers
  22. import sys
  23. import time
  24. import traceback
  25. # Third party imports
  26. import blinker
  27. import curio
  28. import digilib.network
  29. # import beewatch.server
  30. log = logging.getLogger(__name__+"")
  31. log = logging.getLogger(__name__+".psm")
  32. # class PinScriptManager(object):
  33. # scripts = []
  34. # signals = [
  35. # ]
  36. # handlers = {
  37. # }
  38. # def __init__(self):
  39. # super(PinScriptManager,self).__init__()
  40. # def load_script(self,script):
  41. # if script in self.scripts:
  42. # lpsm.warn("script '{}' is already loaded!")
  43. # self.scripts.add(script)
  44. # script.on_load()
  45. # # def import_script(self,script)
  46. # def unload_script(self,script):
  47. # if script in self.scripts:
  48. # raise ValueError("script '{}' is not loaded")
  49. # script.on_unload()
  50. # self.scripts.remove(script)
  51. # def connect(self,signal,func):
  52. # if not signal in self.signals:
  53. # raise ValueError("There is no signal named '{}'".format(signal))
  54. # self.handlers[signal].append(func)
  55. # def disconnect(self,signal,func):
  56. # if not signal in self.signals:
  57. # raise NameError("There is no signal named '{}'".format(signal))
  58. # self.handlers[signal].append(func)
  59. # class PinScript(object):
  60. # """docstring for Script."""
  61. # def __init__(self):
  62. # super(PinScript, self).__init__()
  63. # def on_load(self):
  64. # pass
  65. # def on_unload(self):
  66. # pass
  67. #
  68. # class TestPS(PinScript):
  69. # def __init__(self):
  70. #
  71. # if __name__ == "__main__":
  72. # psm = PinScriptManager()
  73. #
  74. #