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


Python Addon.get_path方法代码示例

本文整理汇总了Python中addon.common.addon.Addon.get_path方法的典型用法代码示例。如果您正苦于以下问题:Python Addon.get_path方法的具体用法?Python Addon.get_path怎么用?Python Addon.get_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在addon.common.addon.Addon的用法示例。


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

示例1: Addon

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import get_path [as 别名]
from __future__ import unicode_literals
from resources.lib.modules import client,webutils
import re,urlparse,json,sys,os, json

from addon.common.addon import Addon
addon = Addon('plugin.video.castaway', sys.argv)

AddonPath = addon.get_path()
IconPath = AddonPath + "/resources/media/"
def icon_path(filename):
    return os.path.join(IconPath, filename)

class info():
    def __init__(self):
    	self.mode = 'zizo'
        self.name = 'zizo.entejsites.com (full matches & highlights)'
        self.icon = icon_path('zizo.jpg')
        self.paginated = True
        self.categorized = True
        self.multilink = True


class main():
	def __init__(self,url = 'http://zizo.entejsites.com'):
		self.base = 'http://zizo.entejsites.com'
		self.url = url


	def categories(self):
		cats = [('http://zizo.entejsites.com/category/premier-league-full-matches-online/', 'Premier League', 'http://zizo.entejsites.com/wp-content/uploads/2015/04/barclays-premier-league-fixtures1.jpg'),
				('http://zizo.entejsites.com/category/seria-a-full-matches-online/', 'Seria A','http://zizo.entejsites.com/wp-content/uploads/2015/04/serie-a-27-giornata-risultati-e-classifica_1_big1.jpg'),
开发者ID:Bernardo1987,项目名称:repoTVONLINE2106,代码行数:33,代码来源:zizo.py

示例2: Addon

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import get_path [as 别名]
import xbmcaddon
import xbmcvfs
import log_utils
import sys
import hashlib
import urlparse
import shutil
import urllib
from constants import *
from scrapers import * # import all scrapers into this namespace
from addon.common.addon import Addon
from trakt_api import Trakt_API
from db_utils import DB_Connection

ADDON = Addon('plugin.video.salts')
ICON_PATH = os.path.join(ADDON.get_path(), 'icon.png')
SORT_FIELDS =  [(SORT_LIST[int(ADDON.get_setting('sort1_field'))], SORT_SIGNS[ADDON.get_setting('sort1_order')]),
                (SORT_LIST[int(ADDON.get_setting('sort2_field'))], SORT_SIGNS[ADDON.get_setting('sort2_order')]),
                (SORT_LIST[int(ADDON.get_setting('sort3_field'))], SORT_SIGNS[ADDON.get_setting('sort3_order')]),
                (SORT_LIST[int(ADDON.get_setting('sort4_field'))], SORT_SIGNS[ADDON.get_setting('sort4_order')]),
                (SORT_LIST[int(ADDON.get_setting('sort5_field'))], SORT_SIGNS[ADDON.get_setting('sort5_order')])]

username=ADDON.get_setting('username')
password=ADDON.get_setting('password')
use_https=ADDON.get_setting('use_https')=='true'
trakt_timeout=int(ADDON.get_setting('trakt_timeout'))

P_MODE = int(ADDON.get_setting('parallel_mode'))
if P_MODE == P_MODES.THREADS:
    import threading
    from Queue import Queue, Empty
开发者ID:SNAPflix,项目名称:salts,代码行数:33,代码来源:utils.py

示例3: Addon

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import get_path [as 别名]
import xbmc
import xbmcgui
import os
import math
import socket
from operator import itemgetter
from addon.common.net import Net
from addon.common.addon import Addon
from db_utils import DB_Connection

USER_AGENT = ("User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64)"
              "AppleWebKit/537.17 (KHTML, like Gecko)"
              "Chrome/24.0.1312.56")

_1CH = Addon('plugin.video.1channel')
ADDON_PATH = _1CH.get_path()
ICON_PATH = os.path.join(ADDON_PATH, 'icon.png')
MAX_RETRIES=2
TEMP_ERRORS=[500, 502, 503, 504]

class PW_Error(Exception):
    pass


class MyHTTPRedirectHandler(urllib2.HTTPRedirectHandler):
    def redirect_request(self, req, fp, code, msg, headers, newurl):
        utils.log('Using Custom Redirect: |%s|%s|%s|%s|%s|' % (req.header_items(),code, msg, headers, newurl), xbmc.LOGDEBUG)
        request=urllib2.HTTPRedirectHandler.redirect_request(self, req, fp, code, msg, headers, newurl)
        if request:
            host = request.get_host()
            request.add_header('Host', host)
开发者ID:crashcoredump,项目名称:1Channel,代码行数:33,代码来源:pw_scraper.py

示例4: Net

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import get_path [as 别名]
import re
import sys
import xbmc,xbmcaddon,xbmcgui,xbmcplugin,xbmcgui

############# A massive thankyou to Jas0n_pc for sending me the code for this twitter window its brilliant#################

from addon.common.net import Net
from addon.common.addon import Addon

net = Net()

addon_id = 'plugin.video.mdsportsextra'
addon = Addon(addon_id, sys.argv)
Addon = xbmcaddon.Addon(addon_id)

sys.path.append(os.path.join(addon.get_path(), 'resources', 'lib'))
data_path = addon.get_profile()

newsurl = 'http://pastebin.com/raw.php?i=uX9XKZtj'

try:
  import StorageServer
except:
  import storageserverdummy as StorageServer
cache = StorageServer.StorageServer(addon_id)
               
def TWITTER(url):
    #test = net.http_GET(newsurl).content
    #r = re.search(r'<message>(.*?)</message>', test, re.I|re.DOTALL)

    #print r.groups()
开发者ID:bialagary,项目名称:mw,代码行数:33,代码来源:utils.py

示例5: Addon

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import get_path [as 别名]
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""
import sys
import xbmcgui
import time
import xbmc
import os
import utils
from trans_utils import i18n
from trakt_api import Trakt_API
from addon.common.addon import Addon

_SALTS = Addon('plugin.video.salts', sys.argv)
ICON_PATH = os.path.join(_SALTS.get_path(), 'icon.png')
use_https = _SALTS.get_setting('use_https') == 'true'
trakt_timeout = int(_SALTS.get_setting('trakt_timeout'))

def get_pin():
    AUTH_BUTTON = 200
    LATER_BUTTON = 201
    NEVER_BUTTON = 202
    ACTION_PREVIOUS_MENU = 10
    ACTION_BACK = 92
    CENTER_Y = 6
    CENTER_X = 2
    
    class PinAuthDialog(xbmcgui.WindowXMLDialog):
        auth = False
        
开发者ID:s7eele,项目名称:tknorris-beta-repo,代码行数:31,代码来源:gui_utils.py

示例6: str

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import get_path [as 别名]
addon.log('--- URL: ' + str(url))
addon.log('--- Page: ' + str(page_num))
addon.log('---------------------------------------------------------------')

################### Global Constants #################################

main_url = 'http://www.tgun.tv/'
shows_url = main_url + 'shows/'
#showlist_url = 'http://www.tgun.tv/menus2/shows/chmenu%s.php'
showlist_url = 'http://www.tgun.tv/menus/shows/chmenu.php'
num_showpages = 4
classic_url = main_url + 'classic/'
classic_shows_url = 'http://www.tgun.tv/menus2/classic/chmenu%s.php'
livetv_url = main_url + 'usa/'
livetv_pages = 'http://www.tgun.tv/menus2/usa/chmenu%s.php'
addon_path = addon.get_path()
icon_path = addon_path + "/icons/"

######################################################################

def Notify(typeq, title, message, times, line2='', line3=''):
     #simplified way to call notifications. common notifications here.
     if title == '':
          title='TGUN Notification'
     if typeq == 'small':
          if times == '':
               times='5000'
          smallicon= icon_path + 'tgun.png'
          xbmc.executebuiltin("XBMC.Notification("+title+","+message+","+times+","+smallicon+")")
     elif typeq == 'big':
          dialog = xbmcgui.Dialog()
开发者ID:bialagary,项目名称:mw,代码行数:33,代码来源:default.py

示例7: Net

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import get_path [as 别名]
    xbmc.log('Failed To Import Needed Module: %e') % e
    xbmcgui.Dialog().ok("XxTRUCOxX Import Failure", "Failed to import needed module",
                        "[COLOR red]%e[/COLOR]", "") % e

net = Net()

base_url = 'https://raw.githubusercontent.com/AiWABR/list2/master/Main.xml'
no_image = 'https://corsetsandcutlasses.files.wordpress.com/2013/12/cover-not-yet-available.jpg'
delImage = 'http://www.muziejusalka.lt/files/upload/big_D%C4%97mesio.png'
retry_image = 'http://cdn3.iconfinder.com/data/icons/3d-printing-icon-set/256/Refresh.png'

addon_id = 'plugin.video.xxtrucoxx'
addon = Addon(addon_id, sys.argv)
Addon = xbmcaddon.Addon(addon_id)

netError = os.path.join(addon.get_path(), 'resources', 'skins', 'Default', 'media', 'network_error.png')

sys.path.append(os.path.join(addon.get_path(), 'resources', 'lib'))
data_path = addon.get_profile()
cookie_file = os.path.join(data_path, 'bu.cookie')

name = addon.queries.get('name', '')
url = addon.queries.get('url', '')
alt = addon.queries.get('alt', '')
mode = addon.queries['mode']
img = addon.queries.get('img', '')

addon.log('Version %s'%addon.get_version())

import utils
开发者ID:AiWABR,项目名称:xxtrucoxx-repo,代码行数:32,代码来源:plugin.py

示例8: Net

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import get_path [as 别名]
import re
import sys
import xbmc, xbmcaddon, xbmcgui, xbmcplugin, xbmcgui

############# A massive thankyou to Jas0n_pc for sending me the code for this twitter window its brilliant#################

from addon.common.net import Net
from addon.common.addon import Addon

net = Net()

addon_id = "plugin.video.streamengine"
addon = Addon(addon_id, sys.argv)
Addon = xbmcaddon.Addon(addon_id)

sys.path.append(os.path.join(addon.get_path(), "resources", "lib"))
data_path = addon.get_profile()

newsurl = "http://pastebin.com/raw.php?i=uX9XKZtj"

try:
    import StorageServer
except:
    import storageserverdummy as StorageServer
cache = StorageServer.StorageServer(addon_id)


def TWITTER(url):
    # test = net.http_GET(newsurl).content
    # r = re.search(r'<message>(.*?)</message>', test, re.I|re.DOTALL)
开发者ID:bialagary,项目名称:mw,代码行数:32,代码来源:utils.py

示例9: list

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import get_path [as 别名]
import sys
import time
import datetime
import json
import _strptime  # fix bug in python import
import xbmc
import xbmcgui
import xbmcplugin
from addon.common.addon import Addon
import strings

DAY_NUMS = list('0123456')
DAY_CODES = ['M', 'T', 'W', 'H', 'F', 'Sa', 'Su']

_1CH = Addon('plugin.video.1channel')
ICON_PATH = os.path.join(_1CH.get_path(), 'icon.png')

def enum(**enums):
    return type('Enum', (), enums)

MODES = enum(SAVE_FAV='SaveFav', DEL_FAV='DeleteFav', GET_SOURCES='GetSources', PLAY_SOURCE='PlaySource', CH_WATCH='ChangeWatched', PLAY_TRAILER='PlayTrailer',
                   SEARCH_QUERY='GetSearchQuery', DESC_QUERY='GetSearchQueryDesc', ADV_QUERY='GetSearchQueryAdvanced', SEARCH='Search', SEARCH_DESC='SearchDesc',
                   SEARCH_ADV='SearchAdvanced', REMOTE_SEARCH='7000', MAIN='main', LIST_MENU='BrowseListMenu', AZ_MENU='BrowseAlphabetMenu', GENRE_MENU='BrowseByGenreMenu',
                   FILTER_RESULTS='GetFilteredResults', SEASON_LIST='TVShowSeasonList', EPISODE_LIST='TVShowEpisodeList', BROWSE_FAVS='browse_favorites',
                   BROWSE_FAVS_WEB='browse_favorites_website', MIG_FAVS='migrateFavs', FAV2LIB='fav2Library', BROWSE_W_WEB='browse_watched_website', ADD2LIB='add_to_library',
                   ADD_SUB='add_subscription', CANCEL_SUB='cancel_subscription', MAN_UPD_SUBS='manual_update_subscriptions', UPD_SUBS='update_subscriptions',
                   MAN_CLEAN_SUBS='manual_clean_up_subscriptions', CLEAN_SUBS='clean_up_subscriptions', MANAGE_SUBS='manage_subscriptions', PAGE_SELECT='PageSelect',
                   FAV_PAGE_SELECT='FavPageSelect', WATCH_PAGE_SELECT='WatchedPageSelect', SEARCH_PAGE_SELECT='SearchPageSelect', EXPORT_DB='export_db', IMPORT_DB='import_db',
                   BACKUP_DB='backup_db', EDIT_DAYS='edit_days', HELP='Help', FLUSH_CACHE='flush_cache', INSTALL_META='install_metapack', INSTALL_LOCAL_META='install_local_metapack',
                   MOVIE_UPDATE='movie_update', SELECT_SOURCES='SelectSources', REFRESH_META='refresh_meta', META_SETTINGS='9988', RES_SETTINGS='ResolverSettings',
                   TOGGLE_X_FAVS='toggle_xbmc_fav', PLAYLISTS_MENU='playlists_menu', BROWSE_PLAYLISTS='get_playlists', SHOW_PLAYLIST='show_playlist', PL_PAGE_SELECT='PLPageSelect',
开发者ID:breams,项目名称:1Channel,代码行数:33,代码来源:utils.py

示例10: Addon

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import get_path [as 别名]
import os
import time
import urllib2
import re
import HTMLParser
import socket
import xbmc
import xbmcvfs
import log_utils
from constants import VIDEO_TYPES
from constants import SRT_SOURCE
from addon.common.addon import Addon
from db_utils import DB_Connection

_SALTS = Addon('plugin.video.salts')
ADDON_PATH = _SALTS.get_path()
ICON_PATH = os.path.join(ADDON_PATH, 'icon.png')
MAX_RETRIES = 2
TEMP_ERRORS = [500, 502, 503, 504]
USER_AGENT = ("User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64)"
              "AppleWebKit/537.17 (KHTML, like Gecko)"
              "Chrome/24.0.1312.56")
BASE_URL = 'http://www.addic7ed.com'
BASE_PATH = _SALTS.get_setting('subtitle-folder')
db_connection = DB_Connection()

class SRT_Scraper():
    def __init__(self):
        pass

    def get_tvshow_id(self, title, year=None):
开发者ID:djbijo,项目名称:salts,代码行数:33,代码来源:srt_scraper.py

示例11: Addon

# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import get_path [as 别名]
import xbmcplugin
import xbmcaddon
import xbmcvfs
import log_utils
import sys
import urlparse
import urllib
from constants import *
from trans_utils import i18n
from scrapers import *  # import all scrapers into this namespace
from addon.common.addon import Addon
from trakt_api import Trakt_API
from db_utils import DB_Connection

ADDON = Addon('plugin.video.salts')
ICON_PATH = os.path.join(ADDON.get_path(), 'icon.png')
SORT_FIELDS = [(SORT_LIST[int(ADDON.get_setting('sort1_field'))], SORT_SIGNS[ADDON.get_setting('sort1_order')]),
                (SORT_LIST[int(ADDON.get_setting('sort2_field'))], SORT_SIGNS[ADDON.get_setting('sort2_order')]),
                (SORT_LIST[int(ADDON.get_setting('sort3_field'))], SORT_SIGNS[ADDON.get_setting('sort3_order')]),
                (SORT_LIST[int(ADDON.get_setting('sort4_field'))], SORT_SIGNS[ADDON.get_setting('sort4_order')]),
                (SORT_LIST[int(ADDON.get_setting('sort5_field'))], SORT_SIGNS[ADDON.get_setting('sort5_order')])]

last_check = datetime.datetime.fromtimestamp(0)

P_MODE = int(ADDON.get_setting('parallel_mode'))
if P_MODE == P_MODES.THREADS:
    import threading
    from Queue import Queue, Empty
elif P_MODE == P_MODES.PROCESSES:
    try:
        import multiprocessing
开发者ID:s7eele,项目名称:tknorris-beta-repo,代码行数:33,代码来源:utils.py


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