
import objc
import _uicaboodle
from objc import YES, NO, NULL, nil
objc.loadBundle(&#039;UIKit&#039;, globals(), &#039;/System/Library/Frameworks/UIKit.framework&#039;)
UIApplication = objc.lookUpClass(&#039;UIApplication&#039;)
UITable = objc.lookUpClass(&#039;UITable&#039;)
UIWindow = objc.lookUpClass(&#039;UIWindow&#039;)
UIHardware = objc.lookUpClass(&#039;UIHardware&#039;)
UIView = objc.lookUpClass(&#039;UIView&#039;)
UINavigationBar = objc.lookUpClass(&#039;UINavigationBar&#039;)
UINavigationItem = objc.lookUpClass(&#039;UINavigationItem&#039;)
UIPreferencesTable = objc.lookUpClass(&#039;UIPreferencesTable&#039;)
UIPreferencesTextTableCell = objc.lookUpClass(&#039;UIPreferencesTextTableCell&#039;)
UIPreferencesTableCell = objc.lookUpClass(&#039;UIPreferencesTableCell&#039;)
UISectionList = objc.lookUpClass(&quot;UISectionList&quot;)
UIImageAndTextTableCell = objc.lookUpClass(&quot;UIImageAndTextTableCell&quot;)

class PYApplication(UIApplication):
    def applicationDidFinishLaunching_(self, unused):
        frame = UIHardware.fullScreenApplicationContentRect()

        self.window = UIWindow.alloc().initWithFrame_(frame)

        self.view = UIView.alloc().initWithFrame_(self.window.bounds())
        self.window.setContentView_(self.view)

        self.window.orderFront_(self)
        self.window.makeKey_(self)
        self.window._setHidden_(NO)

        navsize = UINavigationBar.defaultSize()
        navrect = ((0, 0), navsize)

        self.navbar = UINavigationBar.alloc().initWithFrame_(navrect)
        self.view.addSubview_(self.navbar)

        self.navbar.setBarStyle_(1)
        self.navbar.setDelegate_(self)

        navitem = UINavigationItem.alloc().initWithTitle_(u&quot;Network Information&quot;)
        self.navbar.pushNavigationItem_(navitem)

        bounds = self.view.bounds()
        tblrect = ((0, navsize[1]), (bounds[1][0], bounds[1][1] - navsize[1]))

        self.secList = UISectionList.alloc().initWithFrame_(tblrect)
        self.secList.setDataSource_(self)
        self.secList.reloadData()
        
        col = UITableColumn.alloc().initWithTitle_identifier_width_(u&quot;Name&quot;, u&quot;name&quot;, 320.0)
        table = self.secList.table()
        table.setSeparatorStyle_(1)
        table.addTableColumn_(col)
        
        self.view.addSubview_(self.secList)
    
    @objc.signature(&quot;I@:@&quot;)
    def numberOfSectionsInSectionList_(self, sectionList):
        print u&quot;numberOfSectionsInSectionList_&quot;, sectionList
        return 1
    
    @objc.signature(&quot;@@:@I&quot;)
    def sectionList_titleForSection_(self, sectionList, section):
        print u&quot;sectionList_titleForSection_&quot;, sectionList, section
        return u&quot;Title&quot;
    
    @objc.signature(&quot;I@:@I&quot;)
    def sectionList_rowForSection_(self, sectionList, section):
        print u&quot;sectionList_rowForSection_&quot;, sectionList, section
        return 0
    
    @objc.signature(&quot;I@:@&quot;)    
    def numberOfRowsInTable_(self, table):
        print u&quot;numberOfRowsInTable_&quot;, table
        return 3
    
    @objc.signature(&quot;@@:@I@&quot;)
    def table_cellForRow_column_(self, table, row, column):
        print u&quot;table_cellForRow_column_&quot;, table, row, column
        cell = UIImageAndTextTableCell.alloc().init()
        cell.setTitle_(u&quot;Test &quot; + unicode(row))
        return cell
    
    
    def respondsToSelector_(self, selector):
        responds = dir(self).count(selector.replace(&quot;:&quot;, &quot;_&quot;)) &gt; 0
        if not responds:
            print selector
        return responds

_uicaboodle.UIApplicationMain([&#039;NetInfo&#039;], PYApplication)

