indent
This commit is contained in:
parent
d62bb9016a
commit
7ba8a79ee7
@ -84,11 +84,11 @@ SearchData_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_SearchDataObject,
|
||||
"SearchData([type=AND|OR], [stemlang=somelanguage|null])\n"
|
||||
"\n"
|
||||
"A SearchData object describes a query. It has a number of global\n"
|
||||
"parameters and a chain of search clauses.\n"
|
||||
);
|
||||
"SearchData([type=AND|OR], [stemlang=somelanguage|null])\n"
|
||||
"\n"
|
||||
"A SearchData object describes a query. It has a number of global\n"
|
||||
"parameters and a chain of search clauses.\n"
|
||||
);
|
||||
|
||||
static int
|
||||
SearchData_init(recoll_SearchDataObject *self, PyObject *args, PyObject *kwargs)
|
||||
@ -119,13 +119,13 @@ SearchData_init(recoll_SearchDataObject *self, PyObject *args, PyObject *kwargs)
|
||||
/* Note: addclause necessite And/Or vient du fait que le string peut avoir
|
||||
plusieurs mots. A transferer dans l'i/f Python ou pas ? */
|
||||
PyDoc_STRVAR(doc_addclause,
|
||||
"addclause(type='and'|'or'|'filename'|'phrase'|'near'|'path'|'sub',\n"
|
||||
" qstring=string, slack=int, field=string, stemming=1|0,\n"
|
||||
" subSearch=SearchData, exclude=0|1, anchorstart=0|1, anchorend=0|1,\n"
|
||||
" casesens=0|1, diacsens=0|1)\n"
|
||||
"Adds a simple clause to the SearchData And/Or chain, or a subquery\n"
|
||||
"defined by another SearchData object\n"
|
||||
);
|
||||
"addclause(type='and'|'or'|'filename'|'phrase'|'near'|'path'|'sub',\n"
|
||||
" qstring=string, slack=int, field=string, stemming=1|0,\n"
|
||||
" subSearch=SearchData, exclude=0|1, anchorstart=0|1, anchorend=0|1,\n"
|
||||
" casesens=0|1, diacsens=0|1)\n"
|
||||
"Adds a simple clause to the SearchData And/Or chain, or a subquery\n"
|
||||
"defined by another SearchData object\n"
|
||||
);
|
||||
|
||||
/* Forward declaration only, definition needs recoll_searchDataType */
|
||||
static PyObject *
|
||||
@ -328,11 +328,11 @@ Doc_init(recoll_DocObject *self, PyObject *, PyObject *)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_Doc_getbinurl,
|
||||
"getbinurl(none) -> binary url\n"
|
||||
"\n"
|
||||
"Returns an URL with a path part which is a as bit for bit copy of the \n"
|
||||
"file system path, without encoding\n"
|
||||
);
|
||||
"getbinurl(none) -> binary url\n"
|
||||
"\n"
|
||||
"Returns an URL with a path part which is a as bit for bit copy of the \n"
|
||||
"file system path, without encoding\n"
|
||||
);
|
||||
|
||||
static PyObject *
|
||||
Doc_getbinurl(recoll_DocObject *self)
|
||||
@ -347,10 +347,10 @@ Doc_getbinurl(recoll_DocObject *self)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_Doc_setbinurl,
|
||||
"setbinurl(url) -> binary url\n"
|
||||
"\n"
|
||||
"Set the URL from binary path like file://may/contain/unencodable/bytes\n"
|
||||
);
|
||||
"setbinurl(url) -> binary url\n"
|
||||
"\n"
|
||||
"Set the URL from binary path like file://may/contain/unencodable/bytes\n"
|
||||
);
|
||||
|
||||
static PyObject *
|
||||
Doc_setbinurl(recoll_DocObject *self, PyObject *value)
|
||||
@ -371,8 +371,8 @@ Doc_setbinurl(recoll_DocObject *self, PyObject *value)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_Doc_keys,
|
||||
"keys() -> list of doc object keys (attribute names)\n"
|
||||
);
|
||||
"keys() -> list of doc object keys (attribute names)\n"
|
||||
);
|
||||
static PyObject *
|
||||
Doc_keys(recoll_DocObject *self)
|
||||
{
|
||||
@ -394,8 +394,8 @@ Doc_keys(recoll_DocObject *self)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_Doc_items,
|
||||
"items() -> dictionary of doc object keys/values\n"
|
||||
);
|
||||
"items() -> dictionary of doc object keys/values\n"
|
||||
);
|
||||
static PyObject *
|
||||
Doc_items(recoll_DocObject *self)
|
||||
{
|
||||
@ -501,9 +501,9 @@ static bool idocget(recoll_DocObject *self, const string& key, string& value)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_Doc_get,
|
||||
"get(key) -> value\n"
|
||||
"Retrieve the named doc attribute\n"
|
||||
);
|
||||
"get(key) -> value\n"
|
||||
"Retrieve the named doc attribute\n"
|
||||
);
|
||||
static PyObject *
|
||||
Doc_get(recoll_DocObject *self, PyObject *args)
|
||||
{
|
||||
@ -740,41 +740,41 @@ static PyMappingMethods doc_as_mapping = {
|
||||
|
||||
|
||||
PyDoc_STRVAR(doc_DocObject,
|
||||
"Doc()\n"
|
||||
"\n"
|
||||
"A Doc object contains index data for a given document.\n"
|
||||
"The data is extracted from the index when searching, or set by the\n"
|
||||
"indexer program when updating. The Doc object has no useful methods but\n"
|
||||
"many attributes to be read or set by its user. It matches exactly the\n"
|
||||
"Rcl::Doc c++ object. Some of the attributes are predefined, but, \n"
|
||||
"especially when indexing, others can be set, the name of which will be\n"
|
||||
"processed as field names by the indexing configuration.\n"
|
||||
"Inputs can be specified as unicode or strings.\n"
|
||||
"Outputs are unicode objects.\n"
|
||||
"All dates are specified as unix timestamps, printed as strings\n"
|
||||
"Predefined attributes (index/query/both):\n"
|
||||
" text (index): document plain text\n"
|
||||
" url (both)\n"
|
||||
" fbytes (both) optional) file size in bytes\n"
|
||||
" filename (both)\n"
|
||||
" fmtime (both) optional file modification date. Unix time printed \n"
|
||||
" as string\n"
|
||||
" dbytes (both) document text bytes\n"
|
||||
" dmtime (both) document creation/modification date\n"
|
||||
" ipath (both) value private to the app.: internal access path\n"
|
||||
" inside file\n"
|
||||
" mtype (both) mime type for original document\n"
|
||||
" mtime (query) dmtime if set else fmtime\n"
|
||||
" origcharset (both) charset the text was converted from\n"
|
||||
" size (query) dbytes if set, else fbytes\n"
|
||||
" sig (both) app-defined file modification signature. \n"
|
||||
" For up to date checks\n"
|
||||
" relevancyrating (query)\n"
|
||||
" abstract (both)\n"
|
||||
" author (both)\n"
|
||||
" title (both)\n"
|
||||
" keywords (both)\n"
|
||||
);
|
||||
"Doc()\n"
|
||||
"\n"
|
||||
"A Doc object contains index data for a given document.\n"
|
||||
"The data is extracted from the index when searching, or set by the\n"
|
||||
"indexer program when updating. The Doc object has no useful methods but\n"
|
||||
"many attributes to be read or set by its user. It matches exactly the\n"
|
||||
"Rcl::Doc c++ object. Some of the attributes are predefined, but, \n"
|
||||
"especially when indexing, others can be set, the name of which will be\n"
|
||||
"processed as field names by the indexing configuration.\n"
|
||||
"Inputs can be specified as unicode or strings.\n"
|
||||
"Outputs are unicode objects.\n"
|
||||
"All dates are specified as unix timestamps, printed as strings\n"
|
||||
"Predefined attributes (index/query/both):\n"
|
||||
" text (index): document plain text\n"
|
||||
" url (both)\n"
|
||||
" fbytes (both) optional) file size in bytes\n"
|
||||
" filename (both)\n"
|
||||
" fmtime (both) optional file modification date. Unix time printed \n"
|
||||
" as string\n"
|
||||
" dbytes (both) document text bytes\n"
|
||||
" dmtime (both) document creation/modification date\n"
|
||||
" ipath (both) value private to the app.: internal access path\n"
|
||||
" inside file\n"
|
||||
" mtype (both) mime type for original document\n"
|
||||
" mtime (query) dmtime if set else fmtime\n"
|
||||
" origcharset (both) charset the text was converted from\n"
|
||||
" size (query) dbytes if set, else fbytes\n"
|
||||
" sig (both) app-defined file modification signature. \n"
|
||||
" For up to date checks\n"
|
||||
" relevancyrating (query)\n"
|
||||
" abstract (both)\n"
|
||||
" author (both)\n"
|
||||
" title (both)\n"
|
||||
" keywords (both)\n"
|
||||
);
|
||||
static PyTypeObject recoll_DocType = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"recoll.Doc", /*tp_name*/
|
||||
@ -841,8 +841,8 @@ typedef struct {
|
||||
} recoll_QueryObject;
|
||||
|
||||
PyDoc_STRVAR(doc_Query_close,
|
||||
"close(). Deallocate query. Object is unusable after the call."
|
||||
);
|
||||
"close(). Deallocate query. Object is unusable after the call."
|
||||
);
|
||||
static PyObject *
|
||||
Query_close(recoll_QueryObject *self)
|
||||
{
|
||||
@ -910,11 +910,11 @@ Query_iter(PyObject *self)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_Query_sortby,
|
||||
"sortby(field=fieldname, ascending=True)\n"
|
||||
"Sort results by 'fieldname', in ascending or descending order.\n"
|
||||
"Only one field can be used, no subsorts for now.\n"
|
||||
"Must be called before executing the search\n"
|
||||
);
|
||||
"sortby(field=fieldname, ascending=True)\n"
|
||||
"Sort results by 'fieldname', in ascending or descending order.\n"
|
||||
"Only one field can be used, no subsorts for now.\n"
|
||||
"Must be called before executing the search\n"
|
||||
);
|
||||
|
||||
static PyObject *
|
||||
Query_sortby(recoll_QueryObject* self, PyObject *args, PyObject *kwargs)
|
||||
@ -942,14 +942,14 @@ Query_sortby(recoll_QueryObject* self, PyObject *args, PyObject *kwargs)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_Query_execute,
|
||||
"execute(query_string, stemming=1|0, stemlang=\"stemming language\", "
|
||||
"execute(query_string, stemming=1|0, stemlang=\"stemming language\", "
|
||||
"fetchtext=False)\n"
|
||||
"\n"
|
||||
"Starts a search for query_string, a Recoll search language string\n"
|
||||
"(mostly Xesam-compatible).\n"
|
||||
"The query can be a simple list of terms (and'ed by default), or more\n"
|
||||
"complicated with field specs etc. See the Recoll manual.\n"
|
||||
);
|
||||
"\n"
|
||||
"Starts a search for query_string, a Recoll search language string\n"
|
||||
"(mostly Xesam-compatible).\n"
|
||||
"The query can be a simple list of terms (and'ed by default), or more\n"
|
||||
"complicated with field specs etc. See the Recoll manual.\n"
|
||||
);
|
||||
|
||||
static PyObject *
|
||||
Query_execute(recoll_QueryObject* self, PyObject *args, PyObject *kwargs)
|
||||
@ -1021,10 +1021,10 @@ Query_execute(recoll_QueryObject* self, PyObject *args, PyObject *kwargs)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_Query_executesd,
|
||||
"executesd(SearchData, fetchtext=False)\n"
|
||||
"\n"
|
||||
"Starts a search for the query defined by the SearchData object.\n"
|
||||
);
|
||||
"executesd(SearchData, fetchtext=False)\n"
|
||||
"\n"
|
||||
"Starts a search for the query defined by the SearchData object.\n"
|
||||
);
|
||||
|
||||
static PyObject *
|
||||
Query_executesd(recoll_QueryObject* self, PyObject *args, PyObject *kwargs)
|
||||
@ -1113,10 +1113,10 @@ Query_iternext(PyObject *_self)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_Query_fetchone,
|
||||
"fetchone(None) -> Doc\n"
|
||||
"\n"
|
||||
"Fetches the next Doc object in the current search results.\n"
|
||||
);
|
||||
"fetchone(None) -> Doc\n"
|
||||
"\n"
|
||||
"Fetches the next Doc object in the current search results.\n"
|
||||
);
|
||||
static PyObject *
|
||||
Query_fetchone(PyObject *_self)
|
||||
{
|
||||
@ -1169,10 +1169,10 @@ Query_fetchmany(PyObject* _self, PyObject *args, PyObject *kwargs)
|
||||
|
||||
|
||||
PyDoc_STRVAR(doc_Query_scroll,
|
||||
"scroll(value, [, mode='relative'/'absolute' ]) -> new int position\n"
|
||||
"\n"
|
||||
"Adjusts the position in the current result set.\n"
|
||||
);
|
||||
"scroll(value, [, mode='relative'/'absolute' ]) -> new int position\n"
|
||||
"\n"
|
||||
"Adjusts the position in the current result set.\n"
|
||||
);
|
||||
static PyObject *
|
||||
Query_scroll(recoll_QueryObject* self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
@ -1210,14 +1210,14 @@ Query_scroll(recoll_QueryObject* self, PyObject *args, PyObject *kwargs)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_Query_highlight,
|
||||
"highlight(text, ishtml = 0/1, methods = object))\n"
|
||||
"Will insert <span \"class=rclmatch\"></span> tags around the match areas\n"
|
||||
"in the input text and return the modified text\n"
|
||||
"ishtml can be set to indicate that the input text is html and html special\n"
|
||||
" characters should not be escaped\n"
|
||||
"methods if set should be an object with methods startMatch(i) and endMatch()\n"
|
||||
" which will be called for each match and should return a begin and end tag\n"
|
||||
);
|
||||
"highlight(text, ishtml = 0/1, methods = object))\n"
|
||||
"Will insert <span \"class=rclmatch\"></span> tags around the match areas\n"
|
||||
"in the input text and return the modified text\n"
|
||||
"ishtml can be set to indicate that the input text is html and html special\n"
|
||||
" characters should not be escaped\n"
|
||||
"methods if set should be an object with methods startMatch(i) and endMatch()\n"
|
||||
" which will be called for each match and should return a begin and end tag\n"
|
||||
);
|
||||
|
||||
class PyPlainToRich: public PlainToRich {
|
||||
public:
|
||||
@ -1314,11 +1314,11 @@ Query_highlight(recoll_QueryObject* self, PyObject *args, PyObject *kwargs)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_Query_makedocabstract,
|
||||
"makedocabstract(doc, methods = object))\n"
|
||||
"Will create a snippets abstract for doc by selecting text around the match\n"
|
||||
" terms\n"
|
||||
"If methods is set, will also perform highlighting. See the highlight method\n"
|
||||
);
|
||||
"makedocabstract(doc, methods = object))\n"
|
||||
"Will create a snippets abstract for doc by selecting text around the match\n"
|
||||
" terms\n"
|
||||
"If methods is set, will also perform highlighting. See the highlight method\n"
|
||||
);
|
||||
static PyObject *
|
||||
Query_makedocabstract(recoll_QueryObject* self, PyObject *args,PyObject *kwargs)
|
||||
{
|
||||
@ -1384,11 +1384,11 @@ Query_makedocabstract(recoll_QueryObject* self, PyObject *args,PyObject *kwargs)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_Query_getxquery,
|
||||
"getxquery(None) -> Unicode string\n"
|
||||
"\n"
|
||||
"Retrieves the Xapian query description as a Unicode string.\n"
|
||||
"Meaningful only after executexx\n"
|
||||
);
|
||||
"getxquery(None) -> Unicode string\n"
|
||||
"\n"
|
||||
"Retrieves the Xapian query description as a Unicode string.\n"
|
||||
"Meaningful only after executexx\n"
|
||||
);
|
||||
static PyObject *
|
||||
Query_getxquery(recoll_QueryObject* self, PyObject *, PyObject *)
|
||||
{
|
||||
@ -1408,14 +1408,14 @@ Query_getxquery(recoll_QueryObject* self, PyObject *, PyObject *)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_Query_getgroups,
|
||||
"getgroups(None) -> a list of pairs\n"
|
||||
"\n"
|
||||
"Retrieves the expanded query terms. Meaningful only after executexx\n"
|
||||
"In each pair, the first entry is a list of user terms, the second a list of\n"
|
||||
"query terms as derived from the user terms and used in the Xapian Query.\n"
|
||||
"The size of each list is one for simple terms, or more for group and phrase\n"
|
||||
"clauses\n"
|
||||
);
|
||||
"getgroups(None) -> a list of pairs\n"
|
||||
"\n"
|
||||
"Retrieves the expanded query terms. Meaningful only after executexx\n"
|
||||
"In each pair, the first entry is a list of user terms, the second a list of\n"
|
||||
"query terms as derived from the user terms and used in the Xapian Query.\n"
|
||||
"The size of each list is one for simple terms, or more for group and phrase\n"
|
||||
"clauses\n"
|
||||
);
|
||||
static PyObject *
|
||||
Query_getgroups(recoll_QueryObject* self, PyObject *, PyObject *)
|
||||
{
|
||||
@ -1517,8 +1517,8 @@ static PyMemberDef Query_members[] = {
|
||||
};
|
||||
|
||||
PyDoc_STRVAR(doc_QueryObject,
|
||||
"Recoll Query objects are used to execute index searches. \n"
|
||||
"They must be created by the Db.query() method.\n"
|
||||
"Recoll Query objects are used to execute index searches. \n"
|
||||
"They must be created by the Db.query() method.\n"
|
||||
);
|
||||
static PyTypeObject recoll_QueryType = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
@ -1779,11 +1779,11 @@ PyDoc_STRVAR(
|
||||
"termMatch(match_type='wildcard|regexp|stem', expr, field='', "
|
||||
"maxlen=-1, casesens=False, diacsens=False, lang='english', freqs=False)"
|
||||
" returns the expanded term list\n"
|
||||
"\n"
|
||||
"Expands the input expression according to the mode and parameters and "
|
||||
"returns the expanded term list, as raw terms if freqs is False, or "
|
||||
"(term, totcnt, docnt) tuples if freqs is True.\n"
|
||||
);
|
||||
"\n"
|
||||
"Expands the input expression according to the mode and parameters and "
|
||||
"returns the expanded term list, as raw terms if freqs is False, or "
|
||||
"(term, totcnt, docnt) tuples if freqs is True.\n"
|
||||
);
|
||||
static PyObject *
|
||||
Db_termMatch(recoll_DbObject* self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
@ -2014,15 +2014,15 @@ static PyMethodDef Db_methods[] = {
|
||||
{NULL} /* Sentinel */
|
||||
};
|
||||
PyDoc_STRVAR(doc_DbObject,
|
||||
"Db([confdir=None], [extra_dbs=None], [writable = False])\n"
|
||||
"\n"
|
||||
"A Db object holds a connection to a Recoll index. Use the connect()\n"
|
||||
"function to create one.\n"
|
||||
"confdir specifies a Recoll configuration directory (default: \n"
|
||||
" $RECOLL_CONFDIR or ~/.recoll).\n"
|
||||
"extra_dbs is a list of external databases (xapian directories)\n"
|
||||
"writable decides if we can index new data through this connection\n"
|
||||
);
|
||||
"Db([confdir=None], [extra_dbs=None], [writable = False])\n"
|
||||
"\n"
|
||||
"A Db object holds a connection to a Recoll index. Use the connect()\n"
|
||||
"function to create one.\n"
|
||||
"confdir specifies a Recoll configuration directory (default: \n"
|
||||
" $RECOLL_CONFDIR or ~/.recoll).\n"
|
||||
"extra_dbs is a list of external databases (xapian directories)\n"
|
||||
"writable decides if we can index new data through this connection\n"
|
||||
);
|
||||
static PyTypeObject recoll_DbType = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"recoll.Db", /*tp_name*/
|
||||
@ -2077,15 +2077,15 @@ recoll_connect(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(doc_connect,
|
||||
"connect([confdir=None], [extra_dbs=None], [writable = False])\n"
|
||||
" -> Db.\n"
|
||||
"\n"
|
||||
"Connects to a Recoll database and returns a Db object.\n"
|
||||
"confdir specifies a Recoll configuration directory\n"
|
||||
"(the default is built like for any Recoll program).\n"
|
||||
"extra_dbs is a list of external databases (xapian directories)\n"
|
||||
"writable decides if we can index new data through this connection\n"
|
||||
);
|
||||
"connect([confdir=None], [extra_dbs=None], [writable = False])\n"
|
||||
" -> Db.\n"
|
||||
"\n"
|
||||
"Connects to a Recoll database and returns a Db object.\n"
|
||||
"confdir specifies a Recoll configuration directory\n"
|
||||
"(the default is built like for any Recoll program).\n"
|
||||
"extra_dbs is a list of external databases (xapian directories)\n"
|
||||
"writable decides if we can index new data through this connection\n"
|
||||
);
|
||||
|
||||
static PyMethodDef recoll_methods[] = {
|
||||
{"connect", (PyCFunction)recoll_connect, METH_VARARGS|METH_KEYWORDS,
|
||||
@ -2096,7 +2096,7 @@ static PyMethodDef recoll_methods[] = {
|
||||
|
||||
|
||||
PyDoc_STRVAR(pyrecoll_doc_string,
|
||||
"This is an interface to the Recoll full text indexer.");
|
||||
"This is an interface to the Recoll full text indexer.");
|
||||
|
||||
struct module_state {
|
||||
PyObject *error;
|
||||
@ -2140,8 +2140,8 @@ PyInit_recoll(void)
|
||||
#else
|
||||
#define INITERROR return
|
||||
|
||||
PyMODINIT_FUNC
|
||||
initrecoll(void)
|
||||
PyMODINIT_FUNC
|
||||
initrecoll(void)
|
||||
#endif
|
||||
{
|
||||
// Note: we can't call recollinit here, because the confdir is only really
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user