Ejemplo n.º 1
0
    def __init__(self, session, object_id, values=None):
        """
        Create a WirelessModel instance.

        :param core.session.Session session: core session we are tied to
        :param int object_id: object id
        :param values: values
        """
        Configurable.__init__(self, session, object_id)
Ejemplo n.º 2
0
 def setcustomservice(self, objid, service, values):
     ''' Store service customizations in an instantiated service object
         using a list of values that came from a config message.
     '''
     if service._custom:
         s = service
     else:
         # instantiate the class, for storing config customization
         s = service()
     # values are new key=value format; not all keys need to be present
     # a missing key means go with the default
     if Configurable.haskeyvalues(values):
         for v in values:
             key, value = v.split('=', 1)
             s.setvalue(key, value)
     # old-style config, list of values
     else:
         s.fromvaluelist(values)
         
     # assume custom service already in dict
     if service._custom:
         return
     # add the custom service to dict
     if objid in self.customservices:
         self.customservices[objid] += (s, )
     else:
         self.customservices[objid] = (s, )
Ejemplo n.º 3
0
 def setcustomservice(self, objid, service, values):
     ''' Store service customizations in an instantiated service object
         using a list of values that came from a config message.
     '''
     if service._custom:
         s = service
     else:
         # instantiate the class, for storing config customization
         s = service()
     # values are new key=value format; not all keys need to be present
     # a missing key means go with the default
     if Configurable.haskeyvalues(values):
         for v in values:
             key, value = v.split('=', 1)
             s.setvalue(key, value)
     # old-style config, list of values
     else:
         s.fromvaluelist(values)
         
     # assume custom service already in dict
     if service._custom:
         return
     # add the custom service to dict
     if objid in self.customservices:
         self.customservices[objid] += (s, )
     else:
         self.customservices[objid] = (s, )
Ejemplo n.º 4
0
 def __init__(self, session, objid, verbose = False, values = None):
     Configurable.__init__(self, session, objid)
     self.verbose = verbose
Ejemplo n.º 5
0
 def __init__(self, session, objid, verbose=False, values=None):
     Configurable.__init__(self, session, objid)
     self.verbose = verbose