Guest User

Untitled

a guest
Aug 26th, 2011
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. from Globals import InitializeClass
  2. from Products.ZenRelations.RelSchema import *
  3. from Products.ZenModel.Device import Device
  4. from Products.ZenModel.ZenossSecurity import ZEN_VIEW
  5. from copy import deepcopy
  6.  
  7.  
  8. class PrinterDevice(Device):
  9. "A Printer Device"
  10.  
  11. _relations = Device._relations + (
  12. ('PrinterToner', ToManyCont(ToOne,
  13. 'ZenPacks.community.PrinterMIB', 'PrinterDev')),
  14. )
  15.  
  16. factory_type_information = deepcopy(Device.factory_type_information)
  17. factory_type_information[0]['actions'] += (
  18. { 'id' : 'PrinterToner'
  19. , 'name' : 'Printer Toners'
  20. , 'action' : 'PrinterDeviceDetail'
  21. , 'permissions' : (ZEN_VIEW, ) },
  22. )
  23. test=""
  24.  
  25. def hola(self):
  26. print('Hola')
  27. def __init__(self, *args, **kw):
  28. Device.__init__(self, *args, **kw)
  29. self.buildRelations()
  30.  
  31.  
  32. InitializeClass(PrinterDevice)
Advertisement
Add Comment
Please, Sign In to add comment