KUserGroup

KDE 4.2 PyKDE API Reference

- KDE's Python API

# KUserGroup Class Reference

`from PyKDE4.kdecore import *`

## Detailed Description

## Methods
| __init__ (self, QString name)
| __init__ (self, QString name)
| __init__ (self, KUser.UIDMode mode=KUser.UseEffectiveUID)
| __init__ (self, K_GID gid)
| __init__ (self, group g)
| __init__ (self, KUserGroup group)
K_GID | gid (self)
bool | isValid (self)
QString | name (self)
bool | operator != (self, KUserGroup group)
bool | operator == (self, KUserGroup group)
QStringList | userNames (self)
[KUser] | users (self)
## Static Methods
QStringList | allGroupNames ()
[KUserGroup] | allGroups ()

## Method Documentation

__init__ | ( | self, |
|  | QString | name
| ) |  |  |

Create an object from a group name. If the group does not exist, isValid() will return false.

Parameters:

  | name | the name of the group

__init__ | ( | self, |
|  | QString | name
| ) |  |  |

Create an object from a group name. If the group does not exist, isValid() will return false.

Parameters:

  | name | the name of the group

__init__ | ( | self, |
|  | KUser.UIDMode | mode=KUser.UseEffectiveUID
| ) |  |  |

Create an object from the group of the current user.

Parameters:

  | mode | if #KUser.UseEffectiveUID is passed the effective user will be used. If #KUser.UseRealUserID is passed the real user will be used. The real UID will be different than the effective UID in setuid programs; in such a case use the effective UID for checking permissions, and the real UID for displaying information about the group associated with the user.

__init__ | ( | self, |
|  | K_GID | gid
| ) |  |  |

Create an object from a group id. If the group does not exist, isValid() will return false.

Parameters:

  | gid | the group id

__init__ | ( | self, |
|  | group | g
| ) |  |  |

Creates an object from a group structure. If the pointer is null, isValid() will return false.

Parameters:

  | g | the group structure to create the group from.

__init__ | ( | self, |
|  | KUserGroup | group
| ) |  |  |

Creates a new KUserGroup instance from another KUserGroup object

Parameters:

  | group | the KUserGroup to copy

QStringList allGroupNames | ( |  | ) |

Returns a list of all group names on this system

[KUserGroup] allGroups | ( |  | ) |

Returns a list of all groups on this system

K_GID gid | ( |  | self ) |

Returns the group id of the group.

Returns:
  the group id of the group or -1 if the group is invalid

bool isValid | ( |  | self ) |

Returns whether the group is valid. A KUserGroup object can be invalid if it is created with a non-existing gid or name.

Returns:
  true if the group is valid

QString name | ( |  | self ) |

The name of the group.

Returns:
  the name of the group

bool operator != | ( | self, |
|  | KUserGroup | group
| ) |  |  |

Two KUserGroup objects are not equal if their gid()s are not identical. Invalid groups always compare unequal.

Returns:
  true if the groups are not identical

bool operator == | ( | self, |
|  | KUserGroup | group
| ) |  |  |

Two KUserGroup objects are equal if their gid()s are identical. Invalid groups never compare equal.

Returns:
  true if the groups are identical

QStringList userNames | ( |  | self ) |

Returns a list of all user login names of the group.

Returns:
  a list of all user login names of the group

[KUser] users | ( |  | self ) |

Returns a list of all users of the group.

Returns:
  a list of all users of the group