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

Python generic_utility.get_setting函数代码示例

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

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



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

示例1: videos

def videos(url, video_type, offset, run_as_widget=False):
    if '' == offset:
        page = 0
    else:
        page = int(offset)

    loading_progress = show_loading_progress(run_as_widget)
    xbmcplugin.setContent(plugin_handle, 'movies')

    list_id = None
    genre_id = None
    if 'genre' in url:
        genre_id = url.split('?')[1]
    elif 'list?' in url:
        data = url.split('?')[1]
        if 'mylist' in data:
            root_list = lolomos.get_root_list()
            list_id = lolomos.get_mylist(root_list)[0]
        else:
            list_id = data

    video_metadata = None
    if list_id:
        video_metadata = get.videos_in_list(list_id, page)
    elif genre_id:
        video_metadata = get.videos_in_genre(genre_id, page)

    if video_metadata:
        add_videos_to_directory(loading_progress, run_as_widget, video_metadata, video_type, page, url)

    if generic_utility.get_setting('force_view') == 'true' and not run_as_widget:
        xbmc.executebuiltin('Container.SetViewMode(' + generic_utility.get_setting('view_id_videos') + ')')
    xbmcplugin.endOfDirectory(plugin_handle)
开发者ID:logi85,项目名称:plugin.video.flix2kodi,代码行数:33,代码来源:list.py


示例2: playInternal

    def playInternal (self, video_id, series_id):
        xbmc.audioSuspend()
        self.disable_screensaver()

        if generic_utility.get_setting('disable_lirc') == 'true':
            xbmc.executebuiltin('LIRC.Stop')

        try:
            self.launch_browser('http://netflix.com/watch/%s' % video_id)
        except:
            generic_utility.log(traceback.format_exc(), xbmc.LOGERROR)
            generic_utility.notification('Error launching browser. See logfile')

        self.enable_screensaver()
        xbmc.audioResume()
        if generic_utility.get_setting('disable_lirc') == 'true':
            xbmc.executebuiltin('LIRC.Start')

        if generic_utility.get_setting('sync_viewstate') == 'true':
            try:
                self.update_playcount(video_id)
            except:
                generic_utility.log(traceback.format_exc(), xbmc.LOGERROR)
                generic_utility.notification('Cannot update playcount. See logfile')
        self.close()
开发者ID:fkmclane,项目名称:plugin.video.flix2kodi,代码行数:25,代码来源:play.py


示例3: add_context_menu_show

def add_context_menu_show(entries, removable, thumb_url, title, video_id):
    if generic_utility.get_setting('browse_tv_shows') == 'true':
        entries.append((generic_utility.get_string(30151),
                        'RunPlugin(plugin://%s/?mode=play_video_main&url=%s&thumb=%s)' % (
                            generic_utility.addon_id, urllib.quote_plus(video_id), urllib.quote_plus(thumb_url))))

    else:
        entries.append((generic_utility.get_string(30152),
                        'Container.Update(plugin://%s/?mode=list_seasons&url=%s&thumb=%s)' % (
                            generic_utility.addon_id, urllib.quote_plus(video_id), urllib.quote_plus(thumb_url))))

    if generic_utility.get_setting('is_kid') == 'false':
        if removable:
            entries.append((generic_utility.get_string(30154), 'RunPlugin(plugin://%s/?mode=remove_from_queue&url=%s)' % (
                generic_utility.addon_id, urllib.quote_plus(video_id))))
        else:
            entries.append((generic_utility.get_string(30155), 'RunPlugin(plugin://%s/?mode=add_to_queue&url=%s)' % (
                generic_utility.addon_id, urllib.quote_plus(video_id))))

    series_dir = library.get_series_dir(title.strip())
    #        generic_utility.log('series-dir: '+series_dir)
    if xbmcvfs.exists(series_dir + os.sep) == False:
        entries.append((generic_utility.get_string(30150),
                        'RunPlugin(plugin://%s/?mode=add_series_to_library&url=&name=%s&series_id=%s)' % (
                            generic_utility.addon_id, urllib.quote_plus(generic_utility.encode(title.strip())),
                            urllib.quote_plus(video_id))))
    else:
        entries.append((generic_utility.get_string(301501),
                        'RunPlugin(plugin://%s/?mode=remove_series_from_library&url=&name=%s)' % (
                            generic_utility.addon_id, urllib.quote_plus(generic_utility.encode(title.strip())))))
