Ejemplo n.º 1
0
class RedfootController(NibClassBuilder.AutoBaseClass):
    # the actual base class is NSObject
    # The following outlets are added to the class:
    # command
    # console

    def init(self):
        super(RedfootController, self).init()

        self.output = stdout
        worker = OutputThread(self)
        worker.start()

	self.loader = BootLoader()    
        options, args = parser.parse_args(args="".split())
	self.loader.open(options.path)
	self.loader.main(options, args)
	self.redfoot = self.loader.redfoot
        self.redfoot.controller = self	
        return self

    def applicationWillTerminate_(self, aNotification):
	logging.info("closing store")
	self.redfoot.close()

    def runCommand_(self, sender):
        cmd = sender.stringValue()
        if not sender.objectValues().containsObject_(cmd):
	    sender.addItemWithObjectValue_(cmd)
        self.output.write("\nCommand: %s\n" % cmd)
        t = CommandThread(self, cmd)
        t.start()
        
    def tabView_shouldSelectTabViewItem_(self, tabView, tabViewItem):
	print tabView, tabViewItem, tabViewItem.view()
	return True
	
    def tabView_willSelectTabViewItem_(self, tabView, tabViewItem):
	pass #print tabViewItem.view().label.stringValue()

    def tabView_didSelectTabViewItem_(self, tabView, tabViewItem):
	pass
	
    def tabViewDidChangeNumberOfTabViewItems_(self, tabView):
	pass
Ejemplo n.º 2
0
    def init(self):
        super(RedfootController, self).init()

        self.output = stdout
        worker = OutputThread(self)
        worker.start()

	self.loader = BootLoader()    
        options, args = parser.parse_args(args="".split())
	self.loader.open(options.path)
	self.loader.main(options, args)
	self.redfoot = self.loader.redfoot
        self.redfoot.controller = self	
        return self