• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python common.i18n函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __auth_ip

 def __auth_ip(self, media_id):
     header = i18n('flashx_auth_header')
     line1 = i18n('auth_required')
     line2 = i18n('visit_link')
     line3 = i18n('click_pair') % 'http://flashx.tv/pair'
     with common.kodi.CountdownDialog(header, line1, line2, line3, countdown=120) as cd:
         return cd.start(self.__check_auth, [media_id])
开发者ID:marfegte,项目名称:repositorio-marfegte,代码行数:7,代码来源:flashx.py


示例2: __auth_ip

 def __auth_ip(self, media_id):
     header = i18n('vevio_auth_header')
     line1 = i18n('auth_required')
     line2 = i18n('visit_link')
     line3 = i18n('click_pair') % 'https://vev.io/pair'
     with common.kodi.CountdownDialog(header, line1, line2, line3) as cd:
         return cd.start(self.__check_auth, [media_id])
开发者ID:azzy9,项目名称:script.module.urlresolver,代码行数:7,代码来源:vevio.py


示例3: __auth_ip

 def __auth_ip(self, media_id):
     header = i18n('stream_auth_header')
     line1 = i18n('auth_required')
     line2 = i18n('visit_link')
     line3 = i18n('click_pair') % ('http://api.streamin.to/pair')
     with common.kodi.CountdownDialog(header, line1, line2, line3) as cd:
         return cd.start(self.__check_auth, [media_id])
开发者ID:Barefootedsoul,项目名称:script.module.urlresolver,代码行数:7,代码来源:streaminto.py


示例4: __auth_ip

 def __auth_ip(self, media_id):
     js_data = self.__get_json(INFO_URL)
     pair_url = js_data.get('result', {}).get('auth_url', '')
     if pair_url:
         pair_url = pair_url.replace('\/', '/')
         header = i18n('ol_auth_header')
         line1 = i18n('auth_required')
         line2 = i18n('visit_link')
         line3 = i18n('click_pair').decode('utf-8') % (pair_url)
         with common.kodi.CountdownDialog(header, line1, line2, line3) as cd:
             return cd.start(self.__check_auth, [media_id])
开发者ID:amadu80,项目名称:repository.xvbmc,代码行数:11,代码来源:openload.py


示例5: get_settings_xml

 def get_settings_xml(cls):
     xml = super(cls, cls).get_settings_xml()
     # xml.append('<setting id="%s_autopick" type="bool" label="%s" default="false"/>' % (
     #    cls.__name__, i18n('auto_primary_link')))
     xml.append(
         '<setting id="%s_auth" type="action" label="%s" action="RunPlugin(plugin://script.module.urlresolver/?mode=auth_ad)"/>' % (
             cls.__name__, i18n('auth_my_account')))
     xml.append(
         '<setting id="%s_reset" type="action" label="%s" action="RunPlugin(plugin://script.module.urlresolver/?mode=reset_ad)"/>' % (
             cls.__name__, i18n('reset_my_auth')))
     xml.append('<setting id="%s_token" visible="false" type="text" default=""/>' % cls.__name__)
     return xml
开发者ID:azzy9,项目名称:script.module.urlresolver,代码行数:12,代码来源:alldebrid.py


