GData.DocumentsEntry

g GData.AccessHandler GData.AccessHandler GData.DocumentsEntry GData.DocumentsEntry GData.AccessHandler->GData.DocumentsEntry GData.Entry GData.Entry GData.Entry->GData.DocumentsEntry GData.Parsable GData.Parsable GData.Parsable->GData.Entry GObject.GInterface GObject.GInterface GObject.GInterface->GData.AccessHandler GObject.Object GObject.Object GObject.Object->GData.Parsable

Subclasses:

GData.DocumentsDocument, GData.DocumentsFolder

Methods

Inherited:

GData.Entry (24), GData.Parsable (5), GObject.Object (37), GData.AccessHandler (2)

Structs:

GObject.ObjectClass (5)

add_documents_property (property)

can_edit ()

get_document_id ()

get_document_properties ()

get_edited ()

get_file_size ()

get_last_modified_by ()

get_last_viewed ()

get_path ()

get_quota_used ()

get_resource_id ()

get_shared_with_me_date ()

is_deleted ()

remove_documents_property (property)

set_writers_can_invite (writers_can_invite)

writers_can_invite ()

Virtual Methods

Inherited:

GData.Parsable (9), GObject.Object (7), GData.AccessHandler (1)

Properties

Inherited:

GData.Entry (10), GData.Parsable (1)

Name

Type

Flags

Short Description

can-edit

bool

r

Indicates whether the current user can edit this file.

document-id

str

d/r

The document ID of the document. deprecated

edited

int

d/r

The last time the document was edited. deprecated

file-size

int

r

The size of the document.

is-deleted

bool

r/w

Indicates whether the document entry has been deleted.

last-modified-by

GData.Author

r

Indicates the author of the last modification.

last-viewed

int

r

The last time the document was viewed.

quota-used

int

r

The amount of user quota the document is occupying.

resource-id

str

r

The resource ID of the document.

shared-with-me-date

int

r

The time at which this file was shared with the user.

writers-can-invite

bool

r/w

Indicates whether writers can invite others to edit.

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GData.Entry

r

Class Details

class GData.DocumentsEntry(**kwargs)
Bases:

GData.Entry, GData.AccessHandler

Abstract:

Yes

Structure:

GData.DocumentsEntryClass

All the fields in the GData.DocumentsEntry structure are private and should never be accessed directly.

New in version 0.4.0.

add_documents_property(property)
Parameters:

property (GData.DocumentsProperty) – a GData.DocumentsProperty

Returns:

True if the property doesn’t exist in the “properties” list, or that GData.DocumentsProperty :value of property has been set to None by a call to GData.DocumentsEntry.remove_documents_property(). False if property exists in “properties” list, or in the case that self or property aren’t of proper types.

Return type:

bool

Inserts/updates property on “properties” list in self. Since, a GData.DocumentsProperty is uniquely identified by GData.DocumentsProperty :key and GData.DocumentsProperty :visibility, if no such property exists in the “properties” list, then a property will be appended to the list after incrementing the reference count.

In case that there already exists a property in “properties”, the GData.DocumentsProperty inside the list will be updated to property. Note that GData.DocumentsProperty :value has no role in determining the uniqueness of a GData.DocumentsProperty.

The changes made by this function will be local only and you need to explicitly update self by calling GData.Service.update_entry().

New in version 0.17.11.

can_edit()
Returns:

True if the current user can edit this file, False otherwise

Return type:

bool

Gets the GData.DocumentsEntry :can-edit property.

New in version 0.18.0.

get_document_id()
Returns:

the document’s document ID

Return type:

str

Gets the GData.DocumentsEntry :document-id property. The

online GData Documentation refers to these as “untyped resource IDs”.

New in version 0.4.0.

Deprecated since version 0.11.0: Use GData.DocumentsEntry.get_resource_id() instead. See GData.DocumentsEntry :document-id.

get_document_properties()
Returns:

a GLib.List of pointers to GData.DocumentsPropertys

Return type:

[GData.DocumentsProperty]

Gets a list of the GData.DocumentsPropertys for this entry.

New in version 0.17.11.

get_edited()
Returns:

the UNIX timestamp for the time the document was last edited, or -1

Return type:

int

Gets the GData.DocumentsEntry :edited property. If the property is unset, -1 will be returned.

New in version 0.4.0.

Deprecated since version 0.17.0: Use GData.Entry.get_updated() instead. See GData.DocumentsEntry :edited.

get_file_size()
Returns:

the size of the document in bytes

Return type:

int

Gets the GData.DocumentsEntry :file-size property.

New in version 0.17.7.

get_last_modified_by()
Returns:

the author who last modified the document

Return type:

GData.Author

Gets the GData.DocumentsEntry :last-modified-by property.

New in version 0.4.0.

get_last_viewed()
Returns:

the UNIX timestamp for the time the document was last viewed, or -1

Return type:

int

Gets the GData.DocumentsEntry :last-viewed property. If the property is unset, -1 will be returned.

New in version 0.4.0.

get_path()
Returns:

the folder hierarchy path containing the document, or None; free with GLib.free()

Return type:

str

Builds a path for the GData.DocumentsEntry, starting from a root node and traversing the folders containing the document, then ending with the document’s ID.

An example path would be: /folder_id1/folder_id2/document_id.