开发者ID:themightydeity,项目名称:plugin.video.flix2kodi,代码行数:30,代码来源:add.py


示例4: profile_selection

def profile_selection():

    if generic_utility.get_setting('single_profile') == 'false':
        if not generic_utility.get_setting('selected_profile') or generic_utility.get_setting('show_profiles') == 'true':
            profiles.choose()
        else:
            profiles.load()

    profiles.update_displayed()
开发者ID:badcrc,项目名称:plugin.video.flix2kodi,代码行数:9,代码来源:login.py


示例5: index

def index():
    add.directory(generic_utility.get_string(30100), '', 'main', '', 'movie', login_context=True)
    add.directory(generic_utility.get_string(30101), '', 'main', '', 'tv', login_context=True)
    add.directory(generic_utility.get_string(30102), '', 'wi_home', '', 'both', login_context=True)
    if not generic_utility.get_setting('single_profile') == 'true':
        add.item(
            generic_utility.get_string(30103) + ' - [COLOR FF8E0000]' + generic_utility.get_setting('profile_name') + '[/COLOR]',
            'choose_profile', login_context=True)
    xbmcplugin.endOfDirectory(plugin_handle)
开发者ID:jwhite,项目名称:plugin.video.flix2kodi,代码行数:9,代码来源:general.py


示例6: login

def login():
    if not test:
        login_progress = xbmcgui.DialogProgress()
        login_progress.create('Netflix', generic_utility.get_string(30200) + '...')
        generic_utility.progress_window(login_progress, 25, generic_utility.get_string(30201))
    content = connect.load_netflix_site(generic_utility.main_url + 'Login', new_session=True, login_process=True)
    if not 'Sorry, Netflix ' in content:

        match = re.compile('locale: "(.+?)"', re.DOTALL|re.UNICODE).findall(content)
        locale = None
        if(len(match)) == 0:
            match = re.compile('"pageName":"login","locale":"(.+?)"', re.DOTALL|re.UNICODE).findall(content)
            if(len(match)) == 0:
                generic_utility.error('Cannot find locale on page. content: '+content)
                login_url = 'Login'
            else:
                locale = match[0]
                login_url = 'Login?locale=' + locale
        else:
            locale = match[0]
            login_url = 'Login?locale=' + locale
        generic_utility.set_setting('language', locale)

        post_data = {'authURL': generic_utility.get_setting('authorization_url'), 'email': generic_utility.get_setting('username'),
                     'password': generic_utility.get_setting('password'), 'RememberMe': 'on'}
        if not test:
            generic_utility.progress_window(login_progress, 50, generic_utility.get_string(30202))

        content = connect.load_netflix_site(
            generic_utility.main_url + login_url,
            post=post_data, login_process=True)

        if 'id="page-LOGIN"' in content:
            if not test:
                generic_utility.notification(generic_utility.get_string(30303))
            return False

        parse_data_set_cookies(content)

        if not test:
            generic_utility.progress_window(login_progress, 75, generic_utility.get_string(30203))

        profile_selection()

        if login_progress:
            if not test:
                if not generic_utility.progress_window(login_progress, 100, generic_utility.get_string(30204)):
                    return False
                xbmc.sleep(500)
                login_progress.close()
        return True
    else:
        if not test:
            generic_utility.notification(generic_utility.get_string(30300))
            if login_progress:
                login_progress.close()
        return False
开发者ID:jduda,项目名称:plugin.video.flix2kodi,代码行数:57,代码来源:login.py


示例7: genre_info

def genre_info(video_type):
    post_data = ''
    if video_type == 'tv':
        post_data = generic_utility.series_genre % generic_utility.get_setting('authorization_url')
    elif video_type == 'movie':
        post_data = generic_utility.movie_genre % generic_utility.get_setting('authorization_url')
    else:
        pass
    content = connect.load_netflix_site(generic_utility.evaluator(), post=post_data)
    return content
开发者ID:jwhite,项目名称:plugin.video.flix2kodi,代码行数:10,代码来源:get.py


示例8: episodes