示例6: _auto_update

 def _auto_update(self, py_source, py_path, key=''):
     try:
         if self.get_setting('auto_update') == 'true' and py_source:
             headers = self.net.http_HEAD(py_source).get_headers(as_dict=True)
             common.logger.log(headers)
             old_etag = self.get_setting('etag')
             new_etag = headers.get('Etag', '')
             old_len = common.file_length(py_path, key)
             new_len = int(headers.get('Content-Length', 0))
             py_name = os.path.basename(py_path)
             
             if old_etag != new_etag or old_len != new_len:
                 common.logger.log('Updating %s: |%s|%s|%s|%s|' % (py_name, old_etag, new_etag, old_len, new_len))
                 self.set_setting('etag', new_etag)
                 new_py = self.net.http_GET(py_source).content
                 if new_py:
                     if key:
                         new_py = common.decrypt_py(new_py, key)
                         
                     if new_py and 'import' in new_py:
                         with open(py_path, 'w') as f:
                             f.write(new_py.encode('utf-8'))
                         common.kodi.notify('%s %s' % (self.name, common.i18n('resolver_updated')))
             else:
                 common.logger.log('Reusing existing %s: |%s|%s|%s|%s|' % (py_name, old_etag, new_etag, old_len, new_len))
             common.log_file_hash(py_path)
     except Exception as e:
         common.logger.log_warning('Exception during %s Auto-Update code retrieve: %s' % (self.name, e))
开发者ID:azzy9,项目名称:script.module.urlresolver,代码行数:28,代码来源:resolver.py


示例7: pick_source

def pick_source(sources, auto_pick=None):
    if auto_pick is None:
        auto_pick = common.get_setting('auto_pick') == 'true'
        
    if len(sources) == 1:
        return sources[0][1]
    elif len(sources) > 1:
        if auto_pick:
            return sources[0][1]
        else:
            result = xbmcgui.Dialog().select(common.i18n('choose_the_link'), [str(source[0]) if source[0] else 'Unknown' for source in sources])
            if result == -1:
                raise ResolverError(common.i18n('no_link_selected'))
            else:
                return sources[result][1]
    else:
        raise ResolverError(common.i18n('no_video_link'))
开发者ID:azzy9,项目名称:script.module.urlresolver,代码行数:17,代码来源:helpers.py


示例8: get_media_url

    def get_media_url(self, host, media_id):
        result = self.__check_auth(media_id)
        if not result:
            result = self.__auth_ip(media_id)

        if result:
            return helpers.get_media_url(result, patterns=['''src:\s*["'](?P<url>[^"']+).+?res:\s*(?P<label>\d+)'''], result_blacklist=["trailer"], generic_patterns=False).replace(' ', '%20')

        raise ResolverError(i18n('no_ip_authorization'))
开发者ID:marfegte,项目名称:repositorio-marfegte,代码行数:9,代码来源:flashx.py


示例9: get_media_url

    def get_media_url(self, host, media_id):
        result = self.__check_auth(media_id)
        if not result:
            result = self.__auth_ip(media_id)

        if result:
            return helpers.pick_source(result.items()) + helpers.append_headers(self.headers)

        raise ResolverError(i18n('no_ip_authorization'))
开发者ID:Barefootedsoul,项目名称:script.module.urlresolver,代码行数:9,代码来源:vshareeu.py


示例10: get_media_url

    def get_media_url(self, host, media_id):
        try:
            if not self.__file_exists(media_id):
                raise ResolverError('File Not Available')

            video_url = self.__check_auth(media_id)
            if not video_url:
                video_url = self.__auth_ip(media_id)
        except ResolverError:
            raise

        if video_url:
            headers = {'User-Agent': common.RAND_UA}
            video_url = video_url + helpers.append_headers(headers)
            return video_url
        else:
            raise ResolverError(i18n('no_ol_auth'))
开发者ID:amadu80,项目名称:repository.xvbmc,代码行数:17,代码来源:openload.py


示例11: get_media_url

 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'Referer': web_url}
     headers.update(self.headers)
     html = self.net.http_GET(web_url, headers=headers).content
     sources = helpers.scrape_sources(html, patterns=["""file:\s*["'](?P<url>[^"']+)"""])
     if sources:
         auth = self.__check_auth(media_id)
         if not auth:
             auth = self.__auth_ip(media_id)
             
         if auth:
             return helpers.pick_source(sources) + helpers.append_headers(headers)
         else:
             raise ResolverError(i18n('no_ip_authorization'))
     else:
         raise ResolverError('Unable to locate links')
