daemon/core/misc/xmlwriter1.py
def addServices(self, devObj):
        ''' Add services and their customizations to the ServicePlan.
        '''
        if not hasattr(devObj, "services") :
            return

        if len(devObj.services) == 0:
            return

        defaults = self.coreSession.services.getdefaultservices(devObj.type)
        if devObj.services == defaults:
            return
        spn = self.createElement("CORE:services")
        spn.setAttribute("name", devObj.name)
        self.appendChild(spn)

        for svc in devObj.services:
            s = self.createElement("service")
            spn.appendChild(s)
            s.setAttribute("name", str(svc._name))
            s.setAttribute("startup_idx", str(svc._startindex))
            if svc._starttime != "":
                s.setAttribute("start_time", str(svc._starttime))
            # only record service names if not a customized service
            if not svc._custom:
                continue
            s.setAttribute("custom", str(svc._custom))
            addelementsfromlist(self, s, svc._dirs, "directory", "name")

            for fn in svc._configs:
                if len(fn) == 0:
                    continue
                f = self.createElement("file")
                f.setAttribute("name", fn)
                # all file names are added to determine when a file has been deleted
                s.appendChild(f)
                data = self.coreSession.services.getservicefiledata(svc, fn)
                if data is None:
                    # this includes only customized file contents and skips
                    # the auto-generated files
                    continue
                txt = self.createTextNode("\n" + data)
                f.appendChild(txt)

            addtextelementsfromlist(self, s, svc._startup, "command",
                                    (("type","start"),))
            addtextelementsfromlist(self, s, svc._shutdown, "command",
                                    (("type","stop"),))
            addtextelementsfromlist(self, s, svc._validate, "command",
                                    (("type","validate"),))
 Add services and their customizations to the ServicePlan.
        
Add services and their customizations to the ServicePlan.
Add services and their customizations to the ServicePlan .
def addServices(self, devObj):
        if not hasattr(devObj, "services") :
            return
        if len(devObj.services) == 0:
            return
        defaults = self.coreSession.services.getdefaultservices(devObj.type)
        if devObj.services == defaults:
            return
        spn = self.createElement("CORE:services")
        spn.setAttribute("name", devObj.name)
        self.appendChild(spn)
        for svc in devObj.services:
            s = self.createElement("service")
            spn.appendChild(s)
            s.setAttribute("name", str(svc._name))
            s.setAttribute("startup_idx", str(svc._startindex))
            if svc._starttime != "":
                s.setAttribute("start_time", str(svc._starttime))
            if not svc._custom:
                continue
            s.setAttribute("custom", str(svc._custom))
            addelementsfromlist(self, s, svc._dirs, "directory", "name")
            for fn in svc._configs:
                if len(fn) == 0:
                    continue
                f = self.createElement("file")
                f.setAttribute("name", fn)
                s.appendChild(f)
                data = self.coreSession.services.getservicefiledata(svc, fn)
                if data is None:
                    continue
                txt = self.createTextNode("\n" + data)
                f.appendChild(txt)
            addtextelementsfromlist(self, s, svc._startup, "command",
                                    (("type","start"),))
            addtextelementsfromlist(self, s, svc._shutdown, "command",
                                    (("type","stop"),))
            addtextelementsfromlist(self, s, svc._validate, "command",
                                    (("type","validate"),))
def addServices ( self , devObj ) : if not hasattr ( devObj , "services" ) : return if len ( devObj . services ) == 0 : return defaults = self . coreSession . services . getdefaultservices ( devObj . type ) if devObj . services == defaults : return spn = self . createElement ( "CORE:services" ) spn . setAttribute ( "name" , devObj . name ) self . appendChild ( spn ) for svc in devObj . services : s = self . createElement ( "service" ) spn . appendChild ( s ) s . setAttribute ( "name" , str ( svc . _name ) ) s . setAttribute ( "startup_idx" , str ( svc . _startindex ) ) if svc . _starttime != "" : s . setAttribute ( "start_time" , str ( svc . _starttime ) ) if not svc . _custom : continue s . setAttribute ( "custom" , str ( svc . _custom ) ) addelementsfromlist ( self , s , svc . _dirs , "directory" , "name" ) for fn in svc . _configs : if len ( fn ) == 0 : continue f = self . createElement ( "file" ) f . setAttribute ( "name" , fn ) s . appendChild ( f ) data = self . coreSession . services . getservicefiledata ( svc , fn ) if data is None : continue txt = self . createTextNode ( "\n" + data ) f . appendChild ( txt ) addtextelementsfromlist ( self , s , svc . _startup , "command" , ( ( "type" , "start" ) , ) ) addtextelementsfromlist ( self , s , svc . _shutdown , "command" , ( ( "type" , "stop" ) , ) ) addtextelementsfromlist ( self , s , svc . _validate , "command" , ( ( "type" , "validate" ) , ) )
Add services and their customizations to the ServicePlan.
Add services and their customizations to the ServicePlan .
''' Add services and their customizations to the ServicePlan.
        ''' # only record service names if not a customized service # all file names are added to determine when a file has been deleted # this includes only customized file contents and skips # the auto-generated files
self
devObj