def testGetPathFromURI(self): """Test getting a real file path from a file:// uri""" if ISWINDOWS: path = ebmlib.GetPathFromURI(u"file://C:/Users/test/test.txt") self.assertEquals(path, u"C:\\Users\\test\\test.txt") else: path = ebmlib.GetPathFromURI(u"file://Users/test/test.txt") self.assertEquals(path, u"/Users/test/test.txt") path = ebmlib.GetPathFromURI(u"/Users/test") self.assertEquals(path, u"/Users/test")
def testGetPathFromURI(self): """Test getting a real file path from a file:// uri""" if platform.system().lower() in ('windows', 'microsoft'): path = ebmlib.GetPathFromURI(u"file://C:/Users/test/test.txt") self.assertEquals(path, u"C:\\Users\\test\\test.txt") else: path = ebmlib.GetPathFromURI(u"file://Users/test/test.txt") self.assertEquals(path, u"/Users/test/test.txt") path = ebmlib.GetPathFromURI(u"/Users/test") self.assertEquals(path, u"/Users/test")
def EditCommand(self, cmd): """Perform an edit related command @param cmd: command string to execute """ # e fname: edit file cmd = cmd[1:].strip() frame = self.GetTopLevelParent() cmd = ebmlib.GetPathFromURI(cmd) if not os.path.isabs(cmd): cmd = os.path.join(self._curdir, cmd) if ebmlib.PathExists(cmd): frame.DoOpen(ed_glob.ID_COMMAND_LINE_OPEN, cmd) else: frame.nb.OpenPage(ebmlib.GetPathName(cmd), ebmlib.GetFileName(cmd))