Skip to content

API improvements #5

@omidbimo

Description

@omidbimo

Regarding possible improvements I know there does exist some schemas for various EDS sections in the json references folder however I'm not sure if there is any way to utilize them easily in creation.

If there existed a class for each section defined in the spec that has a method to set a specific entries by name e.g. set_vend_name then that could possibly make things easier as it wouldn't be up to the end user to ensure that the strings they have written match the spec (e.g. vendor name should be written as VendName in the eds file) , however I understand there are many sections and this would be time consuming.

One useful function could also be something like this:

def add_field_to_entry(entry, value, comment=None):
    """
    Add a field to an entry, optionally include an inline comment

    Args:
        entry: The entry
        value: Field value
        comment: Optional comment for the field
    """
    field = entry.add_field(value)

    if comment:
        field.fcomment = comment

    return field

Which just makes the commenting functionality easier to use in my opinion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions