Loading

Paste #pvxjvmygu

  1. diff -r ca32821c5fe9 nml/actions/action0.py
  2. --- a/nml/actions/action0.py    Sat Nov 14 11:35:12 2015 +0100
  3. +++ b/nml/actions/action0.py    Fri Dec 11 19:09:38 2015 +0100
  4. @@ -969,15 +969,16 @@
  5.  def parse_sort_block(feature, vehid_list):
  6.      prop_num = [0x1A, 0x20, 0x1B, 0x1B]
  7.      action_list = []
  8. -    last = vehid_list[0]
  9. -    idx = len(vehid_list) - 1
  10. -    while idx >= 0:
  11. -        cur = vehid_list[idx]
  12. -        prop = Action0Property(prop_num[feature], [last], 3)
  13. -        action_list.append(Action0(feature, cur.value))
  14. -        action_list[-1].prop_list.append(prop)
  15. -        last = cur
  16. -        idx -= 1
  17. +    if len(vehid_list) > 0:
  18. +        last = vehid_list[0]
  19. +        idx = len(vehid_list) - 1
  20. +        while idx >= 0:
  21. +            cur = vehid_list[idx]
  22. +            prop = Action0Property(prop_num[feature], [last], 3)
  23. +            action_list.append(Action0(feature, cur.value))
  24. +            action_list[-1].prop_list.append(prop)
  25. +            last = cur
  26. +            idx -= 1
  27.      return action_list
  28.  
  29.  callback_flag_properties = {
  30.  

Comments