guibot.path module

class guibot.path.Path[source]

Bases: object

Handler for currently used target paths or sources of targets with a desired name.

The methods of this class are shared among all of its instances.


Add a path to the list of currently accessible paths if it wasn’t already added.

Parameters:directory (str) – path to add

Remove a path from the list of currently accessible paths.

Parameters:directory (str) – path to add
Returns:whether the removal succeeded
Return type:bool

Clear all currently accessible paths.

search(filename, restriction='', silent=False)[source]

Search for a filename in the currently accessible paths.

  • filename (str) – filename of the target to search for
  • restriction (str) – simple string to restrict the number of paths
  • silent (bool) – whether to return None instead of error out

the full name of the found target file or None if silent and no file was found

Return type:

str or None


FileNotFoundError if no such file was found and not silent