当前位置: 首页>>代码示例>>Python>>正文


Python trans_utils.i18n函数代码示例

本文整理汇总了Python中salts_lib.trans_utils.i18n函数的典型用法代码示例。如果您正苦于以下问题:Python i18n函数的具体用法?Python i18n怎么用?Python i18n使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了i18n函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_settings

 def get_settings(cls):
     settings = super(Shush_Proxy, cls).get_settings()
     name = cls.get_name()
     settings.append(
         '         <setting id="%s-scraper_url" type="text" label="    %s" default="" visible="eq(-4,true)"/>'
         % (name, i18n("scraper_location"))
     )
     settings.append(
         '         <setting id="%s-scraper_password" type="text" label="    %s" option="hidden" default="" visible="eq(-5,true)"/>'
         % (name, i18n("scraper_key"))
     )
     return settings
开发者ID:beljim,项目名称:tknorris-beta-repo,代码行数:12,代码来源:shush_proxy.py

示例2: get_settings

 def get_settings(cls):
     settings = super(Alluc_Scraper, cls).get_settings()
     name = cls.get_name()
     settings.append(
         '         <setting id="%s-username" type="text" label="     %s" default="" visible="eq(-4,true)"/>'
         % (name, i18n("username"))
     )
     settings.append(
         '         <setting id="%s-password" type="text" label="     %s" option="hidden" default="" visible="eq(-5,true)"/>'
         % (name, i18n("password"))
     )
     return settings
开发者ID:edwtjo,项目名称:salts,代码行数:12,代码来源:alluc_scraper.py

示例3: get_settings

 def get_settings(cls):
     settings = super(MyVidLinks_Scraper, cls).get_settings()
     settings = cls._disable_sub_check(settings)
     name = cls.get_name()
     settings.append(
         '         <setting id="%s-filter" type="slider" range="0,180" option="int" label="     %s" default="30" visible="eq(-4,true)"/>'
         % (name, i18n("filter_results_days"))
     )
     settings.append(
         '         <setting id="%s-select" type="enum" label="     %s" lvalues="30636|30637" default="0" visible="eq(-5,true)"/>'
         % (name, i18n("auto_select"))
     )
     return settings
开发者ID:bialagary,项目名称:mw,代码行数:13,代码来源:myvideolinks_scraper.py

示例4: get_settings

 def get_settings(cls):
     settings = super(OroroTV_Scraper, cls).get_settings()
     name = cls.get_name()
     settings.append(
         '         <setting id="%s-username" type="text" label="     %s" default="" visible="eq(-6,true)"/>'
         % (name, i18n("username"))
     )
     settings.append(
         '         <setting id="%s-password" type="text" label="     %s" option="hidden" default="" visible="eq(-7,true)"/>'
         % (name, i18n("password"))
     )
     settings.append(
         '         <setting id="%s-include_premium" type="bool" label="     %s" default="false" visible="eq(-8,true)"/>'
         % (name, i18n("include_premium"))
     )
     return settings
开发者ID:rickardrocks,项目名称:tknorris-beta-repo,代码行数:16,代码来源:ororotv_scraper.py

示例5: get_settings

 def get_settings(cls):
     """
     Returns a list of settings to be used for this scraper. Settings are automatically checked for updates every time scrapers are imported
     The list returned by each scraper is aggregated into a big settings.xml string, and then if it differs from the current settings xml in the Scrapers category
     the existing settings.xml fragment is removed and replaced by the new string
     """
     name = cls.get_name()
     return [
         '         <setting id="%s-enable" type="bool" label="%s %s" default="true" visible="true"/>'
         % (name, name, i18n("enabled")),
         '         <setting id="%s-base_url" type="text" label="    %s" default="%s" visible="eq(-1,true)"/>'
         % (name, i18n("base_url"), cls.base_url),
         '         <setting id="%s-sub_check" type="bool" label="    %s" default="true" visible="eq(-2,true)"/>'
         % (name, i18n("page_existence")),
         '         <setting id="%s_last_results" type="number" default="0" visible="false"/>' % (name),
     ]
开发者ID:bialagary,项目名称:mw,代码行数:16,代码来源:scraper.py

示例6: resolve_link

    def resolve_link(self, link):
        try:
            headers = dict([item.split('=') for item in (link.split('|')[1]).split('&')])
            for key in headers: headers[key] = urllib.unquote(headers[key])
            link = link.split('|')[0]
        except:
            headers = {}

        html = self._http_get(link, headers=headers, cache_limit=.5)
        fragment = dom_parser.parse_dom(html, 'div', {'class': 'player'})
        if fragment:
            iframe_url = dom_parser.parse_dom(fragment[0], 'iframe', ret='src')
            if iframe_url:
                headers = {'Referer': link}
                html = self._http_get(iframe_url[0], headers=headers, cache_limit=.5)
                match = re.search("window\.atob\('([^']+)", html)
                if match:
                    html = base64.decodestring(match.group(1))
                
                streams = []
                for match in re.finditer('<source[^>]+src=["\']([^\'"]+)[^>]+label=[\'"]([^\'"]+)', html):
                    streams.append(match.groups())
                
                if len(streams) > 1:
                    if not self.auto_pick:
                        result = xbmcgui.Dialog().select(i18n('choose_stream'), [e[1] for e in streams])
                        if result > -1:
                            return streams[result][0]
                    else:
                        best_stream = ''
                        best_q = 0
                        for stream in streams:
                            stream_url, label = stream
                            if Q_ORDER[self._height_get_quality(label)] > best_q:
                                best_q = Q_ORDER[self._height_get_quality(label)]
                                best_stream = stream_url
                        
                        if best_stream:
                            return best_stream
                else:
                    return streams[0][0]
开发者ID:edwtjo,项目名称:salts,代码行数:41,代码来源:watchhd_scraper.py

示例7: get_settings

 def get_settings(cls):
     settings = super(RlsBB_Scraper, cls).get_settings()
     settings = cls._disable_sub_check(settings)
     name = cls.get_name()
     settings.append('         <setting id="%s-filter" type="slider" range="0,180" option="int" label="     %s" default="60" visible="eq(-4,true)"/>' % (name, i18n('filter_results_days')))
     settings.append('         <setting id="%s-select" type="enum" label="     %s" lvalues="30636|30637" default="0" visible="eq(-5,true)"/>' % (name, i18n('auto_select')))
     settings.append('         <setting id="%s-include_comments" type="bool" label="     %s" default="false" visible="eq(-6,true)"/>' % (name, i18n('include_comments')))
     return settings
开发者ID:beljim,项目名称:tknorris-beta-repo,代码行数:8,代码来源:rlsbb_scraper.py

示例8: get_settings

 def get_settings(cls):
     name = cls.get_name()
     try:
         import iflix_scraper
         settings = iflix_scraper.Iflix_Scraper.get_settings()
         offset = 5
     except:
         settings = super(IFlix_Proxy, cls).get_settings()
         offset = 4
     settings.append('         <setting id="%s-scraper_url" type="text" label="    %s" default="" visible="eq(-%d,true)"/>' % (name, i18n('scraper_location'), offset))
     settings.append('         <setting id="%s-scraper_password" type="text" label="    %s" option="hidden" default="" visible="eq(-%d,true)"/>' % (name, i18n('scraper_key'), offset + 1))
     return settings
开发者ID:SQL-MisterMagoo,项目名称:salts,代码行数:12,代码来源:iflix_proxy.py

示例9: get_settings

 def get_settings(cls):
     settings = super(WSO_Scraper, cls).get_settings()
     name = cls.get_name()
     settings.append('         <setting id="%s-max_pages" type="slider" range="1,50" option="int" label="     %s" default="1" visible="eq(-6,true)"/>' % (name, i18n('max_pages')))
     return settings
开发者ID:rickardrocks,项目名称:tknorris-beta-repo,代码行数:5,代码来源:wso_scraper.py

示例10: get_settings

 def get_settings(cls):
     settings = super(Furk_Scraper, cls).get_settings()
     settings = cls._disable_sub_check(settings)
     name = cls.get_name()
     settings.append('         <setting id="%s-username" type="text" label="     %s" default="" visible="eq(-4,true)"/>' % (name, i18n('username')))
     settings.append('         <setting id="%s-password" type="text" label="     %s" option="hidden" default="" visible="eq(-5,true)"/>' % (name, i18n('password')))
     settings.append('         <setting id="%s-result_limit" label="     %s" type="slider" default="10" range="10,100" option="int" visible="eq(-6,true)"/>' % (name, i18n('result_limit')))
     return settings
开发者ID:beljim,项目名称:tknorris-beta-repo,代码行数:8,代码来源:furk_scraper.py

示例11: get_settings

 def get_settings(cls):
     settings = super(Iflix_Scraper, cls).get_settings()
     name = cls.get_name()
     settings.append('         <setting id="%s-base_url2" type="text" label="    %s %s" default="%s" visible="eq(-4,true)"/>' % (name, i18n('tv_shows'), i18n('base_url'), cls.tv_base_url))
     return settings
开发者ID:edwtjo,项目名称:salts,代码行数:5,代码来源:iflix_scraper.py

示例12: get_settings

 def get_settings(cls):
     settings = super(WatchHD_Scraper, cls).get_settings()
     name = cls.get_name()
     settings.append('         <setting id="%s-auto_pick" type="bool" label="    %s" default="false" visible="eq(-4,true)"/>' % (name, i18n('auto_pick')))
     return settings
开发者ID:edwtjo,项目名称:salts,代码行数:5,代码来源:watchhd_scraper.py

示例13: get_settings

 def get_settings(cls):
     settings = super(IStreamHD_Scraper, cls).get_settings()
     name = cls.get_name()
     settings.append('         <setting id="%s-username" type="text" label="     %s" default="" visible="eq(-6,true)"/>' % (name, i18n('username')))
     settings.append('         <setting id="%s-password" type="text" label="     %s" option="hidden" default="" visible="eq(-7,true)"/>' % (name, i18n('password')))
     return settings
开发者ID:Oggie101,项目名称:tknorris-beta-repo,代码行数:6,代码来源:istreamhd_scraper.py

示例14: get_settings

 def get_settings(cls):
     settings = super(EasyNews_Scraper, cls).get_settings()
     settings = cls._disable_sub_check(settings)
     name = cls.get_name()
     settings.append('         <setting id="%s-username" type="text" label="     %s" default="" visible="eq(-4,true)"/>' % (name, i18n('username')))
     settings.append('         <setting id="%s-password" type="text" label="     %s" option="hidden" default="" visible="eq(-5,true)"/>' % (name, i18n('password')))
     return settings
开发者ID:bialagary,项目名称:mw,代码行数:7,代码来源:easynews_scraper.py

示例15: get_settings

 def get_settings(cls):
     settings = super(NoobRoom_Scraper, cls).get_settings()
     name = cls.get_name()
     settings.append('         <setting id="%s-username" type="text" label="     %s" default="" visible="eq(-4,true)"/>' % (name, i18n('username')))
     settings.append('         <setting id="%s-password" type="text" label="     %s" option="hidden" default="" visible="eq(-5,true)"/>' % (name, i18n('password')))
     settings.append('         <setting id="%s-include_premium" type="bool" label="     %s" default="false" visible="eq(-6,true)"/>' % (name, i18n('include_premium')))
     return settings
开发者ID:sfennell,项目名称:salts,代码行数:7,代码来源:noobroom_scraper.py


注:本文中的salts_lib.trans_utils.i18n函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。