comparison src/bridge/bridge_constructor/bridge_contructor.py @ 588:beaf6bec2fcd

Remove every old-style class.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 18 Jan 2013 17:55:35 +0100
parents 952322b1d490
children 1f160467f5de
comparison
equal deleted inserted replaced
587:952322b1d490 588:beaf6bec2fcd
54 54
55 class ParseError(Exception): 55 class ParseError(Exception):
56 #Used when the signature parsing is going wrong (invalid signature ?) 56 #Used when the signature parsing is going wrong (invalid signature ?)
57 pass 57 pass
58 58
59 class Constructor: 59 class Constructor(object):
60 60
61 def __init__(self, bridge_template, options): 61 def __init__(self, bridge_template, options):
62 self.bridge_template = bridge_template 62 self.bridge_template = bridge_template
63 self.options = options 63 self.options = options
64 64
559 self.finalWrite(self.core_dest, [doc.toprettyxml()]) 559 self.finalWrite(self.core_dest, [doc.toprettyxml()])
560 560
561 class ConstructorError(Exception): 561 class ConstructorError(Exception):
562 pass 562 pass
563 563
564 class ConstructorFactory: 564 class ConstructorFactory(object):
565 def create(self, bridge_template, options): 565 def create(self, bridge_template, options):
566 if options.protocole=='dbus': 566 if options.protocole=='dbus':
567 return DbusConstructor(bridge_template, options) 567 return DbusConstructor(bridge_template, options)
568 elif options.protocole=='mediawiki': 568 elif options.protocole=='mediawiki':
569 return MediawikiConstructor(bridge_template, options) 569 return MediawikiConstructor(bridge_template, options)
570 elif options.protocole=='dbus-xml': 570 elif options.protocole=='dbus-xml':
571 return DbusXmlConstructor(bridge_template, options) 571 return DbusXmlConstructor(bridge_template, options)
572 572
573 raise ConstructorError('Unknown constructor type') 573 raise ConstructorError('Unknown constructor type')
574 574
575 class BridgeConstructor: 575 class BridgeConstructor(object):
576 def __init__(self): 576 def __init__(self):
577 self.options = None 577 self.options = None
578 578
579 def check_options(self): 579 def check_options(self):
580 """Check command line options""" 580 """Check command line options"""