Functions

  special_atom_get (atom)
  util_activate_ui (action, arg)
  util_activate_ui_sync (action, arg)
  util_compute_checksum (image)
  util_confirm_dialog (parent, action, msg)
  util_empty_history (parent_window, client, settings, history)
  util_empty_with_confirmation (client, settings, history)
  util_empty_with_confirmation_sync (client, settings, history)
  util_ensure_history_dir_exists (settings)
  util_get_dbus_at_result (variant, len)
  util_get_dbus_au_result (variant, len)
  util_get_history_dir ()
  util_get_history_dir_path ()
  util_get_history_file (name, extension)
  util_get_history_file_path (name, extension)
  util_has_gnome_shell ()
  util_read_pid_file (component)
  util_replace (text, pattern, substitution)
  util_show_win (application)
  util_spawn (app)
  util_spawn_sync (app)
  util_write_pid_file (component)
  util_xml_decode (text)
  util_xml_encode (text)

Details

GPaste.special_atom_get(atom)
Parameters:atom (GPaste.SpecialAtom) – the atom we want to get
Returns:the atom corresponding to atom
Return type:Gdk.Atom

Find special atoms handled by GPaste

GPaste.util_activate_ui(action, arg)
Parameters:

Activate an action on a GPaste app

GPaste.util_activate_ui_sync(action, arg)
Parameters:
Raises:

GLib.Error

Returns:

whether the action was successful

Return type:

bool

activate an action from GPaste Ui

GPaste.util_compute_checksum(image)
Parameters:image (GdkPixbuf.Pixbuf) – the GdkPixbuf.Pixbuf to checksum
Returns:the newly allocated checksum
Return type:str

Compute the checksum of an image

GPaste.util_confirm_dialog(parent, action, msg)
Parameters:
Return type:

bool

Show GPaste about dialog

GPaste.util_empty_history(parent_window, client, settings, history)
Parameters:

Empty history after prompting user for confirmation

GPaste.util_empty_with_confirmation(client, settings, history)
Parameters:

Empty an history after confirmation. Confirmation is skipped if GPaste is configured to do so.

GPaste.util_empty_with_confirmation_sync(client, settings, history)
Parameters:
Raises:

GLib.Error

Returns:

whether the action was successful

Return type:

bool

Empty an history after confirmation. Confirmation is skipped if GPaste is configured to do so.

GPaste.util_ensure_history_dir_exists(settings)
Parameters:settings (GPaste.Settings) – a GPaste.Settings instance
Returns:where it exists or if there was an error creating it
Return type:bool

Ensure the history dir exists

GPaste.util_get_dbus_at_result(variant, len)
Parameters:
Return type:

int

GPaste.util_get_dbus_au_result(variant, len)
Parameters:
Return type:

int

GPaste.util_get_history_dir()
Returns:the directory
Return type:Gio.File

Get the directory where we store the history

GPaste.util_get_history_dir_path()
Returns:the directory path
Return type:str

Get the path to the directory where we store the history

GPaste.util_get_history_file(name, extension)
Parameters:
  • name (str) – the name of the history
  • extension (str) – the file extension
Returns:

the file

Return type:

Gio.File

Get the file in which we store the history

GPaste.util_get_history_file_path(name, extension)
Parameters:
  • name (str) – the name of the history
  • extension (str) – the file extension
Returns:

the file path

Return type:

str

Get the path to the file in which we store the history

GPaste.util_has_gnome_shell()
Returns:True if gnome-shell is installed
Return type:bool

Check whether gnome-shell is installed or not

GPaste.util_read_pid_file(component)
Parameters:component (str) – The component we’re handling
Returns:the pid
Return type:int

Read the pid file

GPaste.util_replace(text, pattern, substitution)
Parameters:
  • text (str) –
  • pattern (str) –
  • substitution (str) –
Return type:

str

GPaste.util_show_win(application)
Parameters:application (Gio.Application) – a Gtk.Application

Present the application’s window to user

GPaste.util_spawn(app)
Parameters:app (str) – the GPaste app to spawn

spawn a GPaste app

GPaste.util_spawn_sync(app)
Parameters:app (str) – the GPaste app to spawn
Raises:GLib.Error
Returns:whether the spawn was successful
Return type:bool

spawn a GPaste app

GPaste.util_write_pid_file(component)
Parameters:component (str) – The component we’re handling

Write the pid file

GPaste.util_xml_decode(text)
Parameters:text (str) – The text to decode
Returns:the decoded text
Return type:str

Decode the text to its original pre-xml form

GPaste.util_xml_encode(text)
Parameters:text (str) – The text to encode
Returns:the encoded text
Return type:str

Encode the text into its xml form