Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting $releasever, $arch, and $basearch with Python bindings #241

Closed
inknos opened this issue Jan 19, 2023 Discussed in #232 · 2 comments
Closed

Setting $releasever, $arch, and $basearch with Python bindings #241

inknos opened this issue Jan 19, 2023 Discussed in #232 · 2 comments
Assignees

Comments

@inknos
Copy link
Collaborator

inknos commented Jan 19, 2023

Discussed in #232

Originally posted by gotmax23 January 13, 2023
Hi! I couldn't figure out how to get or set/override these values with the libdnf5 Python bindings. Can you point me in the right direction?

@inknos inknos self-assigned this Jan 19, 2023
@j-mracek
Copy link
Contributor

j-mracek commented Feb 15, 2023

I believe that Vars class is something that you are looking for.

base = libdnf5.base.Base()
vars = base.get_vars().get()

then

vars.set('releasever', '33')
vars.get('releasever'))

but I see a problem - get returns swig object therefore I believe that it needs additional care - add definition of that object to swig

@j-mracek
Copy link
Contributor

But this works

print(vars.get_value('releasever'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants