KSambaShareData Class Reference
from PyKDE4.kio import *
Detailed Description
This class represents a Samba user share. It is possible to share a directory with one or more different names, update the share details or remove.
- Since:
- 4.7
Enumerations | |
GuestPermission | { GuestsNotAllowed, GuestsAllowed } |
UserShareError | { UserShareOk, UserShareExceedMaxShares, UserShareNameOk, UserShareNameInvalid, UserShareNameInUse, UserSharePathOk, UserSharePathInvalid, UserSharePathNotExists, UserSharePathNotDirectory, UserSharePathNotAbsolute, UserSharePathNotAllowed, UserShareAclOk, UserShareAclInvalid, UserShareAclUserNotValid, UserShareCommentOk, UserShareGuestsOk, UserShareGuestsInvalid, UserShareGuestsNotAllowed, UserShareSystemError } |
Methods | |
__init__ (self) | |
__init__ (self, KSambaShareData other) | |
QString | acl (self) |
QString | comment (self) |
KSambaShareData.GuestPermission | guestPermission (self) |
QString | name (self) |
bool | operator != (self, KSambaShareData other) |
bool | operator == (self, KSambaShareData other) |
QString | path (self) |
KSambaShareData.UserShareError | remove (self) |
KSambaShareData.UserShareError | save (self) |
KSambaShareData.UserShareError | setAcl (self, QString acl) |
KSambaShareData.UserShareError | setComment (self, QString comment) |
KSambaShareData.UserShareError | setGuestPermission (self, KSambaShareData.GuestPermission permission=KSambaShareData.GuestsNotAllowed) |
KSambaShareData.UserShareError | setName (self, QString name) |
KSambaShareData.UserShareError | setPath (self, QString path) |
Method Documentation
__init__ | ( | self ) |
__init__ | ( | self, | ||
KSambaShareData | other | |||
) |
QString acl | ( | self ) |
Returns a containing a string describing the permission added to the users, such as "[DOMAIN\]username1:X,[DOMAIN\]username2:X,...". X stands for "F" (full control), "R" (read-only) and "D" (deny). By dafault the acl is Everyone:R.
- Returns:
- the share acl.
QString comment | ( | self ) |
- Returns:
- the share comment.
KSambaShareData.GuestPermission guestPermission | ( | self ) |
- Returns:
- whether guest access to the share is allowed or not.
QString name | ( | self ) |
- Returns:
- the share name.
bool operator != | ( | self, | ||
KSambaShareData | other | |||
) |
bool operator == | ( | self, | ||
KSambaShareData | other | |||
) |
QString path | ( | self ) |
- Returns:
- the share path.
KSambaShareData.UserShareError remove | ( | self ) |
Unshare the folder held by the object.
- Returns:
- UserShareOk if the share was removed.
KSambaShareData.UserShareError save | ( | self ) |
Share the folder with the information that has been set.
- Returns:
- UserShareOk if the share was added.
KSambaShareData.UserShareError setAcl | ( | self, | ||
QString | acl | |||
) |
Sets the acl to the share.
- Parameters:
-
acl the acl that will be given to the share.
- Returns:
- UserShareAclOk if the acl is valid.
- Returns:
- UserShareAclInvalid if the acl has invalid format.
- Returns:
- UserShareAclUserNotValid if one of the users in the acl is invalid.
KSambaShareData.UserShareError setComment | ( | self, | ||
QString | comment | |||
) |
Sets the comment for the share.
- Parameters:
-
comment the comment that will be given to the share.
- Returns:
- UserShareCommentOk always.
KSambaShareData.UserShareError setGuestPermission | ( | self, | ||
KSambaShareData.GuestPermission | permission=KSambaShareData.GuestsNotAllowed | |||
) |
Flags if guest is allowed or not to access the share.
- Parameters:
-
permission the permission that will be given to the share.
- Returns:
- UserShareGuestsOk if the permission was set.
- Returns:
- UserShareGuestsNotAllowed if the system does not allow guest access to the shares.
KSambaShareData.UserShareError setName | ( | self, | ||
QString | name | |||
) |
Sets the share name. If the share name is changed and valid it will remove the existing share and will create a new share. The share name cannot use a name of a system user or containing the forbidden characters '%, <, >, *, ?, |, /, \, +, =, ;, :, ",,. To check if the name is available or valid use the method KSambaShare.isShareNameAvailable().
- Parameters:
-
name the name that will be given to the share.
- Returns:
- UserShareNameOk if the name is valid.
- Returns:
- UserShareNameInvalid if the name contains invalid characters.
- Returns:
- UserShareNameInUse if the name is already in use by another shared folder or a by a system user.
KSambaShareData.UserShareError setPath | ( | self, | ||
QString | path | |||
) |
Set the path for the share.
- Parameters:
-
path the path that will be given to the share.
- Returns:
- UserSharePathOk if valid.
- Returns:
- UserSharePathInvalid if the path is in invalid format.
- Returns:
- UserSharePathNotExists if the path does not exists.
- Returns:
- UserSharePathNotDirectory if the path points to file instead of a directory.
- Returns:
- UserSharePathNotAbsolute if the path is not is absolute form.
- Returns:
- UserSharePathNotAllowed if the path is not owner by the user.
Enumeration Documentation
GuestPermission |
- Enumerator:
-
GuestsNotAllowed GuestsAllowed
UserShareError |
- Enumerator:
-
UserShareOk UserShareExceedMaxShares UserShareNameOk UserShareNameInvalid UserShareNameInUse UserSharePathOk UserSharePathInvalid UserSharePathNotExists UserSharePathNotDirectory UserSharePathNotAbsolute UserSharePathNotAllowed UserShareAclOk UserShareAclInvalid UserShareAclUserNotValid UserShareCommentOk UserShareGuestsOk UserShareGuestsInvalid UserShareGuestsNotAllowed UserShareSystemError