开发者ID:Barefootedsoul,项目名称:script.module.urlresolver,代码行数:17,代码来源:streaminto.py


示例12: get_media_url

    def get_media_url(self, host, media_id):
        url = helpers.get_media_url(self.get_url(host, media_id), result_blacklist=['intro_black']).replace(' ', '%20')
        net = common.Net()
        headers = {}

        if '|' in url:
            qs_header_split = url.split('|')
            url = qs_header_split[0]

            headers = urlparse.parse_qs(qs_header_split[1])
            headers = dict((k, v[0]) for k, v in headers.iteritems())

        response = net.http_HEAD(url, headers=headers)
        if(response.get_url()):
            return response.get_url() + helpers.append_headers(headers)
        else:
            raise ResolverError(common.i18n('no_video_link'))
开发者ID:Barefootedsoul,项目名称:script.module.urlresolver,代码行数:17,代码来源:vidzella.py


示例13: get_media_url

 def get_media_url(self, host, media_id):
     try:
         self._auto_update(self.get_setting('url'), OL_PATH, self.get_setting('key'))
         reload(ol_gmu)
         return ol_gmu.get_media_url(self.get_url(host, media_id))  # @UndefinedVariable
     except Exception as e:
         logger.log_debug('Exception during openload resolve parse: %s' % (e))
         try:
             if not self.__file_exists(media_id):
                 raise ResolverError('File Not Available')
             
             video_url = self.__check_auth(media_id)
             if not video_url:
                 video_url = self.__auth_ip(media_id)
         except ResolverError:
             raise
         
         if video_url:
             return video_url
         else:
             raise ResolverError(i18n('no_ol_auth'))
开发者ID:azumimuo,项目名称:family-xbmc-addon,代码行数:21,代码来源:openload.py


示例14: get_settings_xml

 def get_settings_xml(cls):
     xml = super(cls, cls).get_settings_xml()
     xml.append('<setting id="%s_client_id" type="text" label="%s" default="%s"/>' % (cls.__name__, i18n('client_id'), 'am6l6dn0x3bxrdgc557p1qeg1ma3bto'))
     return xml
开发者ID:Barefootedsoul,项目名称:script.module.urlresolver,代码行数:4,代码来源:twitchtv.py


示例15: get_settings_xml

    def get_settings_xml(cls, include_login=True):
        """
        This method should return XML which describes the settings you would
        like for your plugin. You should make sure that the ``id`` starts
        with your plugins class name (which can be found using
        :attr:`cls.__name__`) followed by an underscore.

        Override this method if you want your plugin to have more settings than
        just 'priority'. If you do and still want the defaults settings you
        should call this method from the base class first.

        Returns:
            A list containing XML elements that will be valid in settings.xml
        """
        xml = [
            '<setting id="%s_priority" type="number" label="%s" default="100"/>' % (cls.__name__, common.i18n('priority')),
            '<setting id="%s_enabled" ''type="bool" label="%s" default="true"/>' % (cls.__name__, common.i18n('enabled'))
        ]
        if include_login:
            xml.append('<setting id="%s_login" ''type="bool" label="%s" default="true" visible="false"/>' % (cls.__name__, common.i18n('login')))
        return xml
开发者ID:azzy9,项目名称:script.module.urlresolver,代码行数:21,代码来源:resolver.py


示例16: get_settings_xml

 def get_settings_xml(cls):
     xml = super(cls, cls).get_settings_xml(include_login=False)
     xml.append('<setting id="%s_torrents" type="bool" label="%s" default="true"/>' % (cls.__name__, i18n('torrents')))
     xml.append('<setting id="%s_login" type="bool" label="%s" default="false"/>' % (cls.__name__, i18n('login')))
     xml.append('<setting id="%s_password" enable="eq(-1,true)" type="text" label="%s" option="hidden" default=""/>' % (cls.__name__, i18n('api_key')))
     return xml
开发者ID:koditr,项目名称:xbmc-tr-team-turkish-addons,代码行数:6,代码来源:premiumize_me.py


示例17: get_settings_xml

 def get_settings_xml(cls):
     xml = super(cls, cls).get_settings_xml(include_login=False)
     xml.append('<setting id="%s_login" type="bool" label="%s" default="false"/>' % (cls.__name__, i18n('login')))
     xml.append('<setting id="%s_username" enable="eq(-1,true)" type="text" label="%s" default=""/>' % (cls.__name__, i18n('username')))
     xml.append('<setting id="%s_password" enable="eq(-2,true)" type="text" label="%s" option="hidden" default=""/>' % (cls.__name__, i18n('password')))
     xml.append('<setting id="%s_ts_offset" type="number" visible="false" enable="false" default="0"/>' % (cls.__name__))
     xml.append('<setting id="%s_token" type="text" visible="false" enable="false"/>' % (cls.__name__))
     xml.append('<setting id="%s_key" type="text" visible="false" enable="false"/>' % (cls.__name__))
     return xml
开发者ID:Barefootedsoul,项目名称:script.module.urlresolver,代码行数:9,代码来源:debrid_link.py


示例18: get_settings_xml

 def get_settings_xml(cls):
     xml = super(cls, cls).get_settings_xml(include_login=False)
     xml.append('<setting id="%s_use_https" type="bool" label="%s" default="true"/>' % (cls.__name__, i18n('use_https')))
     xml.append('<setting id="%s_login" type="bool" label="%s" default="false"/>' % (cls.__name__, i18n('login')))
     xml.append('<setting id="%s_username" enable="eq(-1,true)" type="text" label="%s" default=""/>' % (cls.__name__, i18n('customer_id')))
     xml.append('<setting id="%s_password" enable="eq(-2,true)" type="text" label="%s" option="hidden" default=""/>' % (cls.__name__, i18n('pin')))
     return xml
开发者ID:amadu80,项目名称:repository.xvbmc,代码行数:7,代码来源:premiumize_me.py


示例19: get_settings_xml

 def get_settings_xml(cls):
     xml = super(cls, cls).get_settings_xml()
     xml.append('<setting id="%s_auto_update" type="bool" label="%s" default="true"/>' % (cls.__name__, i18n('auto_update')))
     xml.append('<setting id="%s_url" type="text" label="    %s" default="" visible="eq(-1,true)"/>' % (cls.__name__, i18n('update_url')))
     xml.append('<setting id="%s_key" type="text" label="    %s" default="" option="hidden" visible="eq(-2,true)"/>' % (cls.__name__, i18n('decrypt_key')))
     xml.append('<setting id="%s_etag" type="text" default="" visible="false"/>' % (cls.__name__))
     return xml
开发者ID:amadu80,项目名称:repository.xvbmc,代码行数:7,代码来源:openload.py


示例20: get_settings_xml

 def get_settings_xml(cls):
     xml = super(cls, cls).get_settings_xml(include_login=False)
     xml.append('<setting id="%s_login" type="bool" label="%s" default="false"/>' % (cls.__name__, i18n('login')))
     xml.append('<setting id="%s_username" enable="eq(-1,true)" type="text" label="%s" default=""/>' % (cls.__name__, i18n('username')))
     xml.append('<setting id="%s_password" enable="eq(-2,true)" type="text" label="%s" option="hidden" default=""/>' % (cls.__name__, i18n('password')))
     xml.append('<setting id="%s_premium" enable="eq(-3,true)" type="bool" label="Premium Account" default="false"/>' % (cls.__name__))
     xml.append('<setting id="%s_session_id" visible="false" type="text" default=""/>' % (cls.__name__))
     return xml
开发者ID:Barefootedsoul,项目名称:script.module.urlresolver,代码行数:8,代码来源:rapidgator.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python interfaces.PluginSettings类代码示例发布时间:2022-05-27
下一篇:
Python urlresolver.resolve函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap