Пример #1
0
def cdn_path(name):
    """
  @param  name  str  id
  @return  unicode
  @throw  KeyError  when unknown name
  """
    return config.CDN[name].replace('$PWD', config.root_abspath())
Пример #2
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())
Пример #3
0
def cdn_url(key):
    """
  @param  key  str
  @return  unicode  url
  """
    url = config.CDN[key]
    if '$PWD' in url:
        return 'file:///' + url.replace('$PWD', config.root_abspath())
    else:
        return cacheman.cache_url(url)
Пример #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)).replace('$PWD',
                                                     config.root_abspath())
Пример #5
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
Пример #6
0
        def __init__(self, parent=None):
            super(Window, self).__init__(parent)
            self.setWindowIcon(rc.icon('logo-youtube'))

            appName = QtWidgets.QApplication.instance().applicationName()
            self.setWindowTitle("%s (pre-alpha)" % appName)

            self.setStyleSheet(''.join(imap(rc.qss, (
                'bootstrap',
                'share',
            ))).replace('$PWD', config.root_abspath()))

            dprint("pass")
Пример #7
0
def cdn_url(name):
    url = config.CDN[name]
    if '$PWD' in url:
        return 'file:///' + url.replace('$PWD', config.root_abspath())
    else:
        return cacheman.cache_url(url)