# Pympress package

This page contains the inline documentation, generated from the code using sphinx.

The code is documented in the source using the [Google style](https://google.github.io/styleguide/pyguide.html) for docstrings. Sphinx has gathered a [set of examples](http://www.sphinx-doc.org/en/latest/ext/example_google.html) which serves as a better crash course than the full style reference.

Retructured text (rst) can be used inside the comments and docstrings.

## Modules

```eval_rst .. automodule:: pympress.__main__

> members: |
> undoc-members: |
> show-inheritance:

# `pympress.util` – various utility functions

`pympress.util.``fileopen`(f)

  Call the right function to open files, based on the platform.

  Parameters: | f (`str`) – path to the file to open

`pympress.util.``get_default_config`()

  Returns the path to the configuration file containing the defaults.

  Returns: | The path to the portable configuration file.
  Return type: | str

`pympress.util.``get_icon_path`(name)

  Load an image from pympress’ resources in a Gdk Pixbuf.

  Parameters: | name (`str`) – The name of the icon to load
  Returns: | The loaded icon
  Return type: | `Pixbuf`

`pympress.util.``get_locale_dir`()

  Returns the path to the locale directory

  Returns: | The path to the locale directory
  Return type: | str

`pympress.util.``get_log_path`()

  Returns the appropriate path to the log file in the user app dirs.

  Returns: | path to the log file.
  Return type: | `str`

`pympress.util.``get_portable_config`()

  Returns the path to the configuration file for a portable install (i.e. in the install root).

  Returns: | The path to the portable configuration file.
  Return type: | str

`pympress.util.``get_pympress_meta`()

  Get metadata (version, etc) from pympress’ __init__.py

`pympress.util.``get_ui_resource_file`(name)

  Load an UI definition file from pympress’ resources.

  Parameters: | name (`str`) – The name of the UI to load
  Returns: | The full path to the glade file
  Return type: | `str`

`pympress.util.``get_user_config`()

  Returns the path to the configuration file in the user config directory.

  Returns: | path to the user configuration file.
  Return type: | `str`

`pympress.util.``list_icons`()

  List the icons from pympress’ resources.

  Returns: | The paths to the icons in the pixmaps directory
  Return type: | `list` of `str`

`pympress.util.``load_style_provider`(style_provider)

  Load the css and in a style provider.

  Parameters: | style_provider (`CssProvider`) – The style provider in which to load CSS
  Returns: | The style provider with CSS loaded
  Return type: | `CssProvider`

`pympress.util.``set_screensaver`(must_disable, window)

  Enable or disable the screensaver.

  Parameters:

  - must_disable (`bool`) – if `True`, indicates that the screensaver must be disabled; otherwise it will be enabled
  - window (`Window`) – The window on the screen where the screensaver is to be suspended.

```