def qss(name): """ @param name str id @return unicode @throw KeyError when unknown name """ from sakurakit import skfileio return skfileio.readfile(qss_path(name))
def loadClosedUrls(self): data = skfileio.readfile(rc.CLOSE_HISTORY_LOCATION) if data: #self.closedUrls = data.split('\n') self.closedUrls = [ it for it in data.split('\n') if it and len(it) < defs.MAX_HISTORY_URL_SIZE ] dprint("pass")
def qss(name): """ @param name str id @return unicode @throw KeyError when unknown name """ from sakurakit import skfileio return skfileio.readfile(qss_path(name)).replace('$PWD', config.root_abspath())
def qss(name): """ @param name unicode id @return unicode qss file content @throw KeyError when unknown name The return string is not cached. """ #return cssmin(skfileio.readfile(qss_path(name))) return skfileio.readfile(qss_path(name))
def loadVisitedUrls(self): data = skfileio.readfile(rc.VISIT_HISTORY_LOCATION) if data: #self.visitedUrls = data.split('\n') self.visitedUrls = [ it for it in data.split('\n') if it and len(it) < defs.MAX_HISTORY_URL_SIZE ] for url in reversed(self.visitedUrls): icon = rc.url_icon(url) self.addressEdit.addItem(icon, url) dprint("pass")
def cdn_data(name): """ @param name str id @return unicode @throw KeyError when unknown name """ ret = CDN_DATA.get(name) if not ret: from sakurakit import skfileio ret = CDN_DATA[name] = skfileio.readfile(cdn_path(name)).replace( '$PWD', config.root_abspath()) return ret
def loadTabs(self): # -> bool ret = False data = skfileio.readfile(rc.TABS_LOCATION) if data: #urls = data.split('\n') urls = [ it for it in data.split('\n') if it and len(it) < defs.MAX_HISTORY_URL_SIZE ] for url in urls: self.openUnknownAfterCurrent(url) ret = True dprint("pass: ret = %s" % ret) return ret