Beispiel #1
0
def qss(name):
    """
  @param  name  str  id
  @return  unicode
  @throw  KeyError  when unknown name
  """
    from sakurakit import skfileio
    return skfileio.readfile(qss_path(name))
Beispiel #2
0
 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")
Beispiel #3
0
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())
Beispiel #4
0
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))
Beispiel #5
0
 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")
Beispiel #6
0
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
Beispiel #7
0
 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