RB.RhythmDBImportJob¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
|
||
r/w/co |
Entry type to use for entries added by this job |
||
r/w/co |
Entry type to use for import error entries added by this job |
||
r/w/co |
Entry type to use for ignored entries added by this job |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the whole import job is complete. |
|
Emitted when an entry has been added to the database by the import job. |
|
Emitted when the directory scan is complete. |
|
Emitted when the status of the import job has changed. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class RB.RhythmDBImportJob(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(db, entry_type, ignore_type, error_type)¶
- Parameters:
db (
RB.RhythmDB
) – theRB.RhythmDB
objectentry_type (
RB.RhythmDBEntryType
) – theRB.RhythmDBEntryType
to use for normal entriesignore_type (
RB.RhythmDBEntryType
) – theRB.RhythmDBEntryType
to use for ignored files (orNone
to not create ignore entries)error_type (
RB.RhythmDBEntryType
) – theRB.RhythmDBEntryType
to use for import error entries (orNone
for none)
- Returns:
new
RB.RhythmDBImportJob
object.- Return type:
Creates a new import job with the specified entry types. Before starting the job, the caller must add one or more paths to import.
- add_uri(uri)¶
- Parameters:
uri (
str
) – the URI to import
Adds a URI to import. All files under the specified URI will be imported.
- cancel()¶
Cancels the import job. The job will cease as soon as possible. More directories may be scanned and more files may be imported before the job actually ceases.
- complete()¶
-
Returns whether the import job is complete.
- get_imported()¶
- Returns:
file count
- Return type:
Returns the number of files successfully imported by the import job so far.
- get_processed()¶
- Returns:
file count
- Return type:
Returns the number of files processed by the import job so far.
- get_total()¶
- Returns:
the total number of files to be processed
- Return type:
Returns the total number of files that will be processed by this import job. This increases as the import directories are scanned.
- includes_uri(uri)¶
- Parameters:
uri (
str
) – a URI to check- Returns:
True
if the import job includes the URI- Return type:
Checks if the specified URI is included in the import job.
- scan_complete()¶
-
Returns whether the directory scan phase of the import job is complete.
- start()¶
Starts the import job. After this method has been called, no more URIs may be added to the import job. May only be called once for a given import job.
- do_entry_added(entry) virtual¶
- Parameters:
entry (
RB.RhythmDBEntry
) –
Signal Details¶
- RB.RhythmDBImportJob.signals.complete(rhythm_d_b_import_job, total)¶
- Signal Name:
complete
- Flags:
- Parameters:
rhythm_d_b_import_job (
RB.RhythmDBImportJob
) – The object which received the signaltotal (
int
) – the number of items imported.
Emitted when the whole import job is complete.
- RB.RhythmDBImportJob.signals.entry_added(rhythm_d_b_import_job, entry)¶
- Signal Name:
entry-added
- Flags:
- Parameters:
rhythm_d_b_import_job (
RB.RhythmDBImportJob
) – The object which received the signalentry (
RB.RhythmDBEntry
) – the newly addedRB.RhythmDBEntry
Emitted when an entry has been added to the database by the import job.
- RB.RhythmDBImportJob.signals.scan_complete(rhythm_d_b_import_job, total)¶
- Signal Name:
scan-complete
- Flags:
- Parameters:
rhythm_d_b_import_job (
RB.RhythmDBImportJob
) – The object which received the signaltotal (
int
) – the number of items scanned.
Emitted when the directory scan is complete. Once the scan is complete, the total number of files to be processed will not change.
- RB.RhythmDBImportJob.signals.status_changed(rhythm_d_b_import_job, total, imported)¶
- Signal Name:
status-changed
- Flags:
- Parameters:
rhythm_d_b_import_job (
RB.RhythmDBImportJob
) – The object which received the signaltotal (
int
) – the current total number of files to processimported (
int
) – the current count of files imported
Emitted when the status of the import job has changed.
Property Details¶
- RB.RhythmDBImportJob.props.db¶
- Name:
db
- Type:
- Default Value:
- Flags:
RB.RhythmDB
object
- RB.RhythmDBImportJob.props.entry_type¶
- Name:
entry-type
- Type:
- Default Value:
- Flags:
Entry type to use for entries added by this job
- RB.RhythmDBImportJob.props.error_type¶
- Name:
error-type
- Type:
- Default Value:
- Flags:
Entry type to use for import error entries added by this job
- RB.RhythmDBImportJob.props.ignore_type¶
- Name:
ignore-type
- Type:
- Default Value:
- Flags:
Entry type to use for ignored entries added by this job