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

template: |sort in template creates enum sorted by name and not by value #131

Open
patrickelectric opened this issue Apr 2, 2019 · 1 comment

Comments

@patrickelectric
Copy link
Member

patrickelectric commented Apr 2, 2019

From: #108

We are sorting the template in alphabetic order and not with #id number.
For a better code reading, we should move it somehow to sort the template by #id.

What is happening with |sort:

enum msg_CommonMessage_id {
    Ack = 1,
    Ascii_text = 3,
    Nack = 2,
    Protocol_version = 5,
    Request = 4,
};

without |sort:

enum msg_CommonMessage_id {
    Ack = 1,
    Nack = 2,
    Ascii_text = 3,
    Request = 4,
    Protocol_version = 5,
};

Originally this was an attempt do create the same output with python2 and python3.

@jaxxzer
Copy link
Member

jaxxzer commented Apr 2, 2019

I think the bigger issue might be that the json are keyed by name instead of id#.

I think keying the json by id, or restructuring the json generally could be the real fix

Putting a python3 restriction on this repository is the quickest/easiest and we should do it in any case

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