1 /*#############################################################################
3 # Pakfire - The IPFire package management system #
4 # Copyright (C) 2017 Pakfire development team #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 #############################################################################*/
24 #include <pakfire/build.h>
25 #include <pakfire/constants.h>
26 #include <pakfire/dist.h>
27 #include <pakfire/execute.h>
28 #include <pakfire/logging.h>
29 #include <pakfire/packagelist.h>
30 #include <pakfire/pakfire.h>
31 #include <pakfire/key.h>
32 #include <pakfire/repo.h>
33 #include <pakfire/repolist.h>
34 #include <pakfire/request.h>
35 #include <pakfire/util.h>
43 static PyObject
* Pakfire_new(PyTypeObject
* type
, PyObject
* args
, PyObject
* kwds
) {
44 PakfireObject
* self
= (PakfireObject
*)type
->tp_alloc(type
, 0);
50 return (PyObject
*)self
;
53 static void Pakfire_logging_callback(void* data
, int priority
, const char* file
, int line
,
54 const char* fn
, const char* format
, va_list args
) {
55 PyObject
* callback
= (PyObject
*)data
;
57 // Do nothing if callback isn't set
61 // Translate priority to Python logging priorities
75 // Drop messages of an unknown priority
80 PyObject
* tuple
= NULL
;
81 PyObject
* result
= NULL
;
85 int r
= vasprintf(&buffer
, format
, args
);
89 // Build a tuple with the priority and the log message
90 tuple
= Py_BuildValue("(is)", priority
, buffer
);
95 result
= PyObject_CallObject(callback
, tuple
);
104 static int Pakfire_init(PakfireObject
* self
, PyObject
* args
, PyObject
* kwds
) {
105 char* kwlist
[] = { "path", "arch", "logger", "offline", "conf", "build",
106 "enable_ccache", "enable_snapshot", NULL
};
107 const char* path
= NULL
;
108 const char* arch
= NULL
;
109 const char* conf
= NULL
;
112 int enable_ccache
= 1;
113 int enable_snapshot
= 1;
115 if (!PyArg_ParseTupleAndKeywords(args
, kwds
, "|zzOpzppp", kwlist
,
116 &path
, &arch
, &self
->logger
, &offline
, &conf
, &build
,
117 &enable_ccache
, &enable_snapshot
))
120 // Check if logger is callable
121 if (self
->logger
&& !PyCallable_Check(self
->logger
)) {
122 PyErr_SetString(PyExc_TypeError
, "logger must be callable\n");
128 // Enable offline mode
130 flags
|= PAKFIRE_FLAGS_OFFLINE
;
134 flags
|= PAKFIRE_FLAGS_BUILD
;
137 flags
|= PAKFIRE_FLAGS_DISABLE_CCACHE
;
139 if (!enable_snapshot
)
140 flags
|= PAKFIRE_FLAGS_DISABLE_SNAPSHOT
;
143 // Create a new Pakfire instance
144 int r
= pakfire_create(&self
->pakfire
, path
, arch
, conf
, flags
,
145 (self
->logger
) ? Pakfire_logging_callback
: NULL
, self
->logger
);
148 // Invalid architecture or path
150 PyErr_SetString(PyExc_ValueError
, "Invalid architecture or path");
155 PyErr_SetFromErrno(PyExc_OSError
);
161 Py_XINCREF(self
->logger
);
166 static void Pakfire_dealloc(PakfireObject
* self
) {
168 pakfire_unref(self
->pakfire
);
171 Py_DECREF(self
->logger
);
173 Py_TYPE(self
)->tp_free((PyObject
*)self
);
176 static PyObject
* Pakfire_repr(PakfireObject
* self
) {
177 const char* path
= pakfire_get_path(self
->pakfire
);
178 const char* arch
= pakfire_get_arch(self
->pakfire
);
180 return PyUnicode_FromFormat("<_pakfire.Pakfire %s (%s)>", path
, arch
);
183 static PyObject
* Pakfire_get_path(PakfireObject
* self
) {
184 const char* path
= pakfire_get_path(self
->pakfire
);
186 return PyUnicode_FromString(path
);
189 static PyObject
* Pakfire_get_arch(PakfireObject
* self
) {
190 const char* arch
= pakfire_get_arch(self
->pakfire
);
192 return PyUnicode_FromString(arch
);
195 static PyObject
* Pakfire_get_repo(PakfireObject
* self
, PyObject
* args
) {
196 const char* name
= NULL
;
198 if (!PyArg_ParseTuple(args
, "s", &name
))
201 struct pakfire_repo
* repo
= pakfire_get_repo(self
->pakfire
, name
);
205 PyObject
* obj
= new_repo(&RepoType
, repo
);
206 pakfire_repo_unref(repo
);
211 static int convert_packages(PyObject
* object
, void* address
) {
212 char*** packages
= (char***)address
;
214 // Called for cleanup
218 if (!PySequence_Check(object
)) {
219 PyErr_SetString(PyExc_ValueError
, "Packages must be a sequence");
223 const unsigned int length
= PySequence_Length(object
);
225 return Py_CLEANUP_SUPPORTED
;
228 *packages
= calloc(length
+ 1, sizeof(*packages
));
230 PyErr_SetFromErrno(PyExc_OSError
);
234 for (unsigned int i
= 0; i
< length
; i
++) {
235 PyObject
* item
= PySequence_GetItem(object
, i
);
237 // Check if input is a string
238 if (!PyUnicode_Check(item
)) {
241 PyErr_SetString(PyExc_AttributeError
, "Expected a string");
246 const char* package
= PyUnicode_AsUTF8(item
);
252 // Add package to array
253 (*packages
)[i
] = strdup(package
);
254 if (!(*packages
)[i
]) {
263 return Py_CLEANUP_SUPPORTED
;
267 for (char** package
= *packages
; *package
; package
++)
275 static PyObject
* Pakfire_install(PakfireObject
* self
, PyObject
* args
, PyObject
* kwargs
) {
278 "without_recommended",
283 char** packages
= NULL
;
284 int without_recommended
= 0;
285 int allow_uninstall
= 0;
286 int allow_downgrade
= 0;
287 int solver_flags
= 0;
289 if (!PyArg_ParseTupleAndKeywords(args
, kwargs
, "O&|$ppp", kwlist
,
290 convert_packages
, &packages
, &without_recommended
, &allow_uninstall
,
294 // Do not install recommended packages
295 if (without_recommended
)
296 solver_flags
|= PAKFIRE_REQUEST_WITHOUT_RECOMMENDED
;
298 // Can the solver uninstall packages?
300 solver_flags
|= PAKFIRE_REQUEST_ALLOW_UNINSTALL
;
302 // Can the solver downgrade packages?
304 solver_flags
|= PAKFIRE_REQUEST_ALLOW_DOWNGRADE
;
306 // Run pakfire_install
307 int r
= pakfire_install(self
->pakfire
, solver_flags
, (const char**)packages
, NULL
, 0, NULL
);
309 PyErr_SetFromErrno(PyExc_OSError
);
312 for (char** package
= packages
; *package
; package
++)
323 static PyObject
* Pakfire_erase(PakfireObject
* self
, PyObject
* args
, PyObject
* kwargs
) {
329 char** packages
= NULL
;
330 int keep_dependencies
= 0;
333 if (!PyArg_ParseTupleAndKeywords(args
, kwargs
, "O&|$p", kwlist
,
334 convert_packages
, &packages
, &keep_dependencies
))
337 if (keep_dependencies
)
338 flags
|= PAKFIRE_REQUEST_KEEP_DEPS
;
341 int r
= pakfire_erase(self
->pakfire
, 0, (const char**)packages
, NULL
, flags
, NULL
);
343 PyErr_SetFromErrno(PyExc_OSError
);
346 for (char** package
= packages
; *package
; package
++)
357 static PyObject
* Pakfire_update(PakfireObject
* self
, PyObject
* args
, PyObject
* kwargs
) {
365 char** packages
= NULL
;
366 char** excludes
= NULL
;
367 int allow_uninstall
= 0;
368 int allow_downgrade
= 0;
369 int solver_flags
= 0;
371 if (!PyArg_ParseTupleAndKeywords(args
, kwargs
, "O&|$O&pp", kwlist
,
372 convert_packages
, &packages
, convert_packages
, &excludes
,
373 &allow_uninstall
, &allow_downgrade
))
376 // Can the solver uninstall packages?
378 solver_flags
|= PAKFIRE_REQUEST_ALLOW_UNINSTALL
;
380 // Can the solver downgrade packages?
382 solver_flags
|= PAKFIRE_REQUEST_ALLOW_DOWNGRADE
;
384 // Run pakfire_update
385 int r
= pakfire_update(self
->pakfire
, solver_flags
, (const char**)packages
,
386 (const char**)excludes
, 0, NULL
);
388 PyErr_SetFromErrno(PyExc_OSError
);
391 for (char** package
= packages
; *package
; package
++)
397 for (char** exclude
= excludes
; *exclude
; exclude
++)
408 static PyObject
* _import_keylist(PakfireObject
* pakfire
, PakfireKey
* keys
) {
409 PyObject
* list
= PyList_New(0);
411 while (keys
&& *keys
) {
412 PakfireKey key
= *keys
++;
414 PyObject
* object
= new_key(&KeyType
, key
);
415 PyList_Append(list
, object
);
417 // Drop reference to the Python object
420 // Drop reference to the key object
421 pakfire_key_unref(key
);
427 static PyObject
* Pakfire_get_keys(PakfireObject
* self
) {
428 PakfireKey
* keys
= pakfire_key_list(self
->pakfire
);
430 return _import_keylist(self
, keys
);
433 static PyObject
* Pakfire_get_key(PakfireObject
* self
, PyObject
* args
) {
434 const char* pattern
= NULL
;
436 if (!PyArg_ParseTuple(args
, "s", &pattern
))
439 PakfireKey key
= pakfire_key_get(self
->pakfire
, pattern
);
443 return new_key(&KeyType
, key
);
446 static PyObject
* Pakfire_generate_key(PakfireObject
* self
, PyObject
* args
) {
447 const char* userid
= NULL
;
449 if (!PyArg_ParseTuple(args
, "s", &userid
))
452 PakfireKey key
= pakfire_key_generate(self
->pakfire
, userid
);
455 return new_key(&KeyType
, key
);
458 static PyObject
* Pakfire_import_key(PakfireObject
* self
, PyObject
* args
) {
459 const char* data
= NULL
;
461 if (!PyArg_ParseTuple(args
, "s", &data
))
464 PakfireKey
* keys
= pakfire_key_import(self
->pakfire
, data
);
466 return NULL
; // TODO Raise error from errno
468 return _import_keylist(self
, keys
);
471 static PyObject
* Pakfire_whatprovides(PakfireObject
* self
, PyObject
* args
) {
472 const char* provides
= NULL
;
473 struct pakfire_packagelist
* list
= NULL
;
475 if (!PyArg_ParseTuple(args
, "s", &provides
))
478 int r
= pakfire_whatprovides(self
->pakfire
, provides
, 0, &list
);
480 PyErr_SetFromErrno(PyExc_OSError
);
484 PyObject
* obj
= PyList_FromPackageList(list
);
485 pakfire_packagelist_unref(list
);
490 static PyObject
* Pakfire_whatrequires(PakfireObject
* self
, PyObject
* args
) {
491 const char* requires
= NULL
;
492 struct pakfire_packagelist
* list
= NULL
;
494 if (!PyArg_ParseTuple(args
, "s", &requires
))
497 int r
= pakfire_whatrequires(self
->pakfire
, requires
, 0, &list
);
499 PyErr_SetFromErrno(PyExc_OSError
);
503 PyObject
* obj
= PyList_FromPackageList(list
);
504 pakfire_packagelist_unref(list
);
509 static PyObject
* Pakfire_search(PakfireObject
* self
, PyObject
* args
, PyObject
* kwds
) {
510 char* kwlist
[] = { "pattern", "name_only", NULL
};
511 struct pakfire_packagelist
* list
= NULL
;
512 const char* pattern
= NULL
;
516 if (!PyArg_ParseTupleAndKeywords(args
, kwds
, "s|$p", kwlist
, &pattern
, &name_only
))
519 // Search for package names only
521 flags
|= PAKFIRE_SEARCH_NAME_ONLY
;
523 int r
= pakfire_search(self
->pakfire
, pattern
, flags
, &list
);
525 PyErr_SetFromErrno(PyExc_OSError
);
529 PyObject
* obj
= PyList_FromPackageList(list
);
530 pakfire_packagelist_unref(list
);
535 static PyObject
* Pakfire_version_compare(PakfireObject
* self
, PyObject
* args
) {
536 const char* evr1
= NULL
;
537 const char* evr2
= NULL
;
539 if (!PyArg_ParseTuple(args
, "ss", &evr1
, &evr2
))
542 int cmp
= pakfire_version_compare(self
->pakfire
, evr1
, evr2
);
544 return PyLong_FromLong(cmp
);
547 static PyObject
* Pakfire_execute_logging_callback
= NULL
;
549 static int __Pakfire_execute_logging_callback(Pakfire pakfire
, void* data
,
550 int priority
, const char* line
, size_t length
) {
553 // Do nothing if callback isn't set
554 if (!Pakfire_execute_logging_callback
)
557 // Translate priority to Python logging priorities
568 // Remove the trailing newline
569 if (line
&& line
[length
- 1] == '\n')
572 // Create tuple with arguments for the callback function
573 PyObject
* args
= Py_BuildValue("(is#)", priority
, line
, length
);
577 PyObject
* result
= PyObject_CallObject(Pakfire_execute_logging_callback
, args
);
578 if (result
&& PyLong_Check(result
)) {
579 r
= PyLong_AsLong(result
);
588 static PyObject
* Pakfire_execute(PakfireObject
* self
, PyObject
* args
, PyObject
* kwds
) {
589 char* kwlist
[] = {"command", "environ", "enable_network", "interactive",
590 "logging_callback", NULL
};
592 PyObject
* command
= NULL
;
593 PyObject
* environ
= NULL
;
594 int enable_network
= 0;
596 PyObject
* logging_callback
= NULL
;
598 if (!PyArg_ParseTupleAndKeywords(args
, kwds
, "O|OppO", kwlist
, &command
, &environ
,
599 &enable_network
, &interactive
, &logging_callback
))
602 // Check if command is a list
603 if (!PyList_Check(command
)) {
604 PyErr_SetString(PyExc_TypeError
, "command must be a list");
608 ssize_t command_length
= PyList_Size(command
);
610 // Check if command is not empty
611 if (command_length
== 0) {
612 PyErr_SetString(PyExc_ValueError
, "command is empty");
616 // All arguments in command must be strings
617 for (unsigned int i
= 0; i
< command_length
; i
++) {
618 PyObject
* item
= PyList_GET_ITEM(command
, i
);
620 if (!PyUnicode_Check(item
)) {
621 PyErr_Format(PyExc_TypeError
, "Item %u in command is not a string", i
);
626 // Check if logging_callback is
627 if (logging_callback
&& !PyCallable_Check(logging_callback
)) {
628 PyErr_SetString(PyExc_TypeError
, "logging_callback must be callable\n");
632 ssize_t environ_length
= 0;
638 // Check if environ is a dictionary
639 if (!PyDict_Check(environ
)) {
640 PyErr_SetString(PyExc_TypeError
, "environ must be a dictionary");
644 // All keys and values must be strings
645 while (PyDict_Next(environ
, &p
, &key
, &value
)) {
646 if (!PyUnicode_Check(key
) || !PyUnicode_Check(value
)) {
647 PyErr_SetString(PyExc_TypeError
, "Environment contains a non-string object");
652 environ_length
= PyDict_Size(environ
);
655 // All inputs look fine
657 const char* argv
[command_length
+ 1];
658 char* envp
[environ_length
+ 1];
662 for (unsigned int i
= 0; i
< command_length
; i
++) {
663 PyObject
* item
= PyList_GET_ITEM(command
, i
);
664 argv
[i
] = PyUnicode_AsUTF8(item
);
672 while (PyDict_Next(environ
, &p
, &key
, &value
)) {
673 int r
= asprintf(&envp
[i
++], "%s=%s",
674 PyUnicode_AsUTF8(key
), PyUnicode_AsUTF8(value
));
679 for (unsigned int i
= 0; envp
[i
]; i
++)
682 return PyErr_NoMemory();
687 // Terminate argv and envp
688 argv
[command_length
] = NULL
;
689 envp
[environ_length
] = NULL
;
693 flags
|= PAKFIRE_EXECUTE_ENABLE_NETWORK
;
697 flags
|= PAKFIRE_EXECUTE_INTERACTIVE
;
699 // Set logging callback
700 Pakfire_execute_logging_callback
= logging_callback
;
703 int r
= pakfire_execute(self
->pakfire
, argv
, envp
, flags
,
704 (logging_callback
) ? __Pakfire_execute_logging_callback
: NULL
, NULL
);
707 for (unsigned int i
= 0; envp
[i
]; i
++)
710 // Raise an OS error if r < 0
714 PyErr_SetFromErrno(PyExc_OSError
);
717 // Raise exception when the command failed
719 PyObject
* code
= PyLong_FromLong(r
);
721 PyErr_SetObject(PyExc_CommandExecutionError
, code
);
731 static PyObject
* Pakfire_dist(PakfireObject
* self
, PyObject
* args
) {
732 const char* path
= NULL
;
733 const char* target
= NULL
;
735 if (!PyArg_ParseTuple(args
, "s|z", &path
, &target
))
738 int r
= pakfire_dist(self
->pakfire
, path
, target
);
740 PyErr_SetFromErrno(PyExc_OSError
);
747 static PyObject
* Pakfire_bind(PakfireObject
* self
, PyObject
* args
) {
748 const char* src
= NULL
;
749 const char* dst
= NULL
;
751 if (!PyArg_ParseTuple(args
, "s|z", &src
, &dst
))
754 int r
= pakfire_bind(self
->pakfire
, src
, dst
, 0);
756 PyErr_SetFromErrno(PyExc_OSError
);
763 static PyObject
* Pakfire_copy_in(PakfireObject
* self
, PyObject
* args
) {
764 const char* src
= NULL
;
765 const char* dst
= NULL
;
767 if (!PyArg_ParseTuple(args
, "ss", &src
, &dst
))
770 int r
= pakfire_copy_in(self
->pakfire
, src
, dst
);
772 PyErr_SetFromErrno(PyExc_OSError
);
779 static PyObject
* Pakfire_copy_out(PakfireObject
* self
, PyObject
* args
) {
780 const char* src
= NULL
;
781 const char* dst
= NULL
;
783 if (!PyArg_ParseTuple(args
, "ss", &src
, &dst
))
786 int r
= pakfire_copy_out(self
->pakfire
, src
, dst
);
788 PyErr_SetFromErrno(PyExc_OSError
);
795 static PyObject
* Pakfire_get_repos(PakfireObject
* self
) {
796 struct pakfire_repolist
* repos
= pakfire_get_repos(self
->pakfire
);
798 PyErr_SetFromErrno(PyExc_OSError
);
802 const size_t l
= pakfire_repolist_size(repos
);
804 PyObject
* list
= PyList_New(l
);
808 for (unsigned int i
= 0; i
< l
; i
++) {
809 struct pakfire_repo
* repo
= pakfire_repolist_get(repos
, i
);
813 PyObject
* obj
= new_repo(&RepoType
, repo
);
814 PyList_SET_ITEM(list
, i
, obj
);
816 pakfire_repo_unref(repo
);
820 pakfire_repolist_unref(repos
);
825 static PyObject
* execute_return_value(int r
) {
826 // Raise an OS error if r < 0
830 PyErr_SetFromErrno(PyExc_OSError
);
833 // Raise exception when the command failed
835 PyObject
* code
= PyLong_FromLong(r
);
837 PyErr_SetObject(PyExc_CommandExecutionError
, code
);
846 static PyObject
* Pakfire_build(PakfireObject
* self
, PyObject
* args
, PyObject
* kwargs
) {
847 char* kwlist
[] = { "path", "build_id", "logging_callback", "interactive", NULL
};
849 const char* path
= NULL
;
850 const char* build_id
= NULL
;
851 PyObject
* logging_callback
= NULL
;
854 if (!PyArg_ParseTupleAndKeywords(args
, kwargs
, "s|zOp", kwlist
, &path
,
855 &build_id
, &logging_callback
, &interactive
))
860 // Enable interactive mode
862 flags
|= PAKFIRE_BUILD_INTERACTIVE
;
864 // Check if logging_callback is
865 if (logging_callback
&& !PyCallable_Check(logging_callback
)) {
866 PyErr_SetString(PyExc_TypeError
, "logging_callback must be callable\n");
870 // Set logging callback
871 Pakfire_execute_logging_callback
= logging_callback
;
874 int r
= pakfire_build(self
->pakfire
, path
, NULL
, build_id
, flags
,
875 (logging_callback
) ? __Pakfire_execute_logging_callback
: NULL
, NULL
);
877 return execute_return_value(r
);
880 static PyObject
* Pakfire_shell(PakfireObject
* self
) {
881 int r
= pakfire_shell(self
->pakfire
);
883 return execute_return_value(r
);
886 static PyObject
* Pakfire_clean(PakfireObject
* self
) {
887 int r
= pakfire_clean(self
->pakfire
, 0);
889 PyErr_SetFromErrno(PyExc_OSError
);
896 static PyObject
* Pakfire_refresh(PakfireObject
* self
, PyObject
* args
) {
899 if (!PyArg_ParseTuple(args
, "|p", &force
))
902 int r
= pakfire_refresh(self
->pakfire
, force
);
904 PyErr_SetFromErrno(PyExc_OSError
);
911 static PyObject
* Pakfire_check(PakfireObject
* self
) {
912 int r
= pakfire_check(self
->pakfire
);
914 PyErr_SetFromErrno(PyExc_OSError
);
921 static PyObject
* Pakfire_sync(PakfireObject
* self
, PyObject
* args
, PyObject
* kwargs
) {
922 char* kwlist
[] = {"keep_orphaned", NULL
};
923 int keep_orphaned
= 0;
926 if (!PyArg_ParseTupleAndKeywords(args
, kwargs
, "|$p", kwlist
, &keep_orphaned
))
930 flags
|= PAKFIRE_REQUEST_KEEP_ORPHANED
;
932 int r
= pakfire_sync(self
->pakfire
, 0, flags
, NULL
);
934 PyErr_SetFromErrno(PyExc_OSError
);
941 static struct PyMethodDef Pakfire_methods
[] = {
944 (PyCFunction
)Pakfire_bind
,
950 (PyCFunction
)Pakfire_build
,
951 METH_VARARGS
|METH_KEYWORDS
,
956 (PyCFunction
)Pakfire_check
,
962 (PyCFunction
)Pakfire_clean
,
968 (PyCFunction
)Pakfire_copy_in
,
974 (PyCFunction
)Pakfire_copy_out
,
980 (PyCFunction
)Pakfire_dist
,
986 (PyCFunction
)Pakfire_erase
,
987 METH_VARARGS
|METH_KEYWORDS
,
992 (PyCFunction
)Pakfire_execute
,
993 METH_VARARGS
|METH_KEYWORDS
,
998 (PyCFunction
)Pakfire_generate_key
,
1004 (PyCFunction
)Pakfire_get_key
,
1010 (PyCFunction
)Pakfire_get_repo
,
1016 (PyCFunction
)Pakfire_import_key
,
1022 (PyCFunction
)Pakfire_install
,
1023 METH_VARARGS
|METH_KEYWORDS
,
1028 (PyCFunction
)Pakfire_refresh
,
1034 (PyCFunction
)Pakfire_search
,
1035 METH_VARARGS
|METH_KEYWORDS
,
1040 (PyCFunction
)Pakfire_shell
,
1046 (PyCFunction
)Pakfire_sync
,
1047 METH_VARARGS
|METH_KEYWORDS
,
1052 (PyCFunction
)Pakfire_update
,
1053 METH_VARARGS
|METH_KEYWORDS
,
1058 (PyCFunction
)Pakfire_version_compare
,
1064 (PyCFunction
)Pakfire_whatprovides
,
1070 (PyCFunction
)Pakfire_whatrequires
,
1077 static struct PyGetSetDef Pakfire_getsetters
[] = {
1080 (getter
)Pakfire_get_arch
,
1087 (getter
)Pakfire_get_keys
,
1094 (getter
)Pakfire_get_path
,
1101 (getter
)Pakfire_get_repos
,
1109 PyTypeObject PakfireType
= {
1110 PyVarObject_HEAD_INIT(NULL
, 0)
1111 tp_name
: "_pakfire.Pakfire",
1112 tp_basicsize
: sizeof(PakfireObject
),
1113 tp_flags
: Py_TPFLAGS_DEFAULT
|Py_TPFLAGS_BASETYPE
,
1114 tp_new
: Pakfire_new
,
1115 tp_dealloc
: (destructor
)Pakfire_dealloc
,
1116 tp_init
: (initproc
)Pakfire_init
,
1117 tp_doc
: "Pakfire object",
1118 tp_methods
: Pakfire_methods
,
1119 tp_getset
: Pakfire_getsetters
,
1120 tp_repr
: (reprfunc
)Pakfire_repr
,