Soup.CookieJarDB¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
Cookie-storage filename |
||
r/w/co/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Soup.CookieJarDB(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Database-based Cookie Jar.
[class`CookieJarDB`] is a [class`CookieJar`] that reads cookies from and writes them to a sqlite database in the new Mozilla format.
(This is identical to
SoupCookieJarSqlitein libsoup-gnome; it has just been moved into libsoup proper, and renamed to avoid conflicting.)Since 3.8 this class implements [iface`Gio`.Initable] to track failures opening the database. See [ctor`SoupCookieJarDB`.new_with_error].
- classmethod new(filename, read_only)¶
- Parameters:
- Returns:
the new
Soup.CookieJar- Return type:
Creates a [class`CookieJarDB`].
filename will be read in at startup to create an initial set of cookies. If read_only is
False, then the non-session cookies will be written to filename when the [signal`CookieJar`:py:func:::changed<Soup.CookieJarDB.signals.changed>] signal is emitted from the jar. (If read_only isTrue, then the cookie jar will only be used for this session, and changes made to it will be lost when the jar is destroyed.)
- classmethod new_with_error(filename, read_only)¶
- Parameters:
- Raises:
- Returns:
the new
Soup.CookieJar, orNoneon error- Return type:
Creates a [class`CookieJarDB`], returning
Noneand setting error if the database file cannot be opened.Added in version 3.8.
- get_max_size()¶
- Returns:
Database max file size
- Return type:
Get the maximum size for the database file storage
This method returns the currently configured max database file size. A return value of zero indicates that no limit is configured.
Added in version 3.8.
- set_max_size(max_size)¶
- Parameters:
max_size (
int) – Max database file size, in bytes error AGLib.Error- Raises:
- Returns:
Trueis configuration was successful, otherwiseFalseand error will be set.- Return type:
Set the maximum size for the database file storage
If max_size is 0, it means “no limit”, in which case the database file size will be limited only by the database capabilities / intrinsic limits.
If max_size has a higher limit than supported by the database, the max_size will be internally set to the limit supported by the database.
The max_size will be internally truncated to a multiple of the database page size. If the page size is, for example, 4K, setting a max size of 10K will effectively limit the database size to 8K to ensure it does not grow beyond the specified limit.
Attempting to set a limit that is less than the already used database file storage will NOT truncate the database, but won’t allow the database to grow further in size (although writes might be still accepted within the already allocated space).
This value does not persist in the database. Each construction of this class must set the property again or it will use the default value.
Added in version 3.8.
Property Details¶
- Soup.CookieJarDB.props.filename¶
- Name:
filename- Type:
- Default Value:
- Flags:
Cookie-storage filename.
- Soup.CookieJarDB.props.max_size¶
- Name:
max-size- Type:
- Default Value:
0- Flags:
Cookie-storage maximum database size.
Added in version 3.8.