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

구매결과 이메일 전송 피쳐 추가 #56

Closed
roeniss opened this issue Oct 9, 2023 · 6 comments · Fixed by #77
Closed

구매결과 이메일 전송 피쳐 추가 #56

roeniss opened this issue Oct 9, 2023 · 6 comments · Fixed by #77
Assignees

Comments

@roeniss
Copy link
Owner

roeniss commented Oct 9, 2023

#12 의 선행작업

@roeniss roeniss self-assigned this Oct 9, 2023
@roeniss
Copy link
Owner Author

roeniss commented Oct 9, 2023

@seunggabi seunggabi_core_python==1.0.1 을 사용중인데, credentials 에서 임의의 값을 꺼낼 수 있게 업데이트가 가능한지 여쭤봅니다.

...
            credentials = config_util.get(group="dhapi", context="credentials", profile=self._args.profile[0])
            self._args.username = credentials["username"]
            self._args.password = credentials["password"]
            self._args.my_value = credentials["my_value"] # <<<<< 이런게 하고 싶습니다
...

지금 필요한 값은 resend_api_key 라는 값인데, 이름은 바뀔수도 있으니 dynamic 하게 가져올 수 있으면 좋겠습니다. 가능할지요? 🙇

p.s.) 옵셔널 값입니다 (None if not exist)

@seunggabi
Copy link
Contributor

seunggabi commented Oct 9, 2023

https://github.com/seunggabi/core_python/blob/main/test/util/config_util.py#L20-L24

현재 버전으로도 가능해요~
my_value or resend_api_key 추가하고 로드하시면 됩니다.

    [test_profile]
    key = test_key
    secret = test_secret
    resend_api_key = 1234
    my_value = asdf

안되면 말씀 부탁드려요~!
(제 library 첫 사용처인데 꾸준히 이용되어 좋네요 ㅎㅎ)

cc: @roeniss

@roeniss
Copy link
Owner Author

roeniss commented Oct 10, 2023

@seunggabi credentials 안에 값이 없으면 에러가 발생하는 것 같습니다.

@seunggabi
Copy link
Contributor

seunggabi commented Oct 10, 2023

@roeniss 오 제가 고쳐보겠습니다.
옵셔널 필드인데 값이 없으면 에러나게되어 있어서였군여!

@seunggabi
Copy link
Contributor

@roeniss
조금 늦게 이해햇는데, 해당 함수가 리턴하는건 dict 이라서..
obj_util.safe_get을 사용하는쪽이 더 좋을 것 같습니다.
dictionary 말고 다른거 리턴할까도 고민해봤는데.. 좀 그런거 같네요 ㅠ

사용하는 쪽의 코드가 불편해질까 ? 우려되어
의견주신것 같은데 safe_get을 한번 보시고 의견 부탁드려요!

self._args.my_value = obj_util.safe_get(credentials, "my_value") # None or value

https://github.com/seunggabi/core_python/blob/main/test/util/obj_util.py#L11-L15

@roeniss
Copy link
Owner Author

roeniss commented Oct 10, 2023

이해했습니다 넵

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 a pull request may close this issue.

2 participants