def load(self, url, headers = {}): url = NSURL.alloc().initWithString_(url) request = NSMutableURLRequest.alloc().initWithURL_(url) for header, value in headers.iteritems(): request.setValue_forHTTPHeaderField_(value, header) self._nsObject.loadRequest_(request)
def refreshView(self): """ Refresh the actual data view for the selected resource. """ if self.selectedResource: self.progress.startAnimation_(self) if self.dataview == self.DATAVIEW_PROPERTIES: self.selectedDetails = self.selectedResource.getAllDetails() self.table.reloadData() self.table.deselectAll_(self) self.text.setString_("") elif self.dataview == self.DATAVIEW_DATA: self.selectedData = self.selectedResource.getDataAsHTML() url = NSURL.alloc().initWithString_(self.serverText.stringValue()) self.webView.mainFrame().loadHTMLString_baseURL_(self.selectedData, url) self.progress.stopAnimation_(self)
def refreshView(self): """ Refresh the actual data view for the selected resource. """ if self.selectedResource: self.progress.startAnimation_(self) if self.dataview == self.DATAVIEW_PROPERTIES: self.selectedDetails = self.selectedResource.getAllDetails() self.table.reloadData() self.table.deselectAll_(self) self.text.setString_("") elif self.dataview == self.DATAVIEW_DATA: self.selectedData = self.selectedResource.getDataAsHTML() url = NSURL.alloc().initWithString_( self.serverText.stringValue()) self.webView.mainFrame().loadHTMLString_baseURL_( self.selectedData, url) self.progress.stopAnimation_(self)