PyANGKernel.GKFilePath

class GKFilePath

A path of the filesystem. Can be a directory path or a path + filename. Relative (to the project folder) and absolute paths are supported.

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

__init__()
__init__(model, path)
Parameters:
exists()
Return type:

bool

Returns true if the file path exists.

fileName()
Return type:

str

Returns the name of the file, excluding the path.

getAbsolutePath()
Return type:

str

Returns the file name and path as an absolute path. @remark If the path is relative, it will be interpreted as relative to the Project folder.

getModel()
Return type:

GKModel

Returns the model.

getProjectPath()
Return type:

str

Return the path of the Project folder.

isAbsolute()
Return type:

bool

Returns true if the path is absolute.

isEmpty()
Return type:

bool

Check if the path is empty.

isInsideProject()
Return type:

bool

Returns true if the path is inside the Project folder or if it’s relative.

isRelative()
Return type:

bool

Returns true if the path is relative.

mkpath(isFile)
Parameters:

isFile – bool

Return type:

bool

Creates the directory and all parent directories. * @arg isFile true to interpret the text after the last separator (/) as the name of a file, not a folder. * @return true if the directory path exists at the end of the call, false otherwise.

path()
Return type:

str

Returns the file’s path. This doesn’t include the file name.

See also

setPath()

setPath(path)
Parameters:

path – str

Set the model and path. * @remark The model needs to have been set before.

See also

path()

setPath(model, path)
Parameters:

Set the model and path.

string()
Return type:

str

Returns the file name, including the path (which may be absolute or relative).

toAbsolutePath()

Changes the path to an absolute path.

toRelativePath()
Return type:

bool

Changes the path to a relative path if it’s inside the Project folder. * @return true if successful, false otherwise.