def isWriteable(self, uri): self._logger.debug("check if %s is editable") (proto, path) = Tools.splitURI(uri) if not proto in self._protocol_handler.keys(): raise Exception("Unknonw protocol %S"%proto) self._protocol_handler[proto].isURIEditable(uri)
def __init__(self, parent, ID): wx.Dialog.__init__(self,parent, ID, title="Save file in") model = eDevModel() box = wx.BoxSizer(wx.VERTICAL) txt = wx.StaticText(self, -1, "Save file as:") box.Add(txt, 0, wx.LEFT|wx.TOP|wx.RIGHT, 3) archives = model.openURI("zip://") for i in range(len(archives)): (proto, archives[i]) = Tools.splitURI(archives[i]) if len(archives) > 0: archive = archives[0] self.combo = wx.ComboBox(self, -1, choices=archives) self.combo.SetValue(archive) box.Add(self.combo, 0, wx.GROW|wx.ALL, 3) self.entry = wx.TextCtrl(self, -1) box.Add(self.entry, 0, wx.GROW|wx.ALL, 3) line = wx.StaticLine(self,-1, style=wx.LI_HORIZONTAL) box.Add(line,0, wx.GROW|wx.ALL, 3) btnbox = wx.StdDialogButtonSizer() ok_btn = wx.Button(self, wx.ID_OK) btnbox.AddButton(ok_btn) c_btn = wx.Button(self, wx.ID_CANCEL) btnbox.AddButton(c_btn) btnbox.Realize() box.Add(btnbox, 0, wx.GROW|wx.ALL, 5) self.SetSizer(box) box.Fit(self)
def deleteURI(self, uri): self._logger.debug("delete %s"%uri) (proto, path) = Tools.splitURI(uri) if not proto in self._protocol_handler.keys(): raise Exception("Unknonw protocol %S"%proto) self._protocol_handler[proto].deleteURI(uri)
def checkURI(self, uri): self._logger.debug("checks if %s exists"%uri) (proto, path) = Tools.splitURI(uri) if not proto in self._protocol_handler.keys(): raise Exception("Unknown protocol %s"%proto) return self._protocol_handler[proto].checkURI(uri)
def saveURI(self, uri, txt): self._logger.debug("Save %s"%uri) (proto, path) = Tools.splitURI(uri) if not proto in self._protocol_handler.keys(): raise Exception("Unknown protocol %s"%proto) self._protocol_handler[proto].saveURI(uri, txt)
def openURI(self, uri): self._logger.debug("Open URI: %s"%uri) (proto, path) = Tools.splitURI(uri) if not proto in self._protocol_handler.keys(): raise Exception("Unkonwn protocol: %s"%proto) return self._protocol_handler[proto].openURI(uri)
def openURI(self, uri): (proto, path) = Tools.splitURI(uri) if not proto in self._editors.keys(): raise Exception("Unknown protocol %s"%proto) page = self._editors[proto](self, -1, uri) title = page.getTitle() self.AddPage(page, title, True) self.Bind(Events.EVT_PAGE_MODIFIED, self._onPageModified, page) self._emmitChanged(page)
def DocumentOpen(self, uri): (proto, path) = Tools.splitURI(uri) if self._d_notebook.hasPageURI( uri ): self._d_notebook.selectPageByURI( uri ) return try: self._d_notebook.openURI(uri) self._d_main_frame.bindClose(self.OnDocumentClose) except: showExceptionDialog(self._d_notebook, -1, "Unable to open document %s"%uri)