WolfgangFahl / nicegui_widgets

nicegui widgets
http://ngdemo.bitplan.com
Apache License 2.0
14 stars 2 forks source link

yaml support #48

Closed WolfgangFahl closed 7 months ago

WolfgangFahl commented 7 months ago

Prompts for the development of the 'Yaml' class within the 'yaml' module:

  1. Develop a Python class named 'Yaml' in a module called 'yaml'. This class should focus on converting dataclass instances to YAML format, specifically for use in object-oriented programming.
  2. Implement methods in the 'Yaml' class for formatting multi-line string attributes using YAML block scalar style and excluding attributes with None values from the YAML output.
  3. Add a method to handle multi-line strings in the 'Yaml' class, ensuring they are formatted as block scalars in the YAML output.
  4. Include functionality to recursively remove None values from dataclass instances before conversion in the 'Yaml' class.
  5. The 'Yaml' class should only process dataclass instances, with error handling to raise a ValueError for non-dataclass objects.
  6. Write a comprehensive test suite for the 'Yaml' class within the context of the 'ngwidgets.basetest' framework. The tests should verify correct block scalar formatting, omission of None values, and general accuracy of the YAML conversion.
  7. Emphasize the use of Google-style docstrings, comprehensive comments, and type hints throughout the 'Yaml' class and its test suite.
  8. Adhere strictly to the provided instructions, and if there are any assumptions or uncertainties, seek clarification before proceeding.