(self, wanted_group)
Get group from a group file
Get group from a group file
Get group from a group file
def _get_group_from_file(self, wanted_group):
        """Get group from a group file"""
        wanted_gid = ""
        if (isinstance(wanted_group, int) or
                re.match("^\\d+$", wanted_group)):
            wanted_gid = str(wanted_group)
            wanted_group = ""
        try:
            ingroup = open(self.group_file)
        except (IOError, OSError):
            return ("", "", "")
        else:
            for line in ingroup:
                (group, dummy, gid, users) = line.strip().split(':')
                if wanted_group and group == wanted_group:
                    return (group, gid, users)
                if wanted_gid and gid == wanted_gid:
                    return (group, gid, users)
            ingroup.close()
            return ("", "", "")
def _get_group_from_file ( self , wanted_group ) : wanted_gid = "" if ( isinstance ( wanted_group , int ) or re . match ( "^\\d+$" , wanted_group ) ) : wanted_gid = str ( wanted_group ) wanted_group = "" try : ingroup = open ( self . group_file ) except ( IOError , OSError ) : return ( "" , "" , "" ) else : for line in ingroup : ( group , dummy , gid , users ) = line . strip ( ) . split ( ':' ) if wanted_group and group == wanted_group : return ( group , gid , users ) if wanted_gid and gid == wanted_gid : return ( group , gid , users ) ingroup . close ( ) return ( "" , "" , "" )