-
Notifications
You must be signed in to change notification settings - Fork 76
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
Change reserved id vars, translate int states/bits to strings/tuples #47
Conversation
Refactor many modules that use python reserved ids as variables to different variable names. Comment out or note unused / unusued wild imports. Add module, doc and sample translation dictionary to automatically convert integers not used as numbers but as states or groups of related booleans stored as bits to / from strings / tuples. So before, interface.property==10. Now, interface.property=='What10Means' Before, interface.property_flags=0x102 Now, interface.property_flags=('what0x100means','what2means')
Made many additions, docs, fixes. See the hcoin version for details and latest. Once it passes all the unit testing I'll send another request. I'm a little concerned the original author has other interests at a higher priority. |
Hi, Thanks for your work, and indeed as you've mentioned I've other priorities now - I'm working on https://gitlab.com/aiakos/aiakos. However, I believe I'll find some time to cleanup/merge all the PRs and release new version this or next month. In terms of this feature - I strongly believe that translation data should be added to the DBus introspection data, maintained on the daemon's side of the pipe, and downloaded dynamically by pydbus and other dbus clients. In case this is impossible (for example because you want it to work with old versions of daemons), there could be a language-neutral repo with this data, so that other DBus libs will be able to use it too. There are a lot of languages with DBus client libs, and I don't think doing the work in each of them standalone is a good idea. They should be as similar as possible. There are links to multiple of them in the comments of #27 - you might want to discuss this topic with their maintainers, or on the dbus mailing list; they also might have more time for this than I have. |
That's the plan. I'm finishing up the unit testing now. All that's left is checking out naming the variables and translations on containers (dict, tuple, list). I doubt I'm going to take the time to make it work with python 2. It's pretty clear the authors of dbus servers should be the maintainers of the python translation dictionary. I've written a pretty flexible import module, adding the option to download a translation if none locally is found shouldn't be much of a job. |
Named arguments will be tested next.
Both object attribute based and dictionary/argument list based.
Added a c extension to support publishing on pre 2.4.6 glib&co releases. |
Latest release on my fork supercedes this one. This can be deteled. |
Refactor many modules that use python reserved ids as variables to
different variable names.
Comment out or note unused / unusued wild imports.
Add module, doc and sample translation dictionary to automatically
convert integers not used as numbers but as states or groups of related
booleans stored as bits to / from strings / tuples.
So before, interface.property==10.
Now, interface.property=='What10Means'
Before, interface.property_flags=0x102
Now, interface.property_flags=('what0x100means','what2means')