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

(feat) Next iteration of all xml-support #929

Merged
merged 18 commits into from
Sep 23, 2024

Conversation

thomasht86
Copy link
Collaborator

@thomasht86 thomasht86 commented Sep 19, 2024

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

Why

For background and context, see #915

What

Added some more meat needed to ensure compatibility with old approach.
Still a good way to go, but getting closer.
Next iteration will have tests of compatibility with old approach, and more tests for new approach.

@thomasht86 thomasht86 marked this pull request as ready for review September 20, 2024 10:30
Copy link
Contributor

@glebashnik glebashnik left a comment

Choose a reason for hiding this comment

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

Looks good but can be hard to understand with doc strings and type hints.
Consider adding them for non-trivial code.
See specific questions.

)
orig_text = original.text or ""
gen_text = generated.text or ""
self.assertEqual(orig_text.strip(), gen_text.strip())
Copy link
Contributor

@glebashnik glebashnik Sep 23, 2024

Choose a reason for hiding this comment

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

The intention is for "" to equal None, why?

@@ -64,6 +65,7 @@ def __iter__(self):


def attrmap(o):
o = dict(_global="global").get(o, o)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose of this?

tag.lower(), *_preproc(c, kw, attrmap=attrmap, valmap=valmap), void_=void_
)
# NB! fastcore.xml uses tag.lower() for tag names. This is not done here.
return VT(tag, *_preproc(c, kw, attrmap=attrmap, valmap=valmap), void_=void_)
Copy link
Contributor

Choose a reason for hiding this comment

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

What does preproc do?
A docstring for preproc would be nice.

@@ -157,6 +164,8 @@ def _to_xml(elm, lvl, indent, do_escape):

# Handle void (self-closing) tags
if elm.void_:
if isinstance(elm.void_, str):
Copy link
Contributor

Choose a reason for hiding this comment

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

For contxt, void_ is a bool?
Why check for str?

@thomasht86
Copy link
Collaborator Author

Thanks a lot for the input. Will address in following PR as discussed.

@thomasht86 thomasht86 merged commit 6d33c20 into master Sep 23, 2024
44 checks passed
@thomasht86 thomasht86 deleted the thomasht86/use-new-serviceconfiguration-in-package branch September 23, 2024 10:52
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