KDE 4.9 PyKDE API Reference

- KDE's Python API

# KUserGroup Class Reference

`from PyKDE4.kdecore import *`

## Detailed Description

\class KUserGroup kuser.h <KUserGroup>

Represents a group on your system

This class represents a group on your system. You can either get information about the group of the current user, of fetch information about a group on the system. Instances of this class will be explicitly shared, so copying objects is very cheap and you can safely pass objects by value.

Author:
  Jan Schaefer <j_schaef@informatik.uni-kl.de>

## Methods

| __init__ (self, QString name)
| __init__ (self, QString name)
| __init__ (self, KUser.UIDMode mode=KUser.UseEffectiveUID)
| __init__ (self, gid_t gid)
| __init__ (self, KUserGroup group)
gid_t | 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, |
|  | gid_t | 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, |
|  | KUserGroup | group
| ) |  |  |

Creates a new KUserGroup instance from another KUserGroup object

Parameters:

  | group | the KUserGroup to copy

gid_t 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

## Static Method Documentation

QStringList allGroupNames | ( |  | ) |

Returns a list of all group names on this system

[KUserGroup] allGroups | ( |  | ) |

Returns a list of all groups on this system