Passim.Item¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Passim.Item(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A shared item.
- classmethod flag_from_string(item_flag)¶
- Parameters:
- Returns:
enumerated value
- Return type:
Converts a string to an enumerated item flag.
New in version 0.1.0.
- classmethod flag_to_string(item_flag)¶
- Parameters:
item_flag (
int) – item flags, e.g.Passim.ITEM_FLAG_NEXT_REBOOT- Returns:
identifier string
- Return type:
Converts an enumerated item flag to a string.
New in version 0.1.0.
- classmethod from_variant(value)¶
- Parameters:
value (
GLib.Variant) – the serialized data- Returns:
a new
Passim.Item, orNoneif value was invalid- Return type:
Creates a new item using serialized data.
New in version 0.1.0.
- classmethod new()¶
- Returns:
a new
Passim.Item- Return type:
Creates a new item.
New in version 0.1.0.
- add_flag(flag)¶
- Parameters:
flag (
int) – the #PassimItemFlags
Adds a specific item flag to the item.
New in version 0.1.0.
- get_age()¶
- Returns:
time in seconds, or 0 for invalid.
- Return type:
Gets the current file age.
New in version 0.1.0.
- get_basename()¶
-
Gets the basename of the file that was published.
New in version 0.1.0.
- get_bytes()¶
- Returns:
a
GLib.Bytes, orNoneif unset- Return type:
Gets the local bytes in the cache.
New in version 0.1.0.
- get_cmdline()¶
-
Gets the cmdline of the binary that published the item.
New in version 0.1.0.
- get_ctime()¶
- Returns:
the creation time, or
Noneif unset- Return type:
Gets the creation time of the file.
New in version 0.1.0.
- get_file()¶
-
Gets the local file in the cache.
New in version 0.1.0.
- get_flags()¶
- Returns:
item flags, or 0 if unset
- Return type:
Gets the item flags.
New in version 0.1.0.
- get_hash()¶
-
Gets the file hash.
New in version 0.1.0.
- get_max_age()¶
- Returns:
time in seconds
- Return type:
Gets the maximum permitted file age.
New in version 0.1.0.
- Returns:
the count, or 0 if unset
- Return type:
Gets the current number of times the item has been shared to other machines.
New in version 0.1.0.
- Returns:
share limit, or 0 if unset
- Return type:
Gets the maximum number of times that the file can be shared.
New in version 0.1.0.
- get_size()¶
- Returns:
share limit, or 0 if unset
- Return type:
Gets the size of the file in bytes.
New in version 0.1.2.
- get_stream()¶
- Returns:
a
Gio.InputStream, orNoneif unset- Return type:
Gets the input stream for the item.
New in version 0.1.5.
- has_flag(flag)¶
-
Finds if the item has a specific item flag.
New in version 0.1.0.
- load_filename(filename)¶
- Parameters:
filename (
str) – a filename with full path- Raises:
- Return type:
Loads the item from a file on disk.
New in version 0.1.0.
- remove_flag(flag)¶
- Parameters:
flag (
int) – a item flag
Removes a specific item flag from the item.
New in version 0.1.0.
- set_basename(basename)¶
-
Sets the basename of the file that was published.
New in version 0.1.0.
- set_bytes(bytes)¶
- Parameters:
bytes (
GLib.BytesorNone) – aGLib.Bytes
Sets the local bytes in the cache.
New in version 0.1.0.
- set_cmdline(cmdline)¶
-
Sets the cmdline of the binary that published the item.
NOTE: this is desgined as a hint, and should not be used for security. The command line is obtained via /proc/<pid>/cmdline and it may be possible to falsify the data by a malicious binary running as root under certain conditions.
New in version 0.1.0.
- set_ctime(ctime)¶
- Parameters:
ctime (
GLib.DateTimeorNone) – aGLib.DateTime
Sets the creation time of the file.
New in version 0.1.0.
- set_file(file)¶
-
Sets the local file in the cache.
New in version 0.1.0.
- set_flags(flags)¶
- Parameters:
flags (
int) – item flags, e.g.Passim.ITEM_FLAG_NEXT_REBOOT
Sets the item flags.
New in version 0.1.0.
- set_hash(hash)¶
-
Sets the file hash.
New in version 0.1.0.
- set_max_age(max_age)¶
- Parameters:
max_age (
int) – time in seconds
Sets the maximum permitted file age.
New in version 0.1.0.
- Parameters:
share_count (
int) – the count, or 0 to unset
Sets the current number of times the item has been shared to other machines.
New in version 0.1.0.
- Parameters:
share_limit (
int) – the share limit, or 0
Sets the maximum number of times that the file can be shared.
New in version 0.1.0.
- set_size(size)¶
- Parameters:
size (
int) – the share limit, or 0
Sets the size of the file in bytes.
New in version 0.1.2.
- set_stream(stream)¶
- Parameters:
stream (
Gio.InputStreamorNone) – aGio.InputStream
Sets the input stream stream for the item.
NOTE: This *MUST* be a #GUnixInputStream, or subclass thereof.
New in version 0.1.5.
- to_string()¶
-
Builds a text representation of the object.
New in version 0.1.0.