Skip to content

Add type hints to blueman.main - #1341

Merged
cschramm merged 5 commits into
blueman-project:masterfrom
cschramm:types-main
Aug 26, 2020
Merged

Add type hints to blueman.main #1341
cschramm merged 5 commits into
blueman-project:masterfrom
cschramm:types-main

Conversation

@cschramm

Copy link
Copy Markdown
Member

Depends on #1332 (probably for no good reason 🙈)

@cschramm cschramm mentioned this pull request Aug 18, 2020
@cschramm

Copy link
Copy Markdown
Member Author

And there we are again, Python 3.6. Didn't last too long since our last encounter... 🤠

* Do not pass on well-known callbacks.
* As the the command id is always known to callbacks, do not pass on data they can simply look up with it.
* Drop noop simple_callback.
* Use simple strings instead of tuples to define commands that do not check the response and have the standard terminators.
notify_msg is not used at all and notification is always True
@cschramm
cschramm force-pushed the types-main branch 2 times, most recently from d36b7cd to 20aa96f Compare August 25, 2020 20:24
@cschramm

Copy link
Copy Markdown
Member Author

I managed to get away without using Generic (which is an issue in Python 3.6 as GenericMeta and GObjectMeta are kind of incompatible, see #1349) although PluginManager feels a little strange now regarding its type variable which gets kind of erased. The given plugin_class defines the types of __plugins and __classes on initialization but when we know we have a PluginManager in our hands we have to specify the exact types of what we expect from get_classes or get_plugins and the argument to __load_plugin is not really checked (it just has to be an arbitrary type).

@cschramm
cschramm marked this pull request as ready for review August 25, 2020 22:36
@cschramm
cschramm requested a review from infirit August 25, 2020 22:37
@cschramm cschramm mentioned this pull request Aug 25, 2020
Comment thread blueman/main/DBusProxies.py Outdated
Comment thread blueman/main/Manager.py Outdated
Comment thread blueman/main/NetConf.py
Comment thread blueman/main/Sendto.py
Comment thread blueman/main/Sendto.py
Comment thread blueman/main/SpeedCalc.py Outdated
Comment thread blueman/main/DbusService.py
@infirit

infirit commented Aug 26, 2020

Copy link
Copy Markdown
Contributor

I shouldn't do review on windows any-more before playing games. Next time when I make little sense remind me 😉

@cschramm
cschramm merged commit 982b9ae into blueman-project:master Aug 26, 2020
@cschramm
cschramm deleted the types-main branch August 26, 2020 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants