Navigation


Changeset 1464:1404de313b85 in freeDiameter for contrib/tools/csv_to_fd


Ignore:
Timestamp:
Mar 10, 2020, 7:33:41 AM (4 years ago)
Author:
Luke Mewburn <luke@mewburn.net>
Branch:
default
Phase:
public
Message:

csv_to_fd: consistent comparison order

File:
1 edited

Legend:

Unmodified
Added
Removed
  • contrib/tools/csv_to_fd

    r1463 r1464  
    9494    def __init__(self, name, code, section, datatype,
    9595                 must, may, shouldnot, mustnot, encrypt,
    96                  filename=None, linenum=0, standard=None, vendor=0):
     96                 filename='', linenum=0, standard='', vendor=0):
    9797        # Members from CSV row
    9898        self.name = name
     
    224224    def avp(self, avp):
    225225        comment = '{name}, {datatype}, code {code}'.format(**vars(avp))
    226         if '' != avp.section:
     226        if avp.section != '':
    227227            comment += ', section {}'.format(avp.section)
    228228        self.add_comment(comment)
     
    242242        self.add('\t\t};')
    243243        avp_type = 'NULL'
    244         if 'Enumerated' == avp.datatype:
     244        if avp.datatype == 'Enumerated':
    245245            self.add('\t\tstruct dict_object\t*type;')
    246246            vendor_prefix = ''
     
    263263
    264264    def comment(self, comment, filename, linenum):
    265         if '' == comment:
     265        if comment == '':
    266266            self.add('')
    267         elif '=' == comment:
     267        elif comment == '=':
    268268            self.add_header()
    269269        elif comment.startswith(' '):
     
    429429                        if False:
    430430                            pass
    431                         elif 'standard' == parameter:
     431                        elif parameter == 'standard':
    432432                            standard = value
    433                         elif 'vendor' == parameter:
     433                        elif parameter == 'vendor':
    434434                            vendor = int(value)
    435435                        else:
     
    460460
    461461
    462 if '__main__' == __name__:
     462if __name__ == '__main__':
    463463    main()
    464464
Note: See TracChangeset for help on using the changeset viewer.