def machine(self): system = platform.system().lower() if "windows" in system or xbmc.getCondVisibility('system.platform.windows'): os = "windows" if "linux" in system or xbmc.getCondVisibility('system.platform.linux'): if xbmc.getCondVisibility('system.platform.android'): os = "android" os = "linux" try: iselec = False with open("/etc/os-release") as f: if "ELEC" in f.read(): iselec = True except Exception: pass ar = platform.architecture()[0].lower() mach = platform.machine().lower() if ar == "32bit": if "arm" in mach: arch = "arm" arch = "x86" if ar == "64bit": if "arm" in mach: arch = "aarch64" arch = "amd64" machine = "%s-%s" % (os, arch) if os == "linux": if iselec: from anon.platforms import libreelec return libreelec.Platform(addon.get_addondir(), machine, getinputpw) from anon.platforms import linux return linux.Platform(addon.get_addondir(), machine, getinputpw) else:
def pvrtemp(self): if self.setting.getbool("pvrusetemp"): path = tools.translatePath(self.setting.getstr("pvrtemplocation")) if not tools.exists(path): npath = addon.get_addondir(common.addon_id) gui.warn("PVR temp path is not available", "Using path %s instead of %s" % (npath, path)) path = npath else: path = addon.get_addondir() return path
def __init__(self, path, serial=None, compress=0, maxrows=5000, write=True, common=False): self.write = write self.compress = compress self.maxrows = maxrows self.path = path self.common = common if type(common) == type(True): from tinyxbmc import addon if common: bpath = addon.get_commondir() else: bpath = addon.get_addondir() else: bpath = common path = os.path.join(bpath, path) if not os.path.exists(path): os.makedirs(path) self.dbpath = os.path.join(path, "haystack.db") self._open_db(self.dbpath) if not self._check_db(): self._create_table() self.serial = serial self.__closed = False
"master", path=["script.module.kodi-six", "libs"]) for target in ["util.py", "EPG.py"]: tfile = os.path.join(ardundzdf, "resources", "lib", target) with open(tfile, encoding="utf-8") as f: tcont = re.sub("plugin\.video\.ardundzdf", "plugin.video.livestreams", f.read()) tcont = re.sub("xbmcaddon.Addon\(id=ADDON_ID\)", "xbmcaddon.Addon(ADDON_ID)", tcont) tcont = re.sub("ADDON_PATH[\s\t]*?=[\s\t]*?SETTINGS.getAddonInfo.+?\n", "ADDON_PATH = '%s'\n" % ardundzdf, tcont) tcont = re.sub( "USERDATA[\s\t]*?=[\s\t]*?xbmc.translatePath.+?\n", "USERDATA = '%s'\n" % os.path.join(addon.get_addondir("plugin.video.livestreams"), ""), tcont) tcont = re.sub("HANDLE[\s\t]*?=[\s\t]*?int.+?\n", "HANDLE = 1", tcont) with open(tfile, "w") as f: f.write(tcont) from resources.lib import util from resources.lib import EPG util.check_DataStores() e = EPG.EPG("ARD") class multi(): categories = ["Deutschland"] title = u"Das Erste"
it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' _profile = False _debugger = False if _profile: import cProfile pr = cProfile.Profile() pr.enable() import os from tinyxbmc import addon from containers import index index.index() if _profile: pr.disable() print os.path.join(addon.get_addondir(), "profile.dump") pr.dump_stats(os.path.join(addon.get_addondir(), "profile.dump"))
''' Created on Feb 22, 2020 @author: boogie ''' import os from tinyxbmc import addon hay_chan = "channels" hay_playlist = "playlists" addon_id = "plugin.video.livestreams" query_timeout = 2 playlist_timeout = 10 check_timeout = 6 * 60 * 60 dpath = os.path.join(os.path.dirname(__file__), "chexts") mpath = os.path.join(os.path.dirname(__file__), "media") epath = os.path.join(addon.get_addondir(addon_id), "epg.xml")