"""
import _createrepo_c
+from _createrepo_c import *
-VERSION_MAJOR = _createrepo_c.VERSION_MAJOR
-VERSION_MINOR = _createrepo_c.VERSION_MINOR
-VERSION_PATCH = _createrepo_c.VERSION_PATCH
+VERSION_MAJOR = _createrepo_c.VERSION_MAJOR #: Major version
+VERSION_MINOR = _createrepo_c.VERSION_MINOR #: Minor version
+VERSION_PATCH = _createrepo_c.VERSION_PATCH #: Patch version
+
+#: Version string
VERSION = u"%d.%d.%d" % (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
-UNKNOWN_CHECKSUM = _createrepo_c.CHECKSUM_UNKNOWN
-CHECKSUM_UNKNOWN = _createrepo_c.CHECKSUM_UNKNOWN
-MD5 = _createrepo_c.MD5
-SHA = _createrepo_c.SHA
-SHA1 = _createrepo_c.SHA1
-SHA224 = _createrepo_c.SHA224
-SHA256 = _createrepo_c.SHA256
-SHA384 = _createrepo_c.SHA384
-SHA512 = _createrepo_c.SHA512
+UNKNOWN_CHECKSUM = _createrepo_c.CHECKSUM_UNKNOWN #: Checksum unknown
+CHECKSUM_UNKNOWN = _createrepo_c.CHECKSUM_UNKNOWN #: Checksum unknown
+MD5 = _createrepo_c.MD5 #: MD5 checksum
+SHA = _createrepo_c.SHA #: SHA1 checksum alias
+SHA1 = _createrepo_c.SHA1 #: SHA1 checksum
+SHA224 = _createrepo_c.SHA224 #: SHA224 checksum
+SHA256 = _createrepo_c.SHA256 #: SHA256 checksum
+SHA384 = _createrepo_c.SHA384 #: SHA384 checksum
+SHA512 = _createrepo_c.SHA512 #: SHA512 checksum
-MODE_READ = _createrepo_c.MODE_READ
-MODE_WRITE = _createrepo_c.MODE_WRITE
+MODE_READ = _createrepo_c.MODE_READ #: Read open mode
+MODE_WRITE = _createrepo_c.MODE_WRITE #: Write open mode
+#: Use compression autodetection
AUTO_DETECT_COMPRESSION = _createrepo_c.AUTO_DETECT_COMPRESSION
+
+#: Unknown compression
UNKNOWN_COMPRESSION = _createrepo_c.UNKNOWN_COMPRESSION
+
+#: No compression
NO_COMPRESSION = _createrepo_c.NO_COMPRESSION
+
+#: Gzip compression
GZ_COMPRESSION = _createrepo_c.GZ_COMPRESSION
+
+#: Bzip2 compression
BZ2_COMPRESSION = _createrepo_c.BZ2_COMPRESSION
+
+#: XZ compression
XZ_COMPRESSION = _createrepo_c.XZ_COMPRESSION
+
+#: Gzip compression alias
GZ = _createrepo_c.GZ_COMPRESSION
+
+#: Bzip2 compression alias
BZ2 = _createrepo_c.BZ2_COMPRESSION
+
+#: XZ compression alias
XZ = _createrepo_c.XZ_COMPRESSION
-HT_KEY_DEFAULT = _createrepo_c.HT_KEY_DEFAULT
-HT_KEY_HASH = _createrepo_c.HT_KEY_HASH
-HT_KEY_NAME = _createrepo_c.HT_KEY_NAME
-HT_KEY_FILENAME = _createrepo_c.HT_KEY_FILENAME
+HT_KEY_DEFAULT = _createrepo_c.HT_KEY_DEFAULT #: Default key (hash)
+HT_KEY_HASH = _createrepo_c.HT_KEY_HASH #: Package hash as a key
+HT_KEY_NAME = _createrepo_c.HT_KEY_NAME #: Package name as a key
+HT_KEY_FILENAME = _createrepo_c.HT_KEY_FILENAME #: Package filename as a key
-DB_PRIMARY = _createrepo_c.DB_PRIMARY
-DB_FILELISTS = _createrepo_c.DB_FILELISTS
-DB_OTHER = _createrepo_c.DB_OTHER
+DB_PRIMARY = _createrepo_c.DB_PRIMARY #: Primary database
+DB_FILELISTS = _createrepo_c.DB_FILELISTS #: Filelists database
+DB_OTHER = _createrepo_c.DB_OTHER #: Other database
-XMLFILE_PRIMARY = _createrepo_c.XMLFILE_PRIMARY
-XMLFILE_FILELISTS = _createrepo_c.XMLFILE_FILELISTS
-XMLFILE_OTHER = _createrepo_c.XMLFILE_OTHER
+XMLFILE_PRIMARY = _createrepo_c.XMLFILE_PRIMARY #: Primary xml file
+XMLFILE_FILELISTS = _createrepo_c.XMLFILE_FILELISTS #: Filelists xml file
+XMLFILE_OTHER = _createrepo_c.XMLFILE_OTHER #: Other xml file
+#: XML warning - Unknown tag
XML_WARNING_UNKNOWNTAG = _createrepo_c.XML_WARNING_UNKNOWNTAG
+
+#: XML warning - Missing attribute
XML_WARNING_MISSINGATTR = _createrepo_c.XML_WARNING_MISSINGATTR
+
+#: XML warning - Unknown value
XML_WARNING_UNKNOWNVAL = _createrepo_c.XML_WARNING_UNKNOWNVAL
+
+#: XML warning - Bad attribute value
XML_WARNING_BADATTRVAL = _createrepo_c.XML_WARNING_BADATTRVAL
# Helper contants
# Tuple indexes for provide, conflict, obsolete or require entry
-PCOR_ENTRY_NAME = 0
-PCOR_ENTRY_FLAGS = 1
-PCOR_ENTRY_EPOCH = 2
-PCOR_ENTRY_VERSION = 3
-PCOR_ENTRY_RELEASE = 4
-PCOR_ENTRY_PRE = 5
+PCOR_ENTRY_NAME = 0 #: PCOR entry tuple index - name
+PCOR_ENTRY_FLAGS = 1 #: PCOR entry tuple index - flags
+PCOR_ENTRY_EPOCH = 2 #: PCOR entry tuple index - epoch
+PCOR_ENTRY_VERSION = 3 #: PCOR entry tuple index - version
+PCOR_ENTRY_RELEASE = 4 #: PCOR entry tuple index - release
+PCOR_ENTRY_PRE = 5 #: PCOR entry tuple index - pre
+
# Tuple indexes for file entry
-FILE_ENTRY_TYPE = 0
-FILE_ENTRY_PATH = 1
-FILE_ENTRY_NAME = 2
+FILE_ENTRY_TYPE = 0 #: File entry tuple index - file type
+FILE_ENTRY_PATH = 1 #: File entry tuple index - path
+FILE_ENTRY_NAME = 2 #: File entry tuple index - file name
# Tuple indexes for changelog entry
-CHANGELOG_ENTRY_AUTHOR = 0
-CHANGELOG_ENTRY_DATE = 1
-CHANGELOG_ENTRY_CHANGELOG = 2
+CHANGELOG_ENTRY_AUTHOR = 0 #: Changelog entry tuple index - Author
+CHANGELOG_ENTRY_DATE = 1 #: Changelog entry tuple index - Date
+CHANGELOG_ENTRY_CHANGELOG = 2 #: Changelog entry tuple index - Changelog
# Exception
class CrFile(_createrepo_c.CrFile):
def __init__(self, filename, mode=MODE_READ,
comtype=NO_COMPRESSION, stat=None):
+ """:arg filename: Filename
+ :arg mode: MODE_READ or MODE_WRITE
+ :arg comtype: Compression type (GZ, BZ, XZ or NO_COMPRESSION)
+ :arg stat: ContentStat object or None"""
_createrepo_c.CrFile.__init__(self, filename, mode, comtype, stat)
# Metadata class
Sqlite = _createrepo_c.Sqlite
class PrimarySqlite(Sqlite):
- def __init__(self, filename):
- Sqlite.__init__(self, filename, DB_PRIMARY)
+ def __init__(self, path):
+ """:arg path: path to the primary.sqlite database"""
+ Sqlite.__init__(self, path, DB_PRIMARY)
class FilelistsSqlite(Sqlite):
- def __init__(self, filename):
- Sqlite.__init__(self, filename, DB_FILELISTS)
+ def __init__(self, path):
+ """:arg path: Path to the filelists.sqlite database"""
+ Sqlite.__init__(self, path, DB_FILELISTS)
class OtherSqlite(Sqlite):
- def __init__(self, filename):
- Sqlite.__init__(self, filename, DB_OTHER)
+ def __init__(self, path):
+ """:arg path: Path to the other.sqlite database"""
+ Sqlite.__init__(self, path, DB_OTHER)
# XmlFile class
def package_from_rpm(filename, checksum_type=SHA256, location_href=None,
location_base=None, changelog_limit=10):
+ """:class:`.Package` object from the rpm package"""
return _createrepo_c.package_from_rpm(filename, checksum_type,
location_href, location_base, changelog_limit)
def xml_from_rpm(filename, checksum_type=SHA256, location_href=None,
location_base=None, changelog_limit=10):
+ """XML for the rpm package"""
return _createrepo_c.xml_from_rpm(filename, checksum_type,
location_href, location_base, changelog_limit)
def xml_parse_primary(path, newpkgcb=None, pkgcb=None,
warningcb=None, do_files=1):
+ """Parse primary.xml"""
return _createrepo_c.xml_parse_primary(path, newpkgcb, pkgcb,
warningcb, do_files)
def xml_parse_filelists(path, newpkgcb=None, pkgcb=None, warningcb=None):
+ """Parse filelists.xml"""
return _createrepo_c.xml_parse_filelists(path, newpkgcb, pkgcb, warningcb)
def xml_parse_other(path, newpkgcb=None, pkgcb=None, warningcb=None):
+ """Parse other.xml"""
return _createrepo_c.xml_parse_other(path, newpkgcb, pkgcb, warningcb)
def xml_parse_repomd(path, repomdobj, warningcb=None):
+ """Parse repomd.xml"""
return _createrepo_c.xml_parse_repomd(path, repomdobj, warningcb)
checksum_name_str = _createrepo_c.checksum_name_str
checksum_type = _createrepo_c.checksum_type
def compress_file(src, dst, comtype, stat=None):
- return _createrepo_c.compress_file(src, dst, comtype, stat)
+ return _createrepo_c.compress_file_with_stat(src, dst, comtype, stat)
compression_suffix = _createrepo_c.compression_suffix
detect_compression = _createrepo_c.detect_compression
#include "src/createrepo_c.h"
+PyDoc_STRVAR(checksum_name_str__doc__,
+"checksum_name_str(checksum_type) -> str\n\n"
+"Checksum name from checksum type constant");
+
PyObject *py_checksum_name_str(PyObject *self, PyObject *args);
+
+PyDoc_STRVAR(checksum_type__doc__,
+"checksum_type(checksum_name) -> long\n\n"
+"Checksum type from checksum name");
+
PyObject *py_checksum_type(PyObject *self, PyObject *args);
#endif
/* CrFile methods */
+PyDoc_STRVAR(write__doc__,
+"write() -> None\n\n"
+"Write a data to the file");
+
static PyObject *
py_write(_CrFileObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
+PyDoc_STRVAR(close__doc__,
+"close() -> None\n\n"
+"Close the file");
+
static PyObject *
py_close(_CrFileObject *self, void *nothing)
{
}
static struct PyMethodDef crfile_methods[] = {
- {"write", (PyCFunction)py_write, METH_VARARGS, NULL},
- {"close", (PyCFunction)py_close, METH_NOARGS, NULL},
+ {"write", (PyCFunction)py_write, METH_VARARGS, write__doc__},
+ {"close", (PyCFunction)py_close, METH_NOARGS, close__doc__},
{NULL} /* sentinel */
};
#define CrFileObject_Check(o) PyObject_TypeCheck(o, &CrFile_Type)
+PyDoc_STRVAR(compression_suffix__doc__,
+"compression_suffix(compression_type) -> str or None\n\n"
+"Compression suffix for the compression type");
+
PyObject *py_compression_suffix(PyObject *self, PyObject *args);
+
+PyDoc_STRVAR(detect_compression__doc__,
+"detect_compression(path) -> long\n\n"
+"Detect compression type used on the file");
+
PyObject *py_detect_compression(PyObject *self, PyObject *args);
#endif
}
static PyGetSetDef contentstat_getsetters[] = {
- {"size", (getter)get_num, (setter)set_num, NULL, OFFSET(size)},
- {"checksum_type", (getter)get_int, (setter)set_int, NULL, OFFSET(checksum_type)},
- {"checksum", (getter)get_str, (setter)set_str, NULL, OFFSET(checksum)},
+ {"size", (getter)get_num, (setter)set_num,
+ "Number of uncompressed bytes written", OFFSET(size)},
+ {"checksum_type", (getter)get_int, (setter)set_int,
+ "Type of used checksum", OFFSET(checksum_type)},
+ {"checksum", (getter)get_str, (setter)set_str,
+ "Calculated checksum", OFFSET(checksum)},
{NULL, NULL, NULL, NULL, NULL} /* sentinel */
};
static struct PyMethodDef createrepo_c_methods[] = {
{"package_from_rpm", (PyCFunction)py_package_from_rpm,
- METH_VARARGS | METH_KEYWORDS, NULL},
+ METH_VARARGS | METH_KEYWORDS, package_from_rpm__doc__},
{"xml_from_rpm", (PyCFunction)py_xml_from_rpm,
- METH_VARARGS | METH_KEYWORDS, NULL},
+ METH_VARARGS | METH_KEYWORDS, package_from_rpm__doc__},
{"xml_dump_primary", (PyCFunction)py_xml_dump_primary,
- METH_VARARGS, NULL},
+ METH_VARARGS, xml_dump_primary__doc__},
{"xml_dump_filelists", (PyCFunction)py_xml_dump_filelists,
- METH_VARARGS, NULL},
+ METH_VARARGS, xml_dump_filelists__doc__},
{"xml_dump_other", (PyCFunction)py_xml_dump_other,
- METH_VARARGS, NULL},
+ METH_VARARGS, xml_dump_other__doc__},
{"xml_dump", (PyCFunction)py_xml_dump,
- METH_VARARGS, NULL},
+ METH_VARARGS, xml_dump__doc__},
{"xml_parse_primary", (PyCFunction)py_xml_parse_primary,
- METH_VARARGS, NULL},
+ METH_VARARGS, xml_parse_primary__doc__},
{"xml_parse_filelists", (PyCFunction)py_xml_parse_filelists,
- METH_VARARGS, NULL},
+ METH_VARARGS, xml_parse_filelists__doc__},
{"xml_parse_other", (PyCFunction)py_xml_parse_other,
- METH_VARARGS, NULL},
+ METH_VARARGS, xml_parse_other__doc__},
{"xml_parse_repomd", (PyCFunction)py_xml_parse_repomd,
- METH_VARARGS, NULL},
+ METH_VARARGS, xml_parse_repomd__doc__},
{"checksum_name_str", (PyCFunction)py_checksum_name_str,
- METH_VARARGS, NULL},
+ METH_VARARGS, checksum_name_str__doc__},
{"checksum_type", (PyCFunction)py_checksum_type,
- METH_VARARGS, NULL},
- {"compress_file", (PyCFunction)py_compress_file_with_stat,
- METH_VARARGS, NULL},
+ METH_VARARGS, checksum_type__doc__},
+ {"compress_file_with_stat", (PyCFunction)py_compress_file_with_stat,
+ METH_VARARGS, compress_file_with_stat__doc__},
{"compression_suffix", (PyCFunction)py_compression_suffix,
- METH_VARARGS, NULL},
+ METH_VARARGS, compression_suffix__doc__},
{"detect_compression", (PyCFunction)py_detect_compression,
- METH_VARARGS, NULL},
+ METH_VARARGS, detect_compression__doc__},
{ NULL }
};
int
init_exceptions()
{
- CrErr_Exception = PyErr_NewException("createrepo_c.CreaterepoCError", NULL, NULL);
+ CrErr_Exception = PyErr_NewExceptionWithDoc("createrepo_c.CreaterepoCError",
+ "Createrepo_c library exception", NULL, NULL);
if (!CrErr_Exception)
return 0;
Py_INCREF(CrErr_Exception);
return (PyObject *)self;
}
+PyDoc_STRVAR(metadata_init__doc__,
+".. method:: __init__(key=HT_KEY_DEFAULT, use_single_chunk=False, pkglist=[])\n\n"
+" :arg key: Which value shoud be used as a key. One of HT_KEY_* constants.\n"
+" :arg use_single_chunk: Specify if all package strings should be stored\n"
+" in metadata object instead of package iself. This save some\n"
+" space if you need to have a all packages loaded into a memory.\n"
+" :arg pkglist: Package list that specify which packages shloud be\n"
+" loaded. Use its base filename (e.g.\n"
+" \"GConf2-3.2.6-6.fc19.i686.rpm\").\n");
+
static int
metadata_init(_MetadataObject *self, PyObject *args, PyObject *kwds)
{
}
static PyGetSetDef metadata_getsetters[] = {
- {"key", (getter)get_key, NULL, NULL, NULL},
+ {"key", (getter)get_key, NULL, "Type of used key", NULL},
{NULL, NULL, NULL, NULL, NULL} /* sentinel */
};
/* Metadata methods */
+PyDoc_STRVAR(load_xml__doc__,
+"load_xml(metadata_location_object) -> None\n\n"
+"Load XML specified by MetadataLocation Object");
+
static PyObject *
load_xml(_MetadataObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
+PyDoc_STRVAR(locate_and_load_xml__doc__,
+"locate_and_load_xml(path) -> None"
+"Load XML specified by path");
+
static PyObject *
locate_and_load_xml(_MetadataObject *self, PyObject *args)
{
/* Hashtable methods */
+PyDoc_STRVAR(len__doc__,
+"len() -> long\n\n"
+"Number of packages");
+
static PyObject *
ht_len(_MetadataObject *self, PyObject *noarg)
{
}
*/
+PyDoc_STRVAR(has_key__doc__,
+"has_key(key) -> bool\n\n"
+"Test if metadata contains the key");
+
static PyObject *
ht_has_key(_MetadataObject *self, PyObject *args)
{
Py_RETURN_FALSE;
}
+PyDoc_STRVAR(keys__doc__,
+"keys() -> list\n\n"
+"List of all keys");
+
static PyObject *
ht_keys(_MetadataObject *self, PyObject *args)
{
return list;
}
+PyDoc_STRVAR(remove__doc__,
+"remove(key) -> bool\n\n"
+"Remove package which has a key key from the metadata");
+
static PyObject *
ht_remove(_MetadataObject *self, PyObject *args)
{
Py_RETURN_FALSE;
}
+PyDoc_STRVAR(get__doc__,
+"get(key) -> Package\n\n"
+"Get Package which has a key key");
+
static PyObject *
ht_get(_MetadataObject *self, PyObject *args)
{
}
static struct PyMethodDef metadata_methods[] = {
- {"load_xml", (PyCFunction)load_xml, METH_VARARGS, NULL},
- {"locate_and_load_xml", (PyCFunction)locate_and_load_xml, METH_VARARGS, NULL},
- {"len", (PyCFunction)ht_len, METH_NOARGS, NULL},
+ {"load_xml", (PyCFunction)load_xml, METH_VARARGS,
+ load_xml__doc__},
+ {"locate_and_load_xml", (PyCFunction)locate_and_load_xml, METH_VARARGS,
+ locate_and_load_xml__doc__},
+ {"len", (PyCFunction)ht_len, METH_NOARGS, len__doc__},
// {"add", (PyCFunction)ht_add, METH_VARARGS, NULL},
- {"has_key", (PyCFunction)ht_has_key, METH_VARARGS, NULL},
- {"keys", (PyCFunction)ht_keys, METH_NOARGS, NULL},
- {"remove", (PyCFunction)ht_remove, METH_VARARGS, NULL},
- {"get", (PyCFunction)ht_get, METH_VARARGS, NULL},
+ {"has_key", (PyCFunction)ht_has_key, METH_VARARGS, has_key__doc__},
+ {"keys", (PyCFunction)ht_keys, METH_NOARGS, keys__doc__},
+ {"remove", (PyCFunction)ht_remove, METH_VARARGS, remove__doc__},
+ {"get", (PyCFunction)ht_get, METH_VARARGS, get__doc__},
{NULL} /* sentinel */
};
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
- "Metadata object", /* tp_doc */
+ metadata_init__doc__, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
return (PyObject *)self;
}
+PyDoc_STRVAR(metadatalocation_init__doc__,
+"Class representing location of metadata\n\n"
+".. method:: __init__(path, ignore_db)\n\n"
+" :arg path: String with url/path to the repository\n"
+" :arg ignore_db: Boolean. If False then in case of remote repository\n"
+" databases will not be downloaded)\n");
+
static int
metadatalocation_init(_MetadataLocationObject *self, PyObject *args, PyObject *kwds)
{
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
- "MetadataLocation object", /* tp_doc */
+ metadatalocation_init__doc__, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
return list;
}
+PyDoc_STRVAR(del_doc,
+"del(key) -> bool\n\n"
+"Delete a package specified by key from the hashtable.");
+
static PyObject *
del(_MetadataHashtableObject *self, PyObject *args)
{
// {"add", (PyCFunction)add, METH_VARARGS, NULL},
{"has_key", (PyCFunction)has_key, METH_VARARGS, NULL},
{"keys", (PyCFunction)keys, METH_NOARGS, NULL},
- {"del", (PyCFunction)del, METH_VARARGS, NULL},
+ {"del", (PyCFunction)del, METH_VARARGS, del_doc},
{NULL} /* sentinel */
};
#include "src/createrepo_c.h"
+PyDoc_STRVAR(compress_file_with_stat__doc__,
+"compress_file_with_stat(source, destination, compression_type, "
+"contentstat_object) -> None\n\n"
+"Compress file. destination and contentstat_object could be None");
+
PyObject *py_compress_file_with_stat(PyObject *self, PyObject *args);
#endif
return (PyObject *)self;
}
+PyDoc_STRVAR(package_init__doc__,
+"Package object\n\n"
+".. method:: __init__()\n\n"
+" Default constructor\n");
+
static int
package_init(_PackageObject *self, PyObject *args, PyObject *kwds)
{
/* Package methods */
+PyDoc_STRVAR(nvra__doc__,
+"nvra() -> str\n\n"
+"Package NVRA string (Name-Version-Release-Architecture)");
+
static PyObject *
nvra(_PackageObject *self, void *nothing)
{
return pystr;
}
+PyDoc_STRVAR(nevra__doc__,
+"nevra() -> str\n\n"
+"Package NEVRA string (Name-Epoch-Version-Release-Architecture)");
+
static PyObject *
nevra(_PackageObject *self, void *nothing)
{
return pystr;
}
+PyDoc_STRVAR(copy__doc__,
+"copy() -> Package\n\n"
+"Copy of the package object");
+
static PyObject *
copy_pkg(_PackageObject *self, void *nothing)
{
}
static struct PyMethodDef package_methods[] = {
- {"nvra", (PyCFunction)nvra, METH_NOARGS, NULL},
- {"nevra", (PyCFunction)nevra, METH_NOARGS, NULL},
- {"copy", (PyCFunction)copy_pkg, METH_NOARGS, NULL},
+ {"nvra", (PyCFunction)nvra, METH_NOARGS, nvra__doc__},
+ {"nevra", (PyCFunction)nevra, METH_NOARGS, nevra__doc__},
+ {"copy", (PyCFunction)copy_pkg, METH_NOARGS, copy__doc__},
{NULL} /* sentinel */
};
}
static PyGetSetDef package_getsetters[] = {
- {"pkgId", (getter)get_str, (setter)set_str, NULL, OFFSET(pkgId)},
- {"name", (getter)get_str, (setter)set_str, NULL, OFFSET(name)},
- {"arch", (getter)get_str, (setter)set_str, NULL, OFFSET(arch)},
- {"version", (getter)get_str, (setter)set_str, NULL, OFFSET(version)},
- {"epoch", (getter)get_str, (setter)set_str, NULL, OFFSET(epoch)},
- {"release", (getter)get_str, (setter)set_str, NULL, OFFSET(release)},
- {"summary", (getter)get_str, (setter)set_str, NULL, OFFSET(summary)},
- {"description", (getter)get_str, (setter)set_str, NULL, OFFSET(description)},
- {"url", (getter)get_str, (setter)set_str, NULL, OFFSET(url)},
- {"time_file", (getter)get_num, (setter)set_num, NULL, OFFSET(time_file)},
- {"time_build", (getter)get_num, (setter)set_num, NULL, OFFSET(time_build)},
- {"rpm_license", (getter)get_str, (setter)set_str, NULL, OFFSET(rpm_license)},
- {"rpm_vendor", (getter)get_str, (setter)set_str, NULL, OFFSET(rpm_vendor)},
- {"rpm_group", (getter)get_str, (setter)set_str, NULL, OFFSET(rpm_group)},
- {"rpm_buildhost", (getter)get_str, (setter)set_str, NULL, OFFSET(rpm_buildhost)},
- {"rpm_sourcerpm", (getter)get_str, (setter)set_str, NULL, OFFSET(rpm_sourcerpm)},
- {"rpm_header_start", (getter)get_num, (setter)set_num, NULL, OFFSET(rpm_header_start)},
- {"rpm_header_end", (getter)get_num, (setter)set_num, NULL, OFFSET(rpm_header_end)},
- {"rpm_packager", (getter)get_str, (setter)set_str, NULL, OFFSET(rpm_packager)},
- {"size_package", (getter)get_num, (setter)set_num, NULL, OFFSET(size_package)},
- {"size_installed", (getter)get_num, (setter)set_num, NULL, OFFSET(size_installed)},
- {"size_archive", (getter)get_num, (setter)set_num, NULL, OFFSET(size_archive)},
- {"location_href", (getter)get_str, (setter)set_str, NULL, OFFSET(location_href)},
- {"location_base", (getter)get_str, (setter)set_str, NULL, OFFSET(location_base)},
- {"checksum_type", (getter)get_str, (setter)set_str, NULL, OFFSET(checksum_type)},
- {"requires", (getter)get_list, (setter)set_list, NULL, &(list_convertors[0])},
- {"provides", (getter)get_list, (setter)set_list, NULL, &(list_convertors[1])},
- {"conflicts", (getter)get_list, (setter)set_list, NULL, &(list_convertors[2])},
- {"obsoletes", (getter)get_list, (setter)set_list, NULL, &(list_convertors[3])},
- {"files", (getter)get_list, (setter)set_list, NULL, &(list_convertors[4])},
- {"changelogs", (getter)get_list, (setter)set_list, NULL, &(list_convertors[5])},
+ {"pkgId", (getter)get_str, (setter)set_str,
+ "Checksum of the package file", OFFSET(pkgId)},
+ {"name", (getter)get_str, (setter)set_str,
+ "Name of the package", OFFSET(name)},
+ {"arch", (getter)get_str, (setter)set_str,
+ "Architecture for which the package was built", OFFSET(arch)},
+ {"version", (getter)get_str, (setter)set_str,
+ "Version of the packaged software", OFFSET(version)},
+ {"epoch", (getter)get_str, (setter)set_str,
+ "Epoch", OFFSET(epoch)},
+ {"release", (getter)get_str, (setter)set_str,
+ "Release number of the package", OFFSET(release)},
+ {"summary", (getter)get_str, (setter)set_str,
+ "Short description of the packaged software", OFFSET(summary)},
+ {"description", (getter)get_str, (setter)set_str,
+ "In-depth description of the packaged software",
+ OFFSET(description)},
+ {"url", (getter)get_str, (setter)set_str,
+ "URL with more information about packaged software", OFFSET(url)},
+ {"time_file", (getter)get_num, (setter)set_num,
+ "mtime of the package file", OFFSET(time_file)},
+ {"time_build", (getter)get_num, (setter)set_num,
+ "Time when package was builded", OFFSET(time_build)},
+ {"rpm_license", (getter)get_str, (setter)set_str,
+ "License term applicable to the package software (GPLv2, etc.)",
+ OFFSET(rpm_license)},
+ {"rpm_vendor", (getter)get_str, (setter)set_str,
+ "Name of the organization producing the package",
+ OFFSET(rpm_vendor)},
+ {"rpm_group", (getter)get_str, (setter)set_str,
+ "RPM group (See: http://fedoraproject.org/wiki/RPMGroups)",
+ OFFSET(rpm_group)},
+ {"rpm_buildhost", (getter)get_str, (setter)set_str,
+ "Hostname of the system that built the package",
+ OFFSET(rpm_buildhost)},
+ {"rpm_sourcerpm", (getter)get_str, (setter)set_str,
+ "Name of the source package from which this binary package was built",
+ OFFSET(rpm_sourcerpm)},
+ {"rpm_header_start", (getter)get_num, (setter)set_num,
+ "First byte of the header", OFFSET(rpm_header_start)},
+ {"rpm_header_end", (getter)get_num, (setter)set_num,
+ "Last byte of the header", OFFSET(rpm_header_end)},
+ {"rpm_packager", (getter)get_str, (setter)set_str,
+ "Person or persons responsible for creating the package",
+ OFFSET(rpm_packager)},
+ {"size_package", (getter)get_num, (setter)set_num,
+ "Size, in bytes, of the package", OFFSET(size_package)},
+ {"size_installed", (getter)get_num, (setter)set_num,
+ "Total size, in bytes, of every file installed by this package",
+ OFFSET(size_installed)},
+ {"size_archive", (getter)get_num, (setter)set_num,
+ "Size, in bytes, of the archive portion of the original package file",
+ OFFSET(size_archive)},
+ {"location_href", (getter)get_str, (setter)set_str,
+ "Relative location of package to the repodata", OFFSET(location_href)},
+ {"location_base", (getter)get_str, (setter)set_str,
+ "Base location of this package", OFFSET(location_base)},
+ {"checksum_type", (getter)get_str, (setter)set_str,
+ "Type of checksum", OFFSET(checksum_type)},
+ {"requires", (getter)get_list, (setter)set_list,
+ "Capabilities the package requires", &(list_convertors[0])},
+ {"provides", (getter)get_list, (setter)set_list,
+ "Capabilities the package provides", &(list_convertors[1])},
+ {"conflicts", (getter)get_list, (setter)set_list,
+ "Capability the package conflicts with", &(list_convertors[2])},
+ {"obsoletes", (getter)get_list, (setter)set_list,
+ "Capability the package obsoletes", &(list_convertors[3])},
+ {"files", (getter)get_list, (setter)set_list,
+ "Files that package contains", &(list_convertors[4])},
+ {"changelogs", (getter)get_list, (setter)set_list,
+ "Changelogs that package contains", &(list_convertors[5])},
{NULL, NULL, NULL, NULL, NULL} /* sentinel */
};
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
- "Package object", /* tp_doc */
+ package_init__doc__, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
#include "src/createrepo_c.h"
+PyDoc_STRVAR(package_from_rpm__doc__,
+"package_from_rpm(filename, checksum_type, location_href, "
+"location_base, changelog_limit) -> Package\n\n"
+"Package object from the rpm package");
+
PyObject *py_package_from_rpm(PyObject *self, PyObject *args);
+
+PyDoc_STRVAR(xml_from_rpm__doc__,
+"xml_from_rpm(filename, checksum_type, location_href, "
+"location_base, changelog_limit) -> (str, str, str)\n\n"
+"XML for the package rpm package");
+
PyObject *py_xml_from_rpm(PyObject *self, PyObject *args);
#endif
return (PyObject *)self;
}
+PyDoc_STRVAR(repomd_init__doc__,
+"Repomd object");
+
static int
repomd_init(_RepomdObject *self, PyObject *args, PyObject *kwds)
{
/* Repomd methods */
+PyDoc_STRVAR(set_record__doc__,
+"set_record(repomdrecord) -> None\n\n"
+"Add RepomdRecord");
+
static PyObject *
set_record(_RepomdObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
+PyDoc_STRVAR(set_revision__doc__,
+"set_revision(revision) -> None\n\n"
+"Set revision string");
+
static PyObject *
set_revision(_RepomdObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
+PyDoc_STRVAR(set_repoid__doc__,
+"set_repoid(repoid, repoid_type) -> None\n\n"
+"Set repoid value and repoid_type");
+
static PyObject *
set_repoid(_RepomdObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
- static PyObject *
+PyDoc_STRVAR(add_distro_tag__doc__,
+"add_distro_tag(tag[, cpeid=None]) -> None\n\n"
+"Add distro tag");
+
+static PyObject *
add_distro_tag(_RepomdObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "tag", "cpeid", NULL };
Py_RETURN_NONE;
}
+PyDoc_STRVAR(add_repo_tag__doc__,
+"add_repo_tag(tag) -> None\n\n"
+"Add repo tag");
+
static PyObject *
add_repo_tag(_RepomdObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
+PyDoc_STRVAR(add_content_tag__doc__,
+"add_content_tag(tag) -> None\n\n"
+"Add content tag");
+
static PyObject *
add_content_tag(_RepomdObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
+PyDoc_STRVAR(xml_dump__doc__,
+"xml_dump() -> str\n\n"
+"Generate xml representation of the repomd");
+
static PyObject *
xml_dump(_RepomdObject *self, void *nothing)
{
}
static struct PyMethodDef repomd_methods[] = {
- {"set_record", (PyCFunction)set_record, METH_VARARGS, NULL},
- {"set_revision", (PyCFunction)set_revision, METH_VARARGS, NULL},
- {"set_repoid", (PyCFunction)set_repoid, METH_VARARGS, NULL},
- {"add_distro_tag", (PyCFunction)add_distro_tag, METH_VARARGS|METH_KEYWORDS, NULL},
- {"add_repo_tag", (PyCFunction)add_repo_tag, METH_VARARGS, NULL},
- {"add_content_tag", (PyCFunction)add_content_tag, METH_VARARGS, NULL},
- {"xml_dump", (PyCFunction)xml_dump, METH_NOARGS, NULL},
+ {"set_record", (PyCFunction)set_record, METH_VARARGS,
+ set_record__doc__},
+ {"set_revision", (PyCFunction)set_revision, METH_VARARGS,
+ set_revision__doc__},
+ {"set_repoid", (PyCFunction)set_repoid, METH_VARARGS,
+ set_repoid__doc__},
+ {"add_distro_tag", (PyCFunction)add_distro_tag, METH_VARARGS|METH_KEYWORDS,
+ add_distro_tag__doc__},
+ {"add_repo_tag", (PyCFunction)add_repo_tag, METH_VARARGS,
+ add_repo_tag__doc__},
+ {"add_content_tag", (PyCFunction)add_content_tag, METH_VARARGS,
+ add_content_tag__doc__},
+ {"xml_dump", (PyCFunction)xml_dump, METH_NOARGS,
+ xml_dump__doc__},
{NULL} /* sentinel */
};
#define OFFSET(member) (void *) offsetof(cr_Repomd, member)
static PyGetSetDef repomd_getsetters[] = {
- {"revision", (getter)get_str, (setter)set_str, NULL, OFFSET(revision)},
- {"repoid", (getter)get_str, (setter)set_str, NULL, OFFSET(repoid)},
- {"repoid_type", (getter)get_str, (setter)set_str, NULL, OFFSET(repoid_type)},
- {"repo_tags", (getter)get_list, (setter)set_list, NULL, &(list_convertors[0])},
- {"distro_tags", (getter)get_list, (setter)set_list, NULL, &(list_convertors[1])},
- {"content_tags", (getter)get_list, (setter)set_list, NULL, &(list_convertors[2])},
- {"records", (getter)get_list, (setter)NULL, NULL, &(list_convertors[3])},
+ {"revision", (getter)get_str, (setter)set_str,
+ "Revision value", OFFSET(revision)},
+ {"repoid", (getter)get_str, (setter)set_str,
+ "Repoid value", OFFSET(repoid)},
+ {"repoid_type", (getter)get_str, (setter)set_str,
+ "Repoid type value", OFFSET(repoid_type)},
+ {"repo_tags", (getter)get_list, (setter)set_list,
+ "List of repo tags", &(list_convertors[0])},
+ {"distro_tags", (getter)get_list, (setter)set_list,
+ "List of distro tags", &(list_convertors[1])},
+ {"content_tags", (getter)get_list, (setter)set_list,
+ "List of content tags", &(list_convertors[2])},
+ {"records", (getter)get_list, (setter)NULL,
+ "List of RepomdRecords", &(list_convertors[3])},
{NULL, NULL, NULL, NULL, NULL} /* sentinel */
};
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
- "Repomd object", /* tp_doc */
+ repomd_init__doc__, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
return (PyObject *)self;
}
+PyDoc_STRVAR(repomdrecord_init__doc__,
+".. method:: __init__([type[, path]])\n\n"
+" :arg type: String with type of the file (e.g. primary, primary_db, etc.)\n"
+" :arg path: Path to the file\n");
+
static int
repomdrecord_init(_RepomdRecordObject *self, PyObject *args, PyObject *kwds)
{
/* RepomdRecord methods */
+PyDoc_STRVAR(copy__doc__,
+"copy() -> RepomdRecord\n\n"
+"Return copy of the RepomdRecord object");
+
static PyObject *
copy_repomdrecord(_RepomdRecordObject *self, void *nothing)
{
return Object_FromRepomdRecord(cr_repomd_record_copy(self->record));
}
+PyDoc_STRVAR(fill__doc__,
+"fill() -> None\n\n"
+"Fill unfilled items in the RepomdRecord (sizes and checksums)");
+
static PyObject *
fill(_RepomdRecordObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
+PyDoc_STRVAR(compress_and_fill__doc__,
+"compress_and_fill(empty_repomdrecord[, checksum_type, compression_type]) "
+"-> None\n\n"
+"Almost analogous to fill() but suitable for groupfile. "
+"Record must be set with the path to existing non compressed groupfile. "
+"Compressed file will be created and compressed_record updated.");
+
static PyObject *
compress_and_fill(_RepomdRecordObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
+PyDoc_STRVAR(rename_file__doc__,
+"rename_file() -> None\n\n"
+"Add (prepend) file checksum to the filename");
+
static PyObject *
rename_file(_RepomdRecordObject *self, void *nothing)
{
Py_RETURN_NONE;
}
+PyDoc_STRVAR(load_contentstat__doc__,
+"load_contentstat(contentstat) -> None\n\n"
+"Load some content statistics from the ContentStat object. "
+"The statistics loaded from ContentStat doesn't have to be "
+"calculated during a fill() method call and thus speed up the method.");
+
static PyObject *
load_contentstat(_RepomdRecordObject *self, PyObject *args)
{
}
static struct PyMethodDef repomdrecord_methods[] = {
- {"copy", (PyCFunction)copy_repomdrecord, METH_NOARGS, NULL},
- {"fill", (PyCFunction)fill, METH_VARARGS, NULL},
- {"compress_and_fill", (PyCFunction)compress_and_fill, METH_VARARGS, NULL},
- {"rename_file", (PyCFunction)rename_file, METH_NOARGS, NULL},
- {"load_contentstat", (PyCFunction)load_contentstat, METH_VARARGS, NULL},
+ {"copy", (PyCFunction)copy_repomdrecord, METH_NOARGS,
+ copy__doc__},
+ {"fill", (PyCFunction)fill, METH_VARARGS,
+ fill__doc__},
+ {"compress_and_fill", (PyCFunction)compress_and_fill, METH_VARARGS,
+ compress_and_fill__doc__},
+ {"rename_file", (PyCFunction)rename_file, METH_NOARGS,
+ rename_file__doc__},
+ {"load_contentstat", (PyCFunction)load_contentstat, METH_VARARGS,
+ load_contentstat__doc__},
{NULL} /* sentinel */
};
}
static PyGetSetDef repomdrecord_getsetters[] = {
- {"type", (getter)get_str, (setter)set_str, NULL, OFFSET(type)},
- {"location_real", (getter)get_str, (setter)set_str, NULL, OFFSET(location_real)},
- {"location_href", (getter)get_str, (setter)set_str, NULL, OFFSET(location_href)},
- {"location_base", (getter)get_str, (setter)set_str, NULL, OFFSET(location_base)},
- {"checksum", (getter)get_str, (setter)set_str, NULL, OFFSET(checksum)},
- {"checksum_type", (getter)get_str, (setter)set_str, NULL, OFFSET(checksum_type)},
- {"checksum_open", (getter)get_str, (setter)set_str, NULL, OFFSET(checksum_open)},
- {"checksum_open_type", (getter)get_str, (setter)set_str, NULL, OFFSET(checksum_open_type)},
- {"timestamp", (getter)get_num, (setter)set_num, NULL, OFFSET(timestamp)},
- {"size", (getter)get_num, (setter)set_num, NULL, OFFSET(size)},
- {"size_open", (getter)get_num, (setter)set_num, NULL, OFFSET(size_open)},
- {"db_ver", (getter)get_int, (setter)set_int, NULL, OFFSET(db_ver)},
+ {"type", (getter)get_str, (setter)set_str,
+ "Record type", OFFSET(type)},
+ {"location_real", (getter)get_str, (setter)set_str,
+ "Currentlocation of the file in the system", OFFSET(location_real)},
+ {"location_href", (getter)get_str, (setter)set_str,
+ "Relative location of the file in a repository", OFFSET(location_href)},
+ {"location_base", (getter)get_str, (setter)set_str,
+ "Base location of the file", OFFSET(location_base)},
+ {"checksum", (getter)get_str, (setter)set_str,
+ "Checksum of the file", OFFSET(checksum)},
+ {"checksum_type", (getter)get_str, (setter)set_str,
+ "Type of the file checksum", OFFSET(checksum_type)},
+ {"checksum_open", (getter)get_str, (setter)set_str,
+ "Checksum of the archive content", OFFSET(checksum_open)},
+ {"checksum_open_type", (getter)get_str, (setter)set_str,
+ "Type of the archive content checksum", OFFSET(checksum_open_type)},
+ {"timestamp", (getter)get_num, (setter)set_num,
+ "Mtime of the file", OFFSET(timestamp)},
+ {"size", (getter)get_num, (setter)set_num,
+ "Size of the file", OFFSET(size)},
+ {"size_open", (getter)get_num, (setter)set_num,
+ "Size of the archive content", OFFSET(size_open)},
+ {"db_ver", (getter)get_int, (setter)set_int,
+ "Database version (used only for sqlite databases like "
+ "primary.sqlite etc.)", OFFSET(db_ver)},
{NULL, NULL, NULL, NULL, NULL} /* sentinel */
};
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
- "RepomdRecord object", /* tp_doc */
+ repomdrecord_init__doc__, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
return (PyObject *)self;
}
+PyDoc_STRVAR(sqlite_init__doc__,
+"Sqlite object\n\n"
+".. method:: __init__(path, db_type)\n\n"
+" :arg path: Path to the database\n"
+" :arg db_type: One from DB_PRIMARY, DB_FILELISTS, DB_OTHER constans\n");
+
static int
sqlite_init(_SqliteObject *self, PyObject *args, PyObject *kwds)
{
/* Sqlite methods */
+PyDoc_STRVAR(add_pkg__doc__,
+"add_pkg(Package) -> None\n\n"
+"Add Package to the database");
+
static PyObject *
add_pkg(_SqliteObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
+PyDoc_STRVAR(dbinfo_update__doc__,
+"dbinfo_update(checksum) -> None\n\n"
+"Set checksum of the xml file representing same data");
+
static PyObject *
dbinfo_update(_SqliteObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
+PyDoc_STRVAR(close__doc__,
+"close() -> None\n\n"
+"Close the sqlite database");
+
static PyObject *
close_db(_SqliteObject *self, void *nothing)
{
}
static struct PyMethodDef sqlite_methods[] = {
- {"add_pkg", (PyCFunction)add_pkg, METH_VARARGS, NULL},
- {"dbinfo_update", (PyCFunction)dbinfo_update, METH_VARARGS, NULL},
- {"close", (PyCFunction)close_db, METH_NOARGS, NULL},
+ {"add_pkg", (PyCFunction)add_pkg, METH_VARARGS,
+ add_pkg__doc__},
+ {"dbinfo_update", (PyCFunction)dbinfo_update, METH_VARARGS,
+ dbinfo_update__doc__},
+ {"close", (PyCFunction)close_db, METH_NOARGS,
+ close__doc__},
{NULL} /* sentinel */
};
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
- "Sqlite object", /* tp_doc */
+ sqlite_init__doc__, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
#include "src/createrepo_c.h"
+PyDoc_STRVAR(xml_dump_primary__doc__,
+"xml_dump_primary(pkg) -> str\n\n"
+"Generate primary xml chunk from the package");
+
PyObject *py_xml_dump_primary(PyObject *self, PyObject *args);
+
+PyDoc_STRVAR(xml_dump_filelists__doc__,
+"xml_dump_filelists(pkg) -> str\n\n"
+"Generate filelists xml chunk from the package");
+
PyObject *py_xml_dump_filelists(PyObject *self, PyObject *args);
+
+PyDoc_STRVAR(xml_dump_other__doc__,
+"xml_dump_other(pkg) -> str\n\n"
+"Generate other xml chunk from the package");
+
PyObject *py_xml_dump_other(PyObject *self, PyObject *args);
+
+PyDoc_STRVAR(xml_dump__doc__,
+"xml_dump(pkg) -> (str, str, str)\n\n"
+"Generate primary, filelists and other xml chunks from the package");
+
PyObject *py_xml_dump(PyObject *self, PyObject *args);
#endif
return (PyObject *)self;
}
+PyDoc_STRVAR(xmlfile_init__doc__,
+"XmlFile object represents a single XML file (primary, filelists or other).\n\n"
+".. method:: __init__(path, type, compression_type, contentstat)\n\n"
+" :arg path: Path to the database\n"
+" :arg type: Type of the XML file. One from XMLFILE_PRIMARY,\n"
+" XMLFILE_FILELISTS, XMLFILE_OTHER constants\n"
+" :arg compression_type: Compression type specified by constant\n"
+" :arg contentstat: ContentStat object to gather content statistics or None");
+
static int
xmlfile_init(_XmlFileObject *self, PyObject *args, PyObject *kwds)
{
/* XmlFile methods */
+PyDoc_STRVAR(set_num_of_pkgs__doc__,
+"set_num_of_pkgs(number_of_packages) -> None\n\n"
+"Set number of all packages");
+
static PyObject *
set_num_of_pkgs(_XmlFileObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
+PyDoc_STRVAR(add_pkg__doc__,
+"add_pkg(Package) -> None\n\n"
+"Add Package to the xml");
+
static PyObject *
add_pkg(_XmlFileObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
+PyDoc_STRVAR(add_chunk__doc__,
+"add_chunk(chunk) -> None\n\n"
+"Add a string chunk to the xml");
+
static PyObject *
add_chunk(_XmlFileObject *self, PyObject *args)
{
Py_RETURN_NONE;
}
+PyDoc_STRVAR(close__doc__,
+"close() -> None\n\n"
+"Close the XML file");
+
static PyObject *
xmlfile_close(_XmlFileObject *self, void *nothing)
{
}
static struct PyMethodDef xmlfile_methods[] = {
- {"set_num_of_pkgs", (PyCFunction)set_num_of_pkgs, METH_VARARGS, NULL},
- {"add_pkg", (PyCFunction)add_pkg, METH_VARARGS, NULL},
- {"add_chunk", (PyCFunction)add_chunk, METH_VARARGS, NULL},
- {"close", (PyCFunction)xmlfile_close, METH_NOARGS, NULL},
+ {"set_num_of_pkgs", (PyCFunction)set_num_of_pkgs, METH_VARARGS,
+ set_num_of_pkgs__doc__},
+ {"add_pkg", (PyCFunction)add_pkg, METH_VARARGS,
+ add_pkg__doc__},
+ {"add_chunk", (PyCFunction)add_chunk, METH_VARARGS,
+ add_chunk__doc__},
+ {"close", (PyCFunction)xmlfile_close, METH_NOARGS,
+ close__doc__},
{NULL} /* sentinel */
};
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */
- "XmlFile object", /* tp_doc */
+ xmlfile_init__doc__, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
#include "src/createrepo_c.h"
+PyDoc_STRVAR(xml_parse_primary__doc__,
+"xml_parse_primary(filename, newpkgcb, pkgcb, warningcb, do_files) -> None\n\n"
+"Parse primary.xml");
+
PyObject *py_xml_parse_primary(PyObject *self, PyObject *args);
+
+PyDoc_STRVAR(xml_parse_filelists__doc__,
+"xml_parse_filelists(filename, newpkgcb, pkgcb, warningcb) -> None\n\n"
+"Parse filelists.xml");
+
PyObject *py_xml_parse_filelists(PyObject *self, PyObject *args);
+
+PyDoc_STRVAR(xml_parse_other__doc__,
+"xml_parse_other(filename, newpkgcb, pkgcb, warningcb) -> None\n\n"
+"Parse other.xml");
+
PyObject *py_xml_parse_other(PyObject *self, PyObject *args);
+
+PyDoc_STRVAR(xml_parse_repomd__doc__,
+"xml_parse_repomd(filename, repomd_object, warningcb) -> None\n\n"
+"Parse repomd.xml");
+
PyObject *py_xml_parse_repomd(PyObject *self, PyObject *args);
#endif
cr_ChecksumType checksum_type,
GError **err);
-/** Almost analogue of cr_repomd_record_fill but suitable for groupfile.
+/** Almost analogous to cr_repomd_record_fill but suitable for groupfile.
* Record must be set with the path to existing non compressed groupfile.
* Compressed file will be created and compressed_record updated.
* @param record cr_RepomdRecord initialized to an existing