本文整理汇总了Python中t0mm0.common.addon.Addon.get_path方法的典型用法代码示例。如果您正苦于以下问题:Python Addon.get_path方法的具体用法?Python Addon.get_path怎么用?Python Addon.get_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t0mm0.common.addon.Addon
的用法示例。
在下文中一共展示了Addon.get_path方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: art
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import get_path [as 别名]
def art(filename):
adn = Addon("plugin.video.1channel", sys.argv)
THEME_LIST = ["mikey1234", "Glossy_Black"]
THEME = THEME_LIST[int(adn.get_setting("theme"))]
THEME_PATH = os.path.join(adn.get_path(), "art", "themes", THEME)
img = os.path.join(THEME_PATH, filename)
return img
示例2: art
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import get_path [as 别名]
def art(file):
adn = Addon('plugin.video.1channel', sys.argv)
THEME_LIST = ['mikey1234','Glossy_Black']
THEME = THEME_LIST[int(adn.get_setting('theme'))]
THEME_PATH = os.path.join(adn.get_path(), 'art', 'themes', THEME)
img = os.path.join(THEME_PATH, file)
return img
示例3: Net
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import get_path [as 别名]
try:
from sqlite3 import dbapi2 as sqlite
print "Loading sqlite3 as DB engine"
except:
from pysqlite2 import dbapi2 as sqlite
print "Loading pysqlite2 as DB engine"
addon_id = 'plugin.video.dfmalaystream'
plugin = xbmcaddon.Addon(id=addon_id)
#DB = os.path.join(xbmc.translatePath("special://database"), 'dfv.db')
BASE_URL = 'http://malaystream.zapto.org'
net = Net()
addon = Addon('plugin.video.dfmalaystream', sys.argv)
###### PATHS ###########
AddonPath = addon.get_path()
IconPath = AddonPath + "/icons/"
FanartPath = AddonPath + "/icons/"
##### Queries ##########
mode = addon.queries['mode']
url = addon.queries.get('url', None)
content = addon.queries.get('content', None)
query = addon.queries.get('query', None)
startPage = addon.queries.get('startPage', None)
numOfPages = addon.queries.get('numOfPages', None)
listitem = addon.queries.get('listitem', None)
urlList = addon.queries.get('urlList', None)
section = addon.queries.get('section', None)
################################################################################# Titles #################################################################################
示例4: Addon
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.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 re
import string
import sys
from t0mm0.common.addon import Addon
from t0mm0.common.net import Net
import urlresolver
import os,xbmc
addon = Addon('plugin.video.t0mm0.test', sys.argv)
net = Net()
logo = os.path.join(xbmc.translatePath(addon.get_path()), 'art','logo.jpg')
base_url = 'http://tubeplus.me'
mode = addon.queries['mode']
play = addon.queries.get('play', None)
if play:
stream_url = urlresolver.resolve(play)
addon.resolve_url(stream_url)
elif mode == 'resolver_settings':
urlresolver.display_settings()
elif mode == 'test':
addon.add_video_item('http://www.megaupload.com/?d=TQPQJM5H',
示例5: Addon
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import get_path [as 别名]
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
import os
from t0mm0.common.addon import Addon
import xbmc
import xbmcvfs
import xbmcgui
import config
plugin_id = config.plugin_id
skin_id = config.skin_id
addon = Addon(plugin_id)
addon_path = addon.get_path()
default_path = 'special://profile/addon_data/'+plugin_id+'/'
db_path = os.path.join(xbmc.translatePath("special://database"), 'myvideolibrary')
use_remote_db = addon.get_setting('use_remote_db')
db_address = addon.get_setting('db_address')
db_port = addon.get_setting('db_port')
if db_port: db_address = '%s:%s' %(db_address,db_port)
db_user = addon.get_setting('db_user')
db_pass = addon.get_setting('db_pass')
db_name = addon.get_setting('db_name')
def make_dir(mypath, dirname):
示例6: Addon
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import get_path [as 别名]
import sys
import os
import inspect
import time
import random
import urllib
import xbmcplugin
import xbmcgui
from t0mm0.common.addon import Addon
import rdiocommon
ADDON_ID = 'plugin.audio.rdio'
addon = Addon(ADDON_ID, argv=sys.argv)
sys.path.append(os.path.join(addon.get_path(), 'resources', 'lib'))
from rdioxbmc import RdioApi, RdioAuthenticationException
class XbmcRdioOperation:
_TYPE_ALBUM = 'a'
_TYPE_ARTIST = 'r'
_TYPE_PLAYLIST = 'p'
_TYPE_USER = 's'
_TYPE_TRACK = 't'
_TYPE_ALBUM_IN_COLLECTION = 'al'
_TYPE_ARTIST_IN_COLLECTION = 'rl'
_PAGE_SIZE_ALBUMS = 100
_PAGE_SIZE_HEAVY_ROTATION = 14
示例7: Addon
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.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 os
import re
import string
import sys
from t0mm0.common.addon import Addon
from t0mm0.common.net import Net
import urlresolver
addon = Addon('plugin.video.t0mm0.test', sys.argv)
net = Net()
logo = os.path.join(addon.get_path(), 'art','logo.jpg')
base_url = 'http://tubeplus.me'
mode = addon.queries['mode']
play = addon.queries.get('play', None)
if play:
url = addon.queries.get('url', '')
host = addon.queries.get('host', '')
media_id = addon.queries.get('media_id', '')
#stream_url = urlresolver.resolve(play)
stream_url = urlresolver.HostedMediaFile(url=url, host=host, media_id=media_id).resolve()
addon.resolve_url(stream_url)
elif mode == 'resolver_settings':
示例8: Net
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import get_path [as 别名]
try:
import json
except ImportError:
import simplejson as json
try:
import StorageServer
except:
import storageserverdummy as StorageServer
BASE_URL = "http://www.tubetamil.com/"
MOVIE_URL = "http://tamilbase.com/category/s3-movies/c159-latest-movei/"
net = Net()
addonId = 'plugin.video.oliyumoliyum'
addon = Addon( addonId, sys.argv )
addonPath = xbmc.translatePath( addon.get_path() )
resPath = os.path.join( addonPath, 'resources' )
tvxmlFile = os.path.join( resPath, 'livetv.xml' )
radioxmlFile = os.path.join( resPath, 'liveradio.xml' )
iconPath = os.path.join( resPath, 'images' )
cache = StorageServer.StorageServer( addonId )
cache.dbg = True
def getImgPath( icon ):
icon = icon + '.png'
imgPath = os.path.join( iconPath, icon )
if os.path.exists( imgPath ):
return imgPath
else:
return ''
示例9: CraftsyPlugin
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import get_path [as 别名]
class CraftsyPlugin():
addon = None
net = None
logo = None
profile_path = None
cookie_file = None
base_url = None
free_url = 'http://www.craftsy.com.edgesuite.net/'
pay_url = 'http://cd1.craftsy.com/'
def __init__(self):
self.addon = Addon('plugin.video.craftsy', sys.argv)
self.net = Net()
self.logo = os.path.join(self.addon.get_path(), 'art','logo.jpg')
self.profile_path = self.addon.get_profile()
self.cookie_file = os.path.join(self.profile_path, 'craftsy.cookies')
try:
os.makedirs(os.path.dirname(self.cookie_file))
except OSError:
pass
self.net.set_cookies(self.cookie_file)
self.base_url = 'http://www.craftsy.com'
def __get_image(self, url):
fname = os.path.join(self.profile_path, md5.new(url).digest())
print fname
if os.path.isfile(fname):
return fname
return url
def __check_link(self, url):
if (re.match('^/', url)):
return 'http:' + url
return url
def __fetch_regexp_idx(self, r, idx, default = None):
if (r == None):
return default
if (len(r.groups()) < idx + 1):
return default
return r.groups()[idx]
def check_login(self):
source = self.net.http_GET(self.base_url + '/my/home?NAVIGATION_PAGE_CONTEXT_ATTR=NONE').content
r = re.search('<title>([^<]+)</title>', source)
title = r.groups()[0]
if title == 'Welcome Back to Craftsy!':
return False
return True
def __get_url(self, url):
return self.net.http_GET(url).content.encode('utf8').replace("\n", "").replace("\r", "")
def add_classes(self):
source = self.__get_url(self.base_url + '/my/home?NAVIGATION_PAGE_CONTEXT_ATTR=NONE')
source = re.sub('<div class="classCard mostRecent".*?</div>.*?</div>.*?</div>.*?</div>', '', source)
source = re.sub('<div class="continueArea".*?</div>.*?</div>', '', source)
# parts = re.split('<div class="classBot myClassBot">', source)
r = re.findall('<a href="(/lecture[^\"]+)"(.*?)</a>[ \s\t]*<div class="classBot myClassBot">.*?<a href="([^"]+)"', source)
for i in r:
url = i[2]
if (re.match('^/', url)):
url = self.base_url + url
t = re.search('<h4>([^<]+)</h4>', i[1])
title = 'N/A'
title = self.__fetch_regexp_idx(t, 0, 'N/A')
img = self.base_url + '/images/craftsy/noImageTitleCard.png'
t = re.search('<img src="([^"]+)" alt="[^"]+" onerror', i[1])
_u = self.__fetch_regexp_idx(t, 0)
if (_u != None):
img = self.__check_link(_u)
# print self.__get_image(img)
self.addon.add_directory({'mode': 'classes', 'url': url}, {'title': title}, fanart=img, img=img)
def __try_resolve(self, pattern, video):
r = re.search(pattern, video)
return self.__fetch_regexp_idx(r, 0)
def resolve_url(self, lesson_url):
pattern = '&([0-9]+)&(pay|free)$'
l = re.search(pattern, lesson_url)
lesson_id = self.__fetch_regexp_idx(l, 0)
lesson_type = self.__fetch_regexp_idx(l, 1, 'pay')
lesson_url = re.sub(pattern, '', lesson_url)
q = self.addon.get_setting('quality')
t = self.addon.get_setting('type')
source = self.__get_url(lesson_url)
uid = re.search('/([0-9]+)\\.html(\\?t=[0-9]*){0,1}$', lesson_url)
url_id = self.__fetch_regexp_idx(uid, 0)
if (url_id == None):
#.........这里部分代码省略.........
示例10: Addon
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import get_path [as 别名]
'Fantasy', 'Film Noir', 'Game Show', 'History', 'Horror',
'Music', 'Mystical', 'News', 'Reality TV', 'Romance',
'Sci-Fi', 'Short', 'Sport', 'Talk Show', 'Thriller',
'War', 'Western' ]
addon = Addon('plugin.video.solarmovie', sys.argv)
cm = ContextMenu(addon)
net = Net()
net.set_user_agent('Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0; yie9)')
base_url = 'http://www.solarmovie.eu'
mode = addon.queries['mode']
play = addon.queries.get('play', None)
solarpath = addon.get_path()
smallimage = os.path.join(xbmc.translatePath(solarpath), \
'art','logo_in_gold_black.jpg')
numpages = numpagesindex[addon.get_setting('numpages')]
maxlinks = int(addon.get_setting('maxlinks'))
hideadult = addon.get_setting('hideadult')
enableproxy = addon.get_setting('proxy_enable')
proxyserver = addon.get_setting('proxy_server')
proxyport = addon.get_setting('proxy_port')
proxyuser = addon.get_setting('proxy_user')
proxypass = addon.get_setting('proxy_pass')
if enableproxy == 'true':
proxy = 'http://'
示例11: Addon
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import get_path [as 别名]
from sqlite3 import dbapi2 as sqlite
print "Loading sqlite3 as DB engine"
except:
from pysqlite2 import dbapi2 as sqlite
print "Loading pysqlite2 as DB engine"
addon = Addon('plugin.video.1channel', sys.argv)
DB = os.path.join(xbmc.translatePath("special://database"), 'onechannelcache.db')
META_ON = addon.get_setting('use-meta') == 'true'
FANART_ON = addon.get_setting('enable-fanart') == 'true'
USE_POSTERS = addon.get_setting('use-posters') == 'true'
POSTERS_FALLBACK = addon.get_setting('posters-fallback') == 'true'
THEME_LIST = ['mikey1234','Glossy_Black']
THEME = THEME_LIST[int(addon.get_setting('theme'))]
THEME_PATH = os.path.join(addon.get_path(), 'art', 'themes', THEME)
AUTO_WATCH = addon.get_setting('auto-watch') == 'true'
AZ_DIRECTORIES = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y', 'Z']
BASE_URL = 'http://www.1channel.ch'
USER_AGENT = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'
GENRES = ['Action', 'Adventure', 'Animation', 'Biography', 'Comedy',
'Crime', 'Documentary', 'Drama', 'Family', 'Fantasy', 'Game-Show',
'History', 'Horror', 'Japanese', 'Korean', 'Music', 'Musical',
'Mystery', 'Reality-TV', 'Romance', 'Sci-Fi', 'Short', 'Sport',
'Talk-Show', 'Thriller', 'War', 'Western', 'Zombies']
prepare_zip = False
metaget=metahandlers.MetaData(preparezip=prepare_zip)
if not os.path.isdir(addon.get_profile()):
示例12: Addon
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import get_path [as 别名]
import json
import urllib
import xbmc
import urlparse
import xbmcgui
import xbmcplugin
from t0mm0.common.addon import Addon
from t0mm0.common.net import Net
from metahandler import metahandlers
from metahandler import metacontainers
from utils import *
addon = Addon('plugin.video.waldo', sys.argv)
INDEXES_PATH = os.path.join(addon.get_path(),'indexes')
PROVIDERS_PATH = os.path.join(addon.get_path(),'providers')
def listIndexes():
import indexes
for index in indexes.index_list:
title = index.display_name
args = {'waldo_mode':'ListIndexBrowsingOptions'}
args['waldo_mod'] = get_index_name(index)
args['waldo_path'] = os.path.dirname(index.__file__)
addon.add_directory(args, {'title': title})
addon.end_of_directory()
def ListIndexBrowsingOptions(index, ind_path):
index = import_module(index, fromlist=[INDEXES_PATH, ind_path])
options = index.get_browsing_options()