Logo Search packages:      
Sourcecode: kde-guidance version File versions  Download package

def unixauthdb::Context::newGroup (   self,
  defaults = False,
  systemgroup = False 
)

Create a new UnixGroup object.

Creates a new blank UnixGroup object. The object is not part of the
current Context. You need to add it yourself using addGroup().

Newly allocated GIDs are unique with respect to the list of UnixGroup
objects in the Context. 

Keyword arguments:
defaults -- Set to true if the new object should be filled in with
    reasonable default values for the GID and groupname.
    (default False)
systemgroup  -- Set to True if the newly allocated GID should come
        from the pool of system group IDs. (default False)

Returns a new UnixGroup object.

Definition at line 141 of file unixauthdb.py.

00141                                                        :
        """Create a new UnixGroup object.

        Creates a new blank UnixGroup object. The object is not part of the
        current Context. You need to add it yourself using addGroup().

        Newly allocated GIDs are unique with respect to the list of UnixGroup
        objects in the Context. 

        Keyword arguments:
        defaults -- Set to true if the new object should be filled in with
                    reasonable default values for the GID and groupname.
                    (default False)
        systemgroup  -- Set to True if the newly allocated GID should come
                        from the pool of system group IDs. (default False)

        Returns a new UnixGroup object.
        """
        newgroupobj = self._createGroup()
        if defaults:
            if systemgroup:
                r = xrange(0,self.last_system_gid)
            else:
                r = xrange(self.first_gid,self.last_gid)
            for candiate in r:
                for u in self._groups:
                    if u.getGID()==candiate:
                        break
                else:
                    newgroupobj.setGID(candiate)
                    break
            if self.lookupGroupname(u'new_group') is None:
                newgroupobj.setGroupname(u'new_group')
            else:
                i = 1
                while 1:
                    if self.lookupGroupname(u'new_user_'+str(i)) is None:
                        newgroupobj.setGroupname(u'new_user_'+str(i))
                        break
                    i += 1
        return newgroupobj

    def _createGroup(self):


Generated by  Doxygen 1.6.0   Back to index