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

Expose QR code helper explicitly #62

Merged
merged 1 commit into from
Apr 12, 2024
Merged

Expose QR code helper explicitly #62

merged 1 commit into from
Apr 12, 2024

Conversation

Majsvaffla
Copy link
Collaborator

At work, we recently migrated to v1.0.0 of pybankid. The way our code is written makes it cumbersome to access the generate_qr_code_content staticmethod of the client instance. These changes makes it possible to import that helper from the package top level, while keeping the staticmethod on the client class for backwards compatibility.

@Majsvaffla Majsvaffla requested a review from hbldh April 8, 2024 14:39
@Majsvaffla Majsvaffla self-assigned this Apr 8, 2024
This simplifies making use of it without having access to a client instance.
@hbldh
Copy link
Owner

hbldh commented Apr 8, 2024

Yes, I see your point. I had it that way in the beginning, but felt that you probably always had the client available anyway so I could save users the extra import. Now I have been proven wrong.

Can you move the generate method to utils.py instead of the base class file? Then I will merge it and release 1.0.1 soon after that.

@@ -83,3 +72,18 @@ def _create_payload(
if user_visible_data_format and user_visible_data_format == "simpleMarkdownV1":
data["userVisibleDataFormat"] = "simpleMarkdownV1"
return data


def generate_qr_code_content(qr_start_token: str, start_t: [float, datetime], qr_start_secret: str) -> str:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to utils.py instead.

Copy link
Owner

@hbldh hbldh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will move them myself.

@hbldh hbldh merged commit 4392874 into develop Apr 12, 2024
1 of 4 checks passed
@hbldh hbldh mentioned this pull request Apr 12, 2024
@hbldh
Copy link
Owner

hbldh commented Apr 12, 2024

This has now been released in version 1.0.1.

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

Successfully merging this pull request may close these issues.

2 participants