Note: the path is based on the entry/document IDs of the folders (GData.Entry :id) and document (GData.DocumentsEntry :document-id), and not the entries’ human-readable names (GData.Entry :title).

New in version 0.4.0.

get_quota_used()
Returns:

the number of quota bytes used by the document

Return type:

int

Gets the GData.DocumentsEntry :quota-used property.

New in version 0.13.0.

get_resource_id()
Returns:

the document’s resource ID

Return type:

str

Gets the GData.DocumentsEntry :resource-id property.

New in version 0.11.0.

get_shared_with_me_date()
Returns:

the UNIX timestamp for the time at which this file was shared with the user, or -1

Return type:

int

Gets the GData.DocumentsEntry :shared-with-me-date property. If the property is unset, -1 will be returned.

New in version 0.18.0.

is_deleted()
Returns:

True if the document has been deleted, False otherwise

Return type:

bool

Gets the GData.DocumentsEntry :is-deleted property.

New in version 0.5.0.

remove_documents_property(property)
Parameters:

property (GData.DocumentsProperty) – a GData.DocumentsProperty

Returns:

True if property has been successfully removed from “properties” list on self, False otherwise.

Return type:

bool

The property specified by property will be removed from the “properties” list on self.

Only GData.DocumentsProperty :key and GData.DocumentsProperty :visibility will be used to find property in “properties” list. GData.DocumentsProperty :value has no role in determining the uniqueness of a GData.DocumentsProperty.

The changes made by this function will be local only and you need to explicitly update self by calling GData.Service.update_entry().

New in version 0.17.11.

set_writers_can_invite(writers_can_invite)
Parameters:

writers_can_invite (bool) – True if writers can invite other people to edit the document, False otherwise

Sets the GData.DocumentsEntry :writers-can-invite property to writers_can_invite.

New in version 0.4.0.

writers_can_invite()
Returns:

True if writers can invite other people to edit the document, False otherwise

Return type:

bool

Gets the GData.DocumentsEntry :writers-can-invite property.

New in version 0.4.0.

Property Details

GData.DocumentsEntry.props.can_edit
Name:

can-edit

Type:

bool

Default Value:

False

Flags:

READABLE

Indicates whether the current user can edit this file.

New in version 0.18.0.

GData.DocumentsEntry.props.document_id
Name:

document-id

Type:

str

Default Value:

None

Flags:

DEPRECATED, READABLE

The document ID of the document, which is different from its entry ID (GData.Entry :id). The

online GData Documentation refers to these as “untyped resource IDs”.

New in version 0.4.0.

Deprecated since version 0.11.0: This a substring of the GData.DocumentsEntry :resource-id, which is more general and should be used instead.

GData.DocumentsEntry.props.edited
Name:

edited

Type:

int

Default Value:

-1

Flags:

DEPRECATED, READABLE

The last time the document was edited. If the document has not been edited yet, the content indicates the time it was created.

New in version 0.4.0.

Deprecated since version 0.17.0: This is identical to GData.Entry :updated.

GData.DocumentsEntry.props.file_size
Name:

file-size

Type:

int

Default Value:

0

Flags:

READABLE

The size of the document. This is only set for non-document files. Standard formats, such as GData.DocumentsText, GData.DocumentsSpreadsheet and GData.DocumentsFolder are not binary data and so have no size. Measured in bytes.

New in version 0.17.7.

GData.DocumentsEntry.props.is_deleted
Name:

is-deleted

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Indicates whether the document entry has been deleted (moved to the trash). Deleted documents will only appear in query results if the GData.DocumentsQuery :show-deleted property is True.

New in version 0.5.0.

GData.DocumentsEntry.props.last_modified_by
Name:

last-modified-by

Type:

GData.Author

Default Value:

None

Flags:

READABLE

Indicates the author of the last modification.

New in version 0.4.0.

GData.DocumentsEntry.props.last_viewed
Name:

last-viewed

Type:

int

Default Value:

-1

Flags:

READABLE

The last time the document was viewed.

New in version 0.4.0.

GData.DocumentsEntry.props.quota_used
Name:

quota-used

Type:

int

Default Value:

0

Flags:

READABLE

The amount of user quota the document is occupying. Currently, only arbitrary files consume file space quota (whereas standard document formats, such as GData.DocumentsText, GData.DocumentsSpreadsheet and GData.DocumentsFolder don’t). Measured in bytes.

This property will be 0 for documents which aren’t consuming any quota.

New in version 0.13.0.

GData.DocumentsEntry.props.resource_id
Name:

resource-id

Type:

str

Default Value:

None

Flags:

READABLE

The resource ID of the document. This should not normally need to be used in client code, and is mostly for internal use. To uniquely identify a given document or folder, use its GData.Entry :id.

Resource IDs have the form: document|drawing|pdf|spreadsheet|presentation|folder:untyped resource ID; whereas entry IDs have the form: https://docs.google.com/feeds/id/resource ID in version 3 of the API.

For more information, see the

Google Documents API reference.

New in version 0.11.0.

GData.DocumentsEntry.props.shared_with_me_date
Name:

shared-with-me-date

Type:

int

Default Value:

-1

Flags:

READABLE

The UNIX timestamp for the time at which this file was shared with the user.

New in version 0.18.0.

GData.DocumentsEntry.props.writers_can_invite
Name:

writers-can-invite

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Indicates whether the document entry writers can invite others to edit the document.

New in version 0.4.0.