PabloCastellano / libcnml

libcnml is a CNML parser library for Python
GNU General Public License v3.0
4 stars 5 forks source link

Attribute zone_nodes is a sum of nodes in subzones too #10

Open PabloCastellano opened 9 years ago

PabloCastellano commented 9 years ago

Seen in https://github.com/emmdim/guifinetstudio/commit/0d6fc24e28f02093ce4a8859d2fdc3b9f6c422e5#diff-c07a5c9f693247996909462a19cf4387R131

+#     Manos: Pablo is wrong in this one, because the attribute total of the CNML contains also
+#     information from the subzones. Thus len(nodes) is not the same as CNML attirbute zone_nodes 
emmdim commented 9 years ago

I was wrong in this one. The only actual problem with len(nodes) is that it cannot be used directly as CNMLZone attribute, and can only be added after all parsing is done. If you still think it is a useful attribute I can make the commit.

Another issue though that rises here is that in some cases you prefer to calculate values that already exist in the cnml. This is a personal choice I guess but since the values exist in the CNML they should be used, in my opinion. Any extra information should be added in other structures. For example see the CNMLWrapper and GuifiZone in: https://github.com/emmdim/guifinetstudio/blob/master/test.py