3 Dependency Injection ToDo

Run Settings
LanguagePython
Language Version
Run Command
class AbstractProcessor() : def __init__(self,data) : self.data = data def run(self) : pass class Runner() : def __init__(self,processor) : self.processor = processor def process(self) : if self.processor : self.processor.run() def main(argv) : try : runner = None if len(argv) > 1 : if argv[0] == 'msg' : # says 'the message is : <message>' runner = Runner(MsgProcessor(argv[1])) elif argv[0] == 'ask' : # says 'the question is : <question>' runner = Runner(AskProcessor(argv[1])) runner.process() except Exception as e : print('main: exception occurred ' + str(e)) if __name__ == '__main__' : try : argv = [] argv.append('ask') argv.append('is this a question') main(argv) except (SystemExit,KeyboardInterrup) : pass
Editor Settings
Theme
Key bindings
Full width
Lines