Changeset 1494:ae76ea63ee12 in freeDiameter for contrib/tools/csv_to_fd
- Timestamp:
- Mar 30, 2020, 2:46:31 PM (4 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/tools/csv_to_fd
r1487 r1494 11 11 AVP Name. String, validated as ALPHA *(ALPHA / DIGIT / "-") 12 12 per RFC 6733 section 3.2. 13 May start with a DIGIT (e.g., "3GPP-IMSI"). 13 14 - Code: 14 15 AVP Code. Integer, 0..4294967295. … … 21 22 - RFC 7155 section 4.1 22 23 - Must, May, ShouldNot, MustNot: 23 Flags, possibly comma or space separated: M, V24 Flags, possibly comma or space separated: M, P, V 24 25 25 26 - Comment row. First cell: … … 183 184 184 185 class Processor(object): 185 """Interface for processor of Avp """186 """Interface for processor of Avp.""" 186 187 187 188 __metaclass__ = abc.ABCMeta … … 227 228 228 229 class DebugProcessor(Processor): 229 """Display the CSV parsing """230 """Display the CSV parsing.""" 230 231 231 232 def next_file(self, filename): … … 244 245 245 246 class NoopProcessor(Processor): 246 """Validate the CSV; no other output """247 """Validate the CSV; no other output.""" 247 248 248 249 def next_file(self, filename): … … 260 261 261 262 class FdcProcessor(Processor): 262 """Generate freeDiameter C code 263 """Generate freeDiameter C code. 263 264 264 265 Comment cells are parsed as: … … 375 376 376 377 class JsonProcessor(Processor): 377 """Generate freeDiameter JSON object 378 """Generate freeDiameter JSON object. 378 379 """ 379 380 … … 461 462 # Parse options 462 463 parser = MyParser( 464 usage='%prog [-h] [-p PROCESSOR] FILE ...', 463 465 description="""\ 464 Convert CSV files containing RADIUS or Diameter AVP tables466 Convert CSV files FILE ... containing RADIUS or Diameter AVP tables 465 467 into various formats using the specified processor PROCESSOR. 466 468 """) … … 473 475 (opts, args) = parser.parse_args() 474 476 if len(args) < 1: 475 parser.error('Incorrect number of arguments ')477 parser.error('Incorrect number of arguments. Use -h for help.') 476 478 477 479 # Find processor … … 479 481 avpproc = processors[opts.processor]() 480 482 except KeyError as e: 481 parser.error('Unknown processor "{}" '.format(opts.processor))483 parser.error('Unknown processor "{}".'.format(opts.processor)) 482 484 483 485 # dict of [vendor][code] : Avp
Note: See TracChangeset
for help on using the changeset viewer.