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

create high-level purple.PurpleClient #7

Merged
merged 1 commit into from Nov 11, 2019
Merged

create high-level purple.PurpleClient #7

merged 1 commit into from Nov 11, 2019

Conversation

@aviau
Copy link
Member

aviau commented Nov 8, 2019

No description provided.

@aviau aviau force-pushed the high-level-client branch from c1bcf27 to a728d51 Nov 8, 2019
@aviau

This comment has been minimized.

Copy link
Member Author

aviau commented Nov 8, 2019

@samlaroche ou @isra17

J'ai créé un purple.Purpleclient qui encapsule le client normal (le client normal fait juste forward les fonctions au C) et qui permet de setter des callbacks typés.

Ca t'empèche de faire des erreurs genre setter un callback 2 fois ce qui briserait libpurple à bin des endroits. Pis y'a des callbacks qui sont presque jamais appelés alors le typing permet au moins de s'assurer que t'as le bon callback.

Le setup actuel dans notre code privé était de copier le code de simpleclient.py. Cette PR prend pas mal de code et le met dans purple.Client qu'on pourra importer dans notre code privé sans faire de duplication.

@aviau aviau force-pushed the high-level-client branch from a728d51 to 6c14394 Nov 8, 2019
@aviau

This comment has been minimized.

Copy link
Member Author

aviau commented Nov 8, 2019

Ce que cette PR fait c'est mostly de créer plein de Protocols pis de faire un classe qui permet de set les callbacks avec les protocols. au lieu de l'enum Callback.CALLBACK_NAME

Copy link

isra17 left a comment

One comment, otherwise lgtm!

purple/client/callbacks.py Show resolved Hide resolved
@isra17

This comment has been minimized.

Copy link

isra17 commented Nov 10, 2019

🚢 🇮🇹 !

@ghost

This comment has been minimized.

Copy link

ghost commented Nov 11, 2019

Ouais LGTM aussi! ⛵️

@aviau aviau force-pushed the high-level-client branch from 6c14394 to 602afcc Nov 11, 2019
@aviau aviau force-pushed the high-level-client branch from 602afcc to 4fd9311 Nov 11, 2019
@aviau aviau merged commit 5ba4bf5 into master Nov 11, 2019
2 checks passed
2 checks passed
Travis CI - Branch Build Passed
Details
Travis CI - Pull Request Build Passed
Details
@aviau aviau deleted the high-level-client branch Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.