GPaste.Client

g GObject.GInterface GObject.GInterface Gio.AsyncInitable Gio.AsyncInitable GObject.GInterface->Gio.AsyncInitable Gio.DBusInterface Gio.DBusInterface GObject.GInterface->Gio.DBusInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object Gio.DBusProxy Gio.DBusProxy GObject.Object->Gio.DBusProxy GPaste.Client GPaste.Client Gio.AsyncInitable->Gio.DBusProxy Gio.DBusInterface->Gio.DBusProxy Gio.DBusProxy->GPaste.Client Gio.Initable->Gio.DBusProxy

Subclasses:

None

Methods

Inherited:

Gio.DBusProxy (25), GObject.Object (37), Gio.AsyncInitable (4), Gio.DBusInterface (3), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

class

new (callback, *user_data)

class

new_finish (result)

class

new_sync ()

about (callback, *user_data)

about_finish (result)

about_sync ()

add (text, callback, *user_data)

add_file (file, callback, *user_data)

add_file_finish (result)

add_file_sync (file)

add_finish (result)

add_password (name, password, callback, *user_data)

add_password_finish (result)

add_password_sync (name, password)

add_sync (text)

backup_history (history, backup, callback, *user_data)

backup_history_finish (result)

backup_history_sync (history, backup)

delete (uuid, callback, *user_data)

delete_finish (result)

delete_history (name, callback, *user_data)

delete_history_finish (result)

delete_history_sync (name)

delete_password (name, callback, *user_data)

delete_password_finish (result)

delete_password_sync (name)

delete_sync (uuid)

empty_history (name, callback, *user_data)

empty_history_finish (result)

empty_history_sync (name)

get_element (uuid, callback, *user_data)

get_element_at_index (index, callback, *user_data)

get_element_at_index_finish (result)

get_element_at_index_sync (index)

get_element_finish (result)

get_element_kind (uuid, callback, *user_data)

get_element_kind_finish (result)

get_element_kind_sync (uuid)

get_element_sync (uuid)

get_elements (uuids, callback, *user_data)

get_elements_finish (result)

get_elements_sync (uuids)

get_history (callback, *user_data)

get_history_finish (result)

get_history_name (callback, *user_data)

get_history_name_finish (result)

get_history_name_sync ()

get_history_size (name, callback, *user_data)

get_history_size_finish (result)

get_history_size_sync (name)

get_history_sync ()

get_raw_element (uuid, callback, *user_data)

get_raw_element_finish (result)

get_raw_element_sync (uuid)

get_raw_history (callback, *user_data)

get_raw_history_finish (result)

get_raw_history_sync ()

get_version ()

is_active ()

list_histories (callback, *user_data)

list_histories_finish (result)

list_histories_sync ()

merge (decoration, separator, uuids, callback, *user_data)

merge_finish (result)

merge_sync (decoration, separator, uuids)

on_extension_state_changed (state, callback, *user_data)

on_extension_state_changed_finish (result)

on_extension_state_changed_sync (state)

reexecute (callback, *user_data)

reexecute_finish (result)

reexecute_sync ()

rename_password (old_name, new_name, callback, *user_data)

rename_password_finish (result)

rename_password_sync (old_name, new_name)

replace (uuid, contents, callback, *user_data)

replace_finish (result)

replace_sync (uuid, contents)

search (pattern, callback, *user_data)

search_finish (result)

search_sync (pattern)

select (uuid, callback, *user_data)

select_finish (result)

select_sync (uuid)

set_password (uuid, name, callback, *user_data)

set_password_finish (result)

set_password_sync (uuid, name)

show_history (callback, *user_data)

show_history_finish (result)

show_history_sync ()

switch_history (name, callback, *user_data)

switch_history_finish (result)

switch_history_sync (name)

track (state, callback, *user_data)

track_finish (result)

track_sync (state)

upload (uuid, callback, *user_data)

upload_finish (result)

upload_sync (uuid)

Virtual Methods

Inherited:

Gio.DBusProxy (2), GObject.Object (7), Gio.AsyncInitable (2), Gio.DBusInterface (3), Gio.Initable (1)

Properties

Inherited:

Gio.DBusProxy (9)

Signals

Inherited:

Gio.DBusProxy (2), GObject.Object (1)

Name

Short Description

delete-history

The “delete-history” signal is emitted when we delete a history.

empty-history

The “empty-history” signal is emitted when we empty a history.

show-history

The “show-history” signal is emitted when we switch from a history to another.

switch-history

The “switch-history” signal is emitted when we switch from a history to another.

tracking

update

The “update” signal is emitted whenever anything changed in the history (something was added, removed, selected, replaced…).

Fields

Inherited:

Gio.DBusProxy (2), GObject.Object (1)

Class Details

class GPaste.Client(**kwargs)
Bases:

Gio.DBusProxy

Abstract:

No

Structure:

GPaste.ClientClass

classmethod new(callback, *user_data)
Parameters:

Create a new instance of GPaste.Client

classmethod new_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback function passed to the async ctor.

Raises:

GLib.Error

Returns:

a newly allocated GPaste.Client free it with GObject.Object.unref

Return type:

GPaste.Client

Create a new instance of GPaste.Client

classmethod new_sync()
Raises:

GLib.Error

Returns:

a newly allocated GPaste.Client free it with GObject.Object.unref

Return type:

GPaste.Client

Create a new instance of GPaste.Client

about(callback, *user_data)
Parameters:

Display the about dialog

about_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Display the about dialog

about_sync()
Raises:

GLib.Error

Display the about dialog

add(text, callback, *user_data)
Parameters:

Add an item to the #GPasteDaemon

add_file(file, callback, *user_data)
Parameters:

Add the file contents to the #GPasteDaemon

add_file_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Add the file contents to the #GPasteDaemon

add_file_sync(file)
Parameters:

file (str) – the file to add

Raises:

GLib.Error

Add the file contents to the #GPasteDaemon

add_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Add an item to the #GPasteDaemon

add_password(name, password, callback, *user_data)
Parameters:

Add the password to the #GPasteDaemon

add_password_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Add the password to the #GPasteDaemon

add_password_sync(name, password)
Parameters:
  • name (str) – the name to identify the password to add

  • password (str) – the password to add

Raises:

GLib.Error

Add the password to the #GPasteDaemon

add_sync(text)
Parameters:

text (str) – the text to add

Raises:

GLib.Error

Add an item to the #GPasteDaemon

backup_history(history, backup, callback, *user_data)
Parameters:

Backup the current history

backup_history_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Backup the current history

backup_history_sync(history, backup)
Parameters:
  • history (str) – the name of the history

  • backup (str) – the name of the backup

Raises:

GLib.Error

Backup the current history

delete(uuid, callback, *user_data)
Parameters:

Delete an item from the #GPasteDaemon

delete_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Delete an item from the #GPasteDaemon

delete_history(name, callback, *user_data)
Parameters:

Delete a history

delete_history_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Delete a history

delete_history_sync(name)
Parameters:

name (str) – the name of the history to delete

Raises:

GLib.Error

Delete a history

delete_password(name, callback, *user_data)
Parameters:

Delete the password from the #GPasteDaemon

delete_password_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Delete the password from the #GPasteDaemon

delete_password_sync(name)
Parameters:

name (str) – the name of the password to delete

Raises:

GLib.Error

Delete the password from the #GPasteDaemon

delete_sync(uuid)
Parameters:

uuid (str) – the uuid of the element we want to delete

Raises:

GLib.Error

Delete an item from the #GPasteDaemon

empty_history(name, callback, *user_data)
Parameters:

Empty the history from the #GPasteDaemon

empty_history_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Empty the history from the #GPasteDaemon

empty_history_sync(name)
Parameters:

name (str) – the name of the history to empty

Raises:

GLib.Error

Empty the history from the #GPasteDaemon

get_element(uuid, callback, *user_data)
Parameters:

Get an item from the #GPasteDaemon

get_element_at_index(index, callback, *user_data)
Parameters:

Get an item from the #GPasteDaemon

get_element_at_index_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Returns:

a new GPaste.ClientItem

Return type:

GPaste.ClientItem

Get an item from the #GPasteDaemon

get_element_at_index_sync(index)
Parameters:

index (int) – the index of the element we want to get

Raises:

GLib.Error

Returns:

a new GPaste.ClientItem

Return type:

GPaste.ClientItem

Get an item from the #GPasteDaemon

get_element_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Returns:

a newly allocated string

Return type:

str

Get an item from the #GPasteDaemon

get_element_kind(uuid, callback, *user_data)
Parameters:

Get the kind of an item from the #GPasteDaemon

get_element_kind_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Returns:

The GPaste.ItemKind

Return type:

GPaste.ItemKind

Get this kind of an item from the #GPasteDaemon

get_element_kind_sync(uuid)
Parameters:

uuid (str) – the uuid of the element we want to get

Raises:

GLib.Error

Returns:

The GPaste.ItemKind

Return type:

GPaste.ItemKind

Get the kind of an item from the #GPasteDaemon

get_element_sync(uuid)
Parameters:

uuid (str) – the uuid of the element we want to get

Raises:

GLib.Error

Returns:

a newly allocated string

Return type:

str

Get an item from the #GPasteDaemon

get_elements(uuids, callback, *user_data)
Parameters:

Get some items from the #GPasteDaemon

get_elements_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Returns:

a newly allocated array of string

Return type:

[GPaste.ClientItem]

Get some items from the #GPasteDaemon

get_elements_sync(uuids)
Parameters:

uuids ([str]) – the uuids of the elements we want to get

Raises:

GLib.Error

Returns:

a newly allocated array of string

Return type:

[GPaste.ClientItem]

Get some items from the #GPasteDaemon

get_history(callback, *user_data)
Parameters:

Get the history from the #GPasteDaemon

get_history_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Returns:

a newly allocated array of string

Return type:

[GPaste.ClientItem]

Get the history from the #GPasteDaemon

get_history_name(callback, *user_data)
Parameters:

Get the name of the history from the #GPasteDaemon

get_history_name_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Returns:

a newly allocated string

Return type:

str

Get the name of the history from the #GPasteDaemon

get_history_name_sync()
Raises:

GLib.Error

Returns:

a newly allocated string

Return type:

str

Get the name of the history from the #GPasteDaemon

get_history_size(name, callback, *user_data)
Parameters:

Get the history isize from the #GPasteDaemon

get_history_size_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Returns:

the size of the history

Return type:

int

Get the history size from the #GPasteDaemon

get_history_size_sync(name)
Parameters:

name (str) – the name of the history

Raises:

GLib.Error

Returns:

the size of the history

Return type:

int

Get the history size from the #GPasteDaemon

get_history_sync()
Raises:

GLib.Error

Returns:

a newly allocated array of string

Return type:

[GPaste.ClientItem]

Get the history from the #GPasteDaemon

get_raw_element(uuid, callback, *user_data)
Parameters:

Get an item from the #GPasteDaemon

get_raw_element_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Returns:

a newly allocated string

Return type:

str

Get an item from the #GPasteDaemon

get_raw_element_sync(uuid)
Parameters:

uuid (str) – the uuid of the element we want to get

Raises:

GLib.Error

Returns:

a newly allocated string

Return type:

str

Get an item from the #GPasteDaemon

get_raw_history(callback, *user_data)
Parameters:

Get the history from the #GPasteDaemon

get_raw_history_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Returns:

a newly allocated array of string

Return type:

[GPaste.ClientItem]

Get the history from the #GPasteDaemon

get_raw_history_sync()
Raises:

GLib.Error

Returns:

a newly allocated array of string

Return type:

[GPaste.ClientItem]

Get the history from the #GPasteDaemon

get_version()
Returns:

the version of the daemon

Return type:

str

Get the version of the running gpaste daemon

is_active()
Returns:

whether the daemon is active or not

Return type:

bool

Check if the daemon is active

list_histories(callback, *user_data)
Parameters:

List all available hisotries

list_histories_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Returns:

a newly allocated array of string

Return type:

[str]

List all available hisotries

list_histories_sync()
Raises:

GLib.Error

Returns:

a newly allocated array of string

Return type:

[str]

List all available hisotries

merge(decoration, separator, uuids, callback, *user_data)
Parameters:
  • decoration (str or None) – the decoration to apply to each entry

  • separator (str or None) – the separator to add between each entry

  • uuids ([str]) – the uuids of the elements we want to get

  • callback (Gio.AsyncReadyCallback or None) – A Gio.AsyncReadyCallback to call when the request is satisfied or None if you don’t care about the result of the method invocation.

  • user_data (object or None) – The data to pass to callback.

Merge some history entries

If decoration is “ and separator is , and entries are foo bar baz result will be “foo”,”bar”,”baz”

merge_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Merge some history entries

merge_sync(decoration, separator, uuids)
Parameters:
  • decoration (str or None) – the decoration to apply to each entry

  • separator (str or None) – the separator to add between each entry

  • uuids ([str]) – the uuids of the elements we want to get

Raises:

GLib.Error

Merge some history entries

If decoration is “ and separator is , and entries are foo bar baz result will be “foo”,”bar”,”baz”

on_extension_state_changed(state, callback, *user_data)
Parameters:

Call this when the extension changes its state

on_extension_state_changed_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Call this when the extension changes its state

on_extension_state_changed_sync(state)
Parameters:

state (bool) – the new state of the extension

Raises:

GLib.Error

Call this when the extension changes its state

reexecute(callback, *user_data)
Parameters:

Reexecute the #GPasteDaemon

reexecute_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Reexecute the #GPasteDaemon

reexecute_sync()
Raises:

GLib.Error

Reexecute the #GPasteDaemon

rename_password(old_name, new_name, callback, *user_data)
Parameters:
  • old_name (str) – the old name of the password to rename

  • new_name (str) – the new name to give it

  • callback (Gio.AsyncReadyCallback or None) – A Gio.AsyncReadyCallback to call when the request is satisfied or None if you don’t care about the result of the method invocation.

  • user_data (object or None) – The data to pass to callback.

Rename the password in the #GPasteDaemon

rename_password_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Rename the password in the #GPasteDaemon

rename_password_sync(old_name, new_name)
Parameters:
  • old_name (str) – the name of the password to rename

  • new_name (str) – the new name to give it

Raises:

GLib.Error

Rename the password in the #GPasteDaemon

replace(uuid, contents, callback, *user_data)
Parameters:
  • uuid (str) – the uuid of the element we want to replace

  • contents (str) – the replacement contents

  • callback (Gio.AsyncReadyCallback or None) – A Gio.AsyncReadyCallback to call when the request is satisfied or None if you don’t care about the result of the method invocation.

  • user_data (object or None) – The data to pass to callback.

Replace the contents of an item

replace_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Replace the contents of an item

replace_sync(uuid, contents)
Parameters:
  • uuid (str) – the uuid of the element we want to replace

  • contents (str) – the replacement contents

Raises:

GLib.Error

Replace the contents of an item

search(pattern, callback, *user_data)
Parameters:

Search for items matching pattern in history

search_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Returns:

The indexes of the matching items

Return type:

[str]

Search for items matching pattern in history

search_sync(pattern)
Parameters:

pattern (str) – the pattern to look for in history

Raises:

GLib.Error

Returns:

The uuids of the matching items

Return type:

[str]

Search for items matching pattern in history

select(uuid, callback, *user_data)
Parameters:

Select an item from the #GPasteDaemon

select_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Select an item from the #GPasteDaemon

select_sync(uuid)
Parameters:

uuid (str) – the uuid of the element we want to select

Raises:

GLib.Error

Select an item from the #GPasteDaemon

set_password(uuid, name, callback, *user_data)
Parameters:
  • uuid (str) – the uuid of the element we want to set as password

  • name (str) – the name to identify the password

  • callback (Gio.AsyncReadyCallback or None) – A Gio.AsyncReadyCallback to call when the request is satisfied or None if you don’t care about the result of the method invocation.

  • user_data (object or None) – The data to pass to callback.

Set the item as password

set_password_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Set the item as password

set_password_sync(uuid, name)
Parameters:
  • uuid (str) – the uuid of the element we want to set as password

  • name (str) – the name to identify the password

Raises:

GLib.Error

Set the item as password

show_history(callback, *user_data)
Parameters:

Emit the ShowHistory signal

show_history_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Emit the ShowHistory signal

show_history_sync()
Raises:

GLib.Error

Emit the ShowHistory signal

switch_history(name, callback, *user_data)
Parameters:

Switch to another history

switch_history_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Switch to another history

switch_history_sync(name)
Parameters:

name (str) – the name of the history to switch to

Raises:

GLib.Error

Switch to another history

track(state, callback, *user_data)
Parameters:

Change the tracking state of the #GPasteDaemon

track_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Change the tracking state of the #GPasteDaemon

track_sync(state)
Parameters:

state (bool) – the new tracking state of the #GPasteDaemon

Raises:

GLib.Error

Change the tracking state of the #GPasteDaemon

upload(uuid, callback, *user_data)
Parameters:

Upload an item to a pastebin service

upload_finish(result)
Parameters:

result (Gio.AsyncResult) – A Gio.AsyncResult obtained from the Gio.AsyncReadyCallback passed to the async call.

Raises:

GLib.Error

Upload an item to a pastebin service

upload_sync(uuid)
Parameters:

uuid (str) – the uuid of the element we want to upload

Raises:

GLib.Error

Upload an item to a pastebin service

Signal Details

GPaste.Client.signals.delete_history(client, history)
Signal Name:

delete-history

Flags:

RUN_LAST

Parameters:
  • client (GPaste.Client) – The object which received the signal

  • history (str) – the name of the history we deleted

The “delete-history” signal is emitted when we delete a history.

GPaste.Client.signals.empty_history(client, history)
Signal Name:

empty-history

Flags:

RUN_LAST

Parameters:
  • client (GPaste.Client) – The object which received the signal

  • history (str) – the name of the history we emptied

The “empty-history” signal is emitted when we empty a history.

GPaste.Client.signals.show_history(client)
Signal Name:

show-history

Flags:

RUN_LAST

Parameters:

client (GPaste.Client) – The object which received the signal

The “show-history” signal is emitted when we switch from a history to another.

GPaste.Client.signals.switch_history(client, history)
Signal Name:

switch-history

Flags:

RUN_LAST

Parameters:
  • client (GPaste.Client) – The object which received the signal

  • history (str) – the name of the history we switch to

The “switch-history” signal is emitted when we switch from a history to another.

GPaste.Client.signals.tracking(client, object)
Signal Name:

tracking

Flags:

RUN_LAST

Parameters:
GPaste.Client.signals.update(client, action, target, index)
Signal Name:

update

Flags:

RUN_LAST

Parameters:

The “update” signal is emitted whenever anything changed in the history (something was added, removed, selected, replaced…).