1
# Add debtags tags to the index
12
Return general information about the plugin.
14
The information returned is a dict with various keywords:
17
the last modified timestamp of this data source. This will be used
18
to see if we need to update the database or not. A timestamp of 0
19
means that this data source is either missing or always up to date.
21
an array of dicts { name: name, desc: description }, one for every
22
numeric value indexed by this data source.
24
Note that this method can be called before init. The idea is that, if
25
the timestamp shows that this plugin is currently not needed, then the
26
long initialisation can just be skipped.
28
file = apt.apt_pkg.Config.FindFile("Dir::Cache::pkgcache")
29
return dict(timestamp = os.path.getmtime(file))
31
def init(self, info, progress):
33
If needed, perform long initialisation tasks here.
35
info is a dictionary with useful information. Currently it contains
38
"values": a dict mapping index mnemonics to index numbers
40
The progress indicator can be used to report progress.
46
Return documentation information for this data source.
48
The documentation information is a dictionary with these keys:
49
name: the name for this data source
50
shortDesc: a short description
51
fullDoc: the full description as a chapter in ReST format
55
shortDesc = "Origin information",
57
The Origin data source indexes origin information
63
def index(self, document, pkg):
65
Update the document with the information from this data source.
67
document is the document to update
68
pkg is the python-apt Package object for this package
73
for origin in ver.origins:
74
document.add_term("XOA"+origin.archive)
75
document.add_term("XOC"+origin.component)
76
document.add_term("XOL"+origin.label)
77
document.add_term("XOO"+origin.origin)
78
document.add_term("XOS"+origin.site)
80
def indexDeb822(self, document, pkg):
82
Update the document with the information from this data source.
84
This is alternative to index, and it is used when indexing with package
85
data taken from a custom Packages file.
87
document is the document to update
88
pkg is the Deb822 object for this package
90
# NOTHING here, does not make sense for non-downloadable data
96
Create and return the plugin object.