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

Object names #3

Open
Guillaume227 opened this issue Jun 12, 2021 · 2 comments
Open

Object names #3

Guillaume227 opened this issue Jun 12, 2021 · 2 comments

Comments

@Guillaume227
Copy link

Guillaume227 commented Jun 12, 2021

Hello, thanks for the useful library.
I have been playing around with it in the terminal and I have suggestions for making it more user-friendly.

  • provide some form of top-level entry point so we don't have to rely on doing the xml parsing separately to then pass a node to the Device constructor, e.g. a parse_sdv_file(file_path) function.
  • populating __str__ and __repr__ with self.name would make the console experience much better.
    At the moment when printing peripherals or registersI am seeing:
dev.peripherals
Out[27]:
[<pysvd.element.Peripheral at 0x2118e537af0>,
 <pysvd.element.Peripheral at 0x2118e537a90>,
 <pysvd.element.Peripheral at 0x2118cabc4f0>,
...]
 p.registers
Out[32]:
[<pysvd.element.Register at 0x2118e379c70>,
 <pysvd.element.Register at 0x2118e379040>,
 <pysvd.element.Register at 0x21191b6dca0>,
...]

Would be much nicer to see:

[DCMI,
 FMC,
 DBG,
 DMA2,
 DMA1,
 RCC,
 GPIOH,
 GPIOG,
 GPIOF,
...]

etc.
I can see most of the classes derivatives have a 'name' member (some don't though), we could discuss what the best approach is if you are open to it.

@bfueldner
Copy link
Owner

@Guillaume227: Sorry for my long off-time. I use Github only for publishing the master/develop branches. So I didn't recognize your request. I agree with your argument, that the printout is not very user-friendly. Your welcome to fork and support this tiny project. As you can see, documentation #1 is also outstanding as my part.

@bfueldner
Copy link
Owner

Misleadingly closed by another commit with same issue number from private repository server.

@bfueldner bfueldner reopened this Apr 26, 2022
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

No branches or pull requests

2 participants