def episodes(series_id, season):
    xbmcplugin.setContent(plugin_handle, 'episodes')
    episodes = get.episodes_data(season, series_id)
    for episode in episodes:
        add.episode(episode)
    
    if generic_utility.get_setting('force_view'):
        xbmc.executebuiltin('Container.SetViewMode(' + generic_utility.get_setting('view_id_episodes') + ')')
    xbmcplugin.addSortMethod(plugin_handle, xbmcplugin.SORT_METHOD_EPISODE)
    xbmcplugin.endOfDirectory(plugin_handle)
开发者ID:logi85,项目名称:plugin.video.flix2kodi,代码行数:10,代码来源:list.py


示例9: profile_selection

def profile_selection():

    if generic_utility.get_setting("single_profile") == "false":
        if (
            not generic_utility.get_setting("selected_profile")
            or generic_utility.get_setting("show_profiles") == "true"
        ):
            profiles.choose()
        else:
            profiles.load()

    profiles.update_displayed()
开发者ID:logi85,项目名称:plugin.video.flix2kodi,代码行数:12,代码来源:login.py


示例10: viewing_activity

def viewing_activity(video_type, run_as_widget=False):
    loading_progress = show_loading_progress(run_as_widget)
    xbmcplugin.setContent(plugin_handle, 'movies')

    metadata = get.viewing_activity_matches(video_type)
    if len(metadata) > 0:
        add_videos_to_directory(loading_progress, run_as_widget, metadata, video_type, viewing_activity=True)
    else:
        generic_utility.notification(generic_utility.get_string(30306))

    if generic_utility.get_setting('force_view') and not run_as_widget:
        xbmc.executebuiltin('Container.SetViewMode(' + generic_utility.get_setting('view_id_activity') + ')')
    xbmcplugin.endOfDirectory(plugin_handle)
开发者ID:logi85,项目名称:plugin.video.flix2kodi,代码行数:13,代码来源:list.py


示例11: videos

def videos(url, video_type, offset, run_as_widget=False):
    if '' == offset:
        page = 0
    else:
        page = int(offset)

    loading_progress = show_loading_progress(run_as_widget)
    xbmcplugin.setContent(plugin_handle, 'movies')

    video_ids = get.videos_matches(video_type, page, url)
    load_videos_to_directory(loading_progress, run_as_widget, video_ids, video_type, page, url)

    if generic_utility.get_setting('force_view') == 'true' and not run_as_widget:
        xbmc.executebuiltin('Container.SetViewMode(' + generic_utility.get_setting('view_id_videos') + ')')
    xbmcplugin.endOfDirectory(plugin_handle)
开发者ID:jochenberger,项目名称:plugin.video.flix2kodi,代码行数:15,代码来源:list.py


示例12: search

def search(search_string, video_type, run_as_widget=False):
    loading_progress = None
    if not run_as_widget:
        loading_progress = xbmcgui.DialogProgress()
        loading_progress.create('Netflix', generic_utility.get_string(30205) + '...')
        generic_utility.progress_window(loading_progress, 0, '...')
    xbmcplugin.setContent(plugin_handle, 'movies')

    metadatas = get.videos_in_search(search_string)
#    video_ids = get.search_matches(search_string, video_type)
    add_videos_to_directory(loading_progress, run_as_widget, metadatas, video_type, 0, '')

    if generic_utility.get_setting('force_view') and not run_as_widget:
        xbmc.executebuiltin('Container.SetViewMode(' + generic_utility.get_setting('view_id_videos') + ')')
    xbmcplugin.endOfDirectory(plugin_handle)
开发者ID:logi85,项目名称:plugin.video.flix2kodi,代码行数:15,代码来源:list.py


示例13: remove_series

def remove_series(series_title):
    series_file = get_series_dir(series_title)
    xbmcvfs.rmdir(series_file+os.sep, force=True)
    if generic_utility.get_setting('update_db') == 'true':
        xbmc.executebuiltin('CleanLibrary(video)')
    else:
        xbmc.executebuiltin("Container.Refresh")
开发者ID:badcrc,项目名称:plugin.video.flix2kodi,代码行数:7,代码来源:library.py


示例14: read_lists

def read_lists(jsn, root_list):
    filter_empty(jsn)
    rets = []

    llms = child('lolomos', jsn)
    rlst = child(root_list, llms)

    if generic_utility.get_setting('is_kid') == 'false':
        mylist = child('mylist', rlst)
        mylist_idx = deref(mylist, jsn)[0]
    else:
        mylist_idx = -1
        mylist_id = None

    for list_ref_idx in rlst:
        list_ref = rlst[list_ref_idx]
        idx, elem = deref(list_ref, jsn)
        if list_ref_idx == mylist_idx:
            mylist_id = idx

        if 'displayName' in elem:
            display_name = unicode(elem['displayName'])
            ret = {'id': idx, 'name': display_name}
            rets.append(ret)

    return mylist_id, rets
开发者ID:badcrc,项目名称:plugin.video.flix2kodi,代码行数:26,代码来源:lolomos.py


示例15: add_or_remove

def add_or_remove(video_id, is_add):
    root_list = get_root_list()

    my_list = get_mylist(root_list)[0]
    auth = generic_utility.get_setting('authorization_url')
    track_id = get.track_id_list(my_list)

    if is_add:
        add_or_remove_str = 'addToList'
        add_or_remove_msg = 'added'
    else:
        add_or_remove_str = 'removeFromList'
        add_or_remove_msg = 'removed'

    post = ('{"callPath":["lolomos","%s","%s"],"params":["%s",2,["videos",%s],%s,null,null],' +
            '"authURL":"%s"}') % (root_list, add_or_remove_str, my_list, video_id, track_id, auth)

    content = connect.load_netflix_site(generic_utility.evaluator()+'&method=call', post, options=True)

    jsn = json.loads(content)

    generic_utility.log('mylist: '+my_list)
    generic_utility.log(str(jsn))
    if '"invalidated"' in content:
        generic_utility.notification('Successfully '+add_or_remove_msg)
    elif 'already exists' in content:
        generic_utility.notification('already exists')

    generic_utility.debug('add to mylist content: '+content)
开发者ID:badcrc,项目名称:plugin.video.flix2kodi,代码行数:29,代码来源:queue.py


示例16: remove_movie

def remove_movie(title):
    movie_dir = get_movie_dir(title)[0]
    xbmcvfs.rmdir(movie_dir+os.sep, force=True)
    if generic_utility.get_setting('update_db') == 'true':
        xbmc.executebuiltin('CleanLibrary(video)')
    else:
        xbmc.executebuiltin("Container.Refresh")
开发者ID:badcrc,项目名称:plugin.video.flix2kodi,代码行数:7,代码来源:library.py


示例17: add_series

def add_series(series_id, series_title, season, single_update=True):
    series_file = get_series_dir(series_title)
    if not xbmcvfs.exists(series_file+os.sep):
        xbmcvfs.mkdir(series_file+os.sep)
    content = get.series_info(series_id)
    generic_utility.log(str(content))
    content = json.loads(content)['video']['seasons']
    for test in content:
        episode_season = unicode(test['seq'])
        if episode_season == season or season == '':
            season_dir = generic_utility.create_pathname(series_file.decode('utf-8'), test['title'])
            if not xbmcvfs.exists(season_dir+os.sep):
                xbmcvfs.mkdir(season_dir+os.sep)
            for item in test['episodes']:
                episode_id = unicode(item['episodeId'])
                episode_nr = unicode(item['seq'])
                episode_title = item['title']
                if len(episode_nr) == 1:
                    episode_nr = '0' + episode_nr
                season_nr = episode_season
                if len(season_nr) == 1:
                    season_nr = '0' + season_nr
                filename = 'S' + season_nr + 'E' + episode_nr + ' - ' + episode_title + '.V' + episode_id + 'V'+ '.strm'
                filename = generic_utility.clean_filename(filename, ' .')
                file_handler = xbmcvfs.File(generic_utility.create_pathname(season_dir, filename), 'w')
                file_handler.write(
                    generic_utility.encode('plugin://%s/?mode=play_video&url=%s' % (
                    generic_utility.addon_id, episode_id)))
                file_handler.close()
    if generic_utility.get_setting('update_db') and single_update:
        xbmc.executebuiltin('UpdateLibrary(video)')
开发者ID:jochenberger,项目名称:plugin.video.flix2kodi,代码行数:31,代码来源:library.py


示例18: parse_video

def parse_video(custom_title, jsn, series_title, video_id):
    if custom_title != None:
        title = custom_title
    else:
        title = get_value(jsn, 'title')
    year = get_value(jsn, 'releaseYear', '1900')
    thumb_url = extract_thumb_url(jsn)
    mpaa = get_mpaa(jsn)
    episode, season = parse_episode_seasion(jsn)
    type = parse_type(jsn)
    # series has no playcount
    if type != 'show':
        duration, playcount = parse_duration_playcount(jsn)
    else:
        playcount = 0
        duration = ''
    if generic_utility.get_setting('use_tmdb') == 'true':
        type_tmdb = 'movie' if type == 'movie' else 'tv'
        title_tmdb = series_title if series_title != None else title
        load_tmdb_cover_fanart(title_tmdb, video_id, type_tmdb, year)
    description = get_decription(jsn)
    director = parse_director(jsn)
    genre = parse_genre(jsn)
    rating = parse_rating(jsn)
    movie_metadata = {'title': title, 'video_id': video_id, 'thumb_url': thumb_url, 'type': type,
                      'description': description, 'duration': duration, 'year': year, 'mpaa': mpaa, \
                      'director': director, 'genre': genre, 'rating': rating, 'playcount': playcount,
                      'episode': episode, 'season': season}
    return movie_metadata
开发者ID:jduda,项目名称:plugin.video.flix2kodi,代码行数:29,代码来源:video_parser.py


示例19: add_videos_to_directory

def add_videos_to_directory(loading_progress, run_as_widget, video_metadatas, video_type, page = None, url=None, viewing_activity = False):

    removable = url != None and 'mylist' in url

    if not viewing_activity:
        sorted_video_metadata = sorted(video_metadatas, key=lambda t: t['title'], reverse = viewing_activity)
    else:
        sorted_video_metadata = video_metadatas

    allowed_types = calc_allowed_types(video_type, viewing_activity)

    filtered_video_metadata = []
    for video_metadata in sorted_video_metadata:
        if video_metadata['type'] in allowed_types:
            filtered_video_metadata.append(video_metadata)

    add.videos(filtered_video_metadata, removable, viewing_activity=viewing_activity)

    items_per_page = int(generic_utility.get_setting('items_per_page'))
    if (not url or 'list_viewing_activity' not in url) and len(video_metadatas) == items_per_page:
        add.add_next_item('zzz[Next]zzz', page + 1, url, video_type, 'list_videos', '')

    if len(video_metadatas) == 0:
        generic_utility.notification(generic_utility.get_string(30306))
    if not viewing_activity:
        add_sort_methods()
开发者ID:jduda,项目名称:plugin.video.flix2kodi,代码行数:26,代码来源:list.py


示例20: get_root_list_id_from_cookie

def get_root_list_id_from_cookie():
    from resources import connect
    profile = generic_utility.get_setting('selected_profile')

    session = connect.get_netflix_session(False)

    root_list_id = None
    if not profile:
        generic_utility.log('kein profil!')
        for cur_cookie in session.cookies:
            if 'lhpuuidh-browse-' in cur_cookie.name:
#                generic_utility.log('found cookie: '+cur_cookie.value)
                root_list_id = cur_cookie.value
                break
            elif 'lhpuuid-kid-' in cur_cookie.name:
                root_list_id = cur_cookie.value
    else:
        for cur_cookie in session.cookies:
            if 'lhpuuidh-browse-'+profile in cur_cookie.name:
                root_list_id = cur_cookie.value
                break
            elif 'lhpuuid-kid-'+profile in cur_cookie.name:
                root_list_id = cur_cookie.value

    if not root_list_id:
        raise ValueError('root_list_id not found in cookies!')

    splt = root_list_id.split('%3A')
    if(len(splt) != 3):
        raise ValueError('Invalid split: '+root_list_id)

#    generic_utility.log('root: '+str(splt[2]))
    return splt[2]
开发者ID:un5ki11ed,项目名称:plugin.video.flix2kodi,代码行数:33,代码来源:__init__.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python generic_utility.get_string函数代码示例发布时间:2022-05-26
下一篇:
Python tools.xbmcItem函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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