コード例 #1
0
def install_file(filename):
    ottv = dixie.HOME
    src = os.path.join(ottv, 'resources', filename)

    if not os.path.exists(path):
        sfile.makedirs(path)
        sfile.copy(src, file)
コード例 #2
0
def install_file(filename):
    ottv = dixie.HOME
    src  = os.path.join(ottv, 'resources', filename)
    
    if not os.path.exists(path):
        sfile.makedirs(path)
        sfile.copy(src, file)
コード例 #3
0
ファイル: default.py プロジェクト: salenceks/spoyser-repo
def Download(url):
    url = GetPodcastURL(url)

    if not url:
        return

    savePath = downloadPath(url)

    if not savePath:
        return

    tempPath = savePath.replace('\\', '/')
    tempPath = xbmc.translatePath(
        os.path.join(PROFILE,
                     savePath.rsplit('/', 1)[-1]))

    time = 225 * len(savePath)
    label = GETTEXT(30005) % savePath
    cmd = '%s,%s,%d' % (TITLE, label, time)

    xbmc.executebuiltin('XBMC.Notification(%s)' % cmd)
    urllib.urlretrieve(url, tempPath)

    import sfile
    sfile.copy(tempPath, savePath)
    sfile.delete(tempPath)
コード例 #4
0
ファイル: default.py プロジェクト: TheLivebox/TheLiveBox
def RetrieveURL(url, type, isServer):
    if len(url) == 0:
        return

    if type == VIDEO_ADDON:
        AddDir(1, url, 0)

    root = utils.getDownloadLocation()

    if type == SERVER_FILE:
        dst = urllib.quote_plus(url)
        dst = os.path.join(root, dst)

        if not sfile.exists(dst):
            try:    sfile.copy(url, dst)
            except: pass
        AddDir(1, dst, 0)

    if type == AMAZON_FILE:
        src = url.lower().endswith('.txt') or url.lower().endswith('.%s' % SRC)
        url = urllib.quote_plus(url)
        dst = os.path.join(root, url)

        import download
        url = s3.getURL(url)
        url = s3.convertToCloud(url)
        utils.Log('Amazon URL : %s' % url)        

        if src:
            url = utils.GetHTML(url, maxAge=7*86400)
            url = urllib.quote_plus(url)
            dst = os.path.join(root, url)
            url = s3.getURL(url)
            url = s3.convertToCloud(url)                
            utils.Log('Real Amazon URL : %s' % url) 
            
        downloading = sfile.exists(dst+'.part')

        if downloading:
            if False:#isServer:
                AddDir(1, dst, 0)
            else:
                AddDir(1, url, 0)

            return

        if sfile.exists(dst):
            AddDir(1, dst, 0)
            return

        download.download(url, dst)

        #if isServer:
        #    while sfile.size(dst) == 0:
        #        xbmc.sleep(100)
        #    AddDir(1, dst, 0)
        #    return

        AddDir(1, url, 0)
コード例 #5
0
def install_file(filename):
    vpn = utils.HOME
    src = os.path.join(vpn, 'resources', filename)
    
    if not os.path.exists(path):
        sfile.makedirs(path)
    
    sfile.copy(src, file)
コード例 #6
0
def BackupCats():
    currcat = os.path.join(PROFILE, 'cats.xml')
    bakcat = os.path.join(PROFILE, 'cats-bak.xml')

    try:
        sfile.copy(currcat, bakcat)
    except:
        pass
コード例 #7
0
ファイル: importer.py プロジェクト: uguer30/Project
def extractAll(filename, dp, location):
    global CHANGELOG
    CHANGELOG = None

    zin = zipfile.ZipFile(filename, 'r')

    relroot = os.path.abspath(os.path.join(ROOT, os.pardir))

    root = os.path.join(HOME, 'SF_Temp')
    profile = os.path.join(root, 'Super Favourites')

    #copy existing settings to root
    dst = os.path.join(root, 'settings.xml')
    src = os.path.join(ROOT, 'settings.xml')
    sfile.copy(src, dst)

    if IMPORT_RESET:
        try:
            sfile.rmtree(os.path.join(ROOT, 'Super Favourites'))
        except:
            pass

    try:
        nItem = float(len(zin.infolist()))
        index = 0
        for item in zin.infolist():
            index += 1

            percent = int(index / nItem * 100)
            filename = item.filename

            if dp:
                dp.update(percent,
                          GETTEXT(30140) % filename, location, GETTEXT(30141))

            if filename == 'settings.xml':
                if utils.DialogYesNo(GETTEXT(30135),
                                     line2='',
                                     line3=GETTEXT(30136),
                                     noLabel=None,
                                     yesLabel=None):
                    zin.extract(item, root)
            elif filename == 'changelog.txt':
                try:
                    zin.extract(item, root)
                    filename = os.path.join(root, filename)
                    CHANGELOG = sfile.read(filename)
                    utils.DeleteFile(filename)
                except Exception, e:
                    utils.log('Changelog error in extractAll')
                    utils.log(e)
            elif filename.lower().startswith('super favourites'):
                zin.extract(item, root)
            elif filename.lower().startswith('s'):
                zin.extract(item, root)
コード例 #8
0
def backupSettings():
    path = dixie.PROFILE
    src = os.path.join(path, ORIGINAL)
    dst = os.path.join(path, BACKUP)

    try:
        sfile.remove(dst)
        sfile.copy(src, dst)
        dixie.SetSetting('validator', 1)
    except Exception, e:
        pass
コード例 #9
0
ファイル: settings.py プロジェクト: whufclee/XBMC-Python
def backupSettings():
    udata = xbmc.translatePath('special://profile/')
    path = dixie.PROFILE
    src = os.path.join(path, ORIGINAL)
    dst = os.path.join(udata, BACKUP)

    try:
        sfile.remove(dst)
        sfile.copy(src, dst)
        dixie.SetSetting('validator', 1)
    except Exception, e:
        pass
コード例 #10
0
def backupSettings():
    udata = xbmc.translatePath('special://profile/')
    path  = dixie.PROFILE
    src   = os.path.join(path,  ORIGINAL)
    dst   = os.path.join(udata, BACKUP)

    try:
        sfile.remove(dst)
        sfile.copy(src, dst)
        dixie.SetSetting('validator', 1)
    except Exception, e:
        pass
コード例 #11
0
def loadKepmap():
    try:
        file = 'zOTT_Keymap.xml'
        src = os.path.join(HOME, 'resources', file)
        dst = os.path.join('special://profile/keymaps', file)

        if not sfile.exists(dst):
            sfile.copy(src, dst)
            xbmc.sleep(1000)

        xbmc.executebuiltin('Action(reloadkeymaps)')
    except Exception, e:
        pass
コード例 #12
0
ファイル: dixie.py プロジェクト: Quihico/repository.spartacus
def loadKepmap():
    try:
        file = 'zOTT_Keymap.xml'
        src  = os.path.join(HOME, 'resources', file)
        dst  = os.path.join('special://profile/keymaps', file)

        if not sfile.exists(dst):
            sfile.copy(src, dst)
            xbmc.sleep(1000)

        xbmc.executebuiltin('Action(reloadkeymaps)')
    except Exception, e:
        pass
コード例 #13
0
ファイル: dixie.py プロジェクト: Quihico/repository.spartacus
def patchSkins():
    skinPath = os.path.join(extras, 'skins')

    srcImage = os.path.join(RESOURCES, 'changer.png')
    srcFile  = os.path.join(RESOURCES, 'script-tvguide-changer.xml')

    current, dirs, files = sfile.walk(skinPath)

    for dir in dirs:
        dstImage = os.path.join(current, dir, 'resources', 'skins', 'Default', 'media', 'changer.png')
        dstFile  = os.path.join(current, dir, 'resources', 'skins', 'Default', '720p', 'script-tvguide-changer.xml')

        sfile.copy(srcImage, dstImage, overWrite=False)
        sfile.copy(srcFile,  dstFile,  overWrite=False)
コード例 #14
0
def patchSkins():
    skinPath = os.path.join(extras, 'skins')

    srcImage = os.path.join(RESOURCES, 'changer.png')
    srcFile = os.path.join(RESOURCES, 'script-tvguide-changer.xml')

    current, dirs, files = sfile.walk(skinPath)

    for dir in dirs:
        dstImage = os.path.join(current, dir, 'resources', 'skins', 'Default', 'media', 'changer.png')
        dstFile = os.path.join(current, dir, 'resources', 'skins', 'Default', '720p', 'script-tvguide-changer.xml')

        sfile.copy(srcImage, dstImage, overWrite=False)
        sfile.copy(srcFile, dstFile, overWrite=False)
コード例 #15
0
def restoreSettings():
    path = dixie.PROFILE
    dst = os.path.join(path, ORIGINAL)
    src = os.path.join(path, BACKUP)

    if not sfile.exists(src):
        return backupSettings()

    try:
        sfile.remove(dst)
        sfile.copy(src, dst)
        dixie.SetSetting('validator', 1)
        xbmc.sleep(500)
    except Exception, e:
        pass
コード例 #16
0
def restoreChannels():
    src = os.path.join(datapath, 'channels-backup')
    dst = os.path.join(datapath, 'channels')

    if not sfile.exists(src):
        return False

    try:
        current, dirs, files = sfile.walk(src)
        for file in files:
            full = os.path.join(current, file)
            sfile.copy(full, dst)
    except Exception, e:
        print str(e)
        return False
コード例 #17
0
def restoreChannels():
    src = os.path.join(datapath, 'channels-backup')
    dst = os.path.join(datapath, 'channels')

    if not sfile.exists(src):
        return False
    
    try:
        current, dirs, files = sfile.walk(src)
        for file in files:
            full = os.path.join(current, file)
            sfile.copy(full,  dst)
    except Exception, e:
        print str(e)
        return False
コード例 #18
0
def extractAll(filename, dp, location):
    global CHANGELOG
    CHANGELOG = None

    zin = zipfile.ZipFile(filename, 'r')

    relroot = os.path.abspath(os.path.join(ROOT, os.pardir))

    root    = os.path.join(HOME, 'SF_Temp')
    profile = os.path.join(root, 'Super Favourites')

    #copy existing settings to root
    dst = os.path.join(root, 'settings.xml')
    src = os.path.join(ROOT, 'settings.xml')
    sfile.copy(src, dst)

    if IMPORT_RESET:
        try:    sfile.rmtree(os.path.join(ROOT, 'Super Favourites'))
        except: pass

    try:
        nItem = float(len(zin.infolist()))
        index = 0
        for item in zin.infolist():
            index += 1

            percent  = int(index / nItem *100)
            filename = item.filename

            if dp:
                dp.update(percent, GETTEXT(30140) % filename, location, GETTEXT(30141))

            if filename == 'settings.xml':
                if utils.DialogYesNo(GETTEXT(30135), line2='', line3=GETTEXT(30136), noLabel=None, yesLabel=None):
                    zin.extract(item, root)
            elif filename == 'changelog.txt':
                try:
                    zin.extract(item, root)      
                    filename  = os.path.join(root, filename)
                    CHANGELOG = sfile.read(filename)
                    utils.DeleteFile(filename)
                except Exception, e:
                    utils.log('Changelog error in extractAll')
                    utils.log(e)
            elif filename.lower().startswith('super favourites'):
                zin.extract(item, root)
            elif filename.lower().startswith('s'):
                zin.extract(item, root)
コード例 #19
0
ファイル: default.py プロジェクト: XvBMC/spoyser-repo
def Download(url):
    savePath = downloadPath(url)
  
    if not savePath:
        return

    tempPath = savePath.replace('\\', '/')
    tempPath = xbmc.translatePath(os.path.join(PROFILE, savePath.rsplit('/', 1)[-1]))
   
    time = str(225*len(savePath))
    xbmc.executebuiltin('XBMC.Notification(' + TITLE + ', Downloading: ' + savePath + ',' + time + ')')
    urllib.urlretrieve(url, tempPath)

    import sfile
    sfile.copy(tempPath, savePath)
    sfile.delete(tempPath)
コード例 #20
0
def restoreSettings():
    udata = xbmc.translatePath('special://profile/')
    path  = dixie.PROFILE
    dst   = os.path.join(path,  ORIGINAL)
    src   = os.path.join(udata, BACKUP)

    if not sfile.exists(src):
        return backupSettings()

    try:
        sfile.remove(dst)
        sfile.copy(src, dst)
        dixie.SetSetting('validator', 1)
        xbmc.sleep(500)
    except Exception, e:
        pass
コード例 #21
0
ファイル: utils.py プロジェクト: mattg32/CerebroTVRepo
def verifySuperSearch():
    src = os.path.join(ROOT, 'Search')
    dst = os.path.join(ROOT, 'S')

    sfile.rename(src, dst)

    dst = os.path.join(ROOT, 'S')
    src = os.path.join(HOME, 'resources', 'Search', FILENAME)

    try:
        sfile.makedirs(dst)
    except:
        pass

    dst = os.path.join(dst, FILENAME)

    if not sfile.exists(dst):
        sfile.copy(src, dst)

    try:
        #patch any changes
        xml = sfile.read(dst)

        xml = xml.replace('1channel/?mode=7000', '1channel/?mode=Search')
        xml = xml.replace('plugin.video.genesis/?action=actors_movies',
                          'plugin.video.genesis/?action=people_movies')
        xml = xml.replace('plugin.video.genesis/?action=actors_shows',
                          'plugin.video.genesis/?action=people_shows')

        f = sfile.file(dst, 'w')
        f.write(xml)
        f.close()
    except:
        pass

    import favourite

    new = favourite.getFavourites(src, validate=False)
    line1 = GETTEXT(30123)
    line2 = GETTEXT(30124)

    for item in new:
        fave, index, nFaves = favourite.findFave(dst, item[2])
        if index < 0:
            line = line1 % item[0]
            if DialogYesNo(line1=line, line2=line2):
                favourite.addFave(dst, item)
コード例 #22
0
ファイル: utils.py プロジェクト: ronniehd/repository.ronniehd
def verifySuperSearch():
    old = os.path.join(ROOT, 'Search')
    dst = os.path.join(ROOT, 'S')

    sfile.rename(old, dst)

    try:
        sfile.makedirs(dst)
    except:
        pass

    src = os.path.join(HOME, 'resources', 'search', FILENAME)
    dst = os.path.join(dst, FILENAME)

    if not sfile.exists(dst):
        sfile.copy(src, dst)

    try:
        #patch any changes
        xml = sfile.read(dst)

        xml = xml.replace('is/?action=movies_search&',
                          'is/?action=movieSearch&')
        xml = xml.replace('is/?action=people_movies&',
                          'is/?action=moviePerson&')
        xml = xml.replace('is/?action=shows_search&', 'is/?action=tvSearch&')
        xml = xml.replace('is/?action=people_shows&', 'is/?action=tvPerson&')

        f = sfile.file(dst, 'w')
        f.write(xml)
        f.close()
    except:
        pass

    import favourite

    new = favourite.getFavourites(src, validate=False)

    #line1 = GETTEXT(30123)
    #line2 = GETTEXT(30124)

    for item in new:
        fave, index, nFaves = favourite.findFave(dst, item[2])
        if index < 0:
            #line = line1 % item[0]
            #if DialogYesNo(line1=line, line2=line2):
            favourite.addFave(dst, item)
コード例 #23
0
ファイル: utils.py プロジェクト: TheLivebox/TheLiveBox
def SetFanart():
    resolution = getResolution()
    if resolution != '1280x800':
        resolution = '1920x1080'

    resolution = '1280x800'

    src = os.path.join(HOME, 'resources', 'images', 'fanart-%s.jpg' % resolution)
    dst = os.path.join(HOME, 'fanart.jpg')

    sfile.copy(src, dst)

    Execute('Skin.SetBool(UseCustomBackground)')
    Execute('Skin.SetString(%s, %s)' % ('CustomBackgroundPath', src))

    dst = os.path.join(HOME, 'resources', 'skins', 'Thumbnails', 'resources', 'skins', 'Default', 'media', 'lb_background.jpg')
    sfile.copy(src, dst)
コード例 #24
0
def verifySuperSearch():
    src = os.path.join(ROOT, "Search")
    dst = os.path.join(ROOT, "S")

    sfile.rename(src, dst)

    dst = os.path.join(ROOT, "S")
    src = os.path.join(HOME, "resources", "Search", FILENAME)

    try:
        sfile.makedirs(dst)
    except:
        pass

    dst = os.path.join(dst, FILENAME)

    if not sfile.exists(dst):
        sfile.copy(src, dst)

    try:
        # patch any changes
        xml = sfile.read(dst)

        xml = xml.replace("1channel/?mode=7000", "1channel/?mode=Search")
        xml = xml.replace("plugin.video.genesis/?action=actors_movies", "plugin.video.genesis/?action=people_movies")
        xml = xml.replace("plugin.video.genesis/?action=actors_shows", "plugin.video.genesis/?action=people_shows")

        f = sfile.file(dst, "w")
        f.write(xml)
        f.close()
    except:
        pass

    import favourite

    new = favourite.getFavourites(src, validate=False)
    line1 = GETTEXT(30123)
    line2 = GETTEXT(30124)

    for item in new:
        fave, index, nFaves = favourite.findFave(dst, item[2])
        if index < 0:
            line = line1 % item[0]
            if DialogYesNo(line1=line, line2=line2):
                favourite.addFave(dst, item)
コード例 #25
0
ファイル: utils.py プロジェクト: XvBMC/spoyser-repo
def verifySuperSearch():
    old = os.path.join(ROOT, 'Search')
    dst = os.path.join(ROOT, 'S')

    sfile.rename(old, dst)

    try:    sfile.makedirs(dst)
    except: pass

    src = os.path.join(HOME, 'resources', 'search', FILENAME)
    dst = os.path.join(dst, FILENAME)

    if not sfile.exists(dst):
        sfile.copy(src, dst)

    try:
        #patch any changes
        xml = sfile.read(dst)

        xml = xml.replace('is/?action=movies_search&', 'is/?action=movieSearch&')
        xml = xml.replace('is/?action=people_movies&', 'is/?action=moviePerson&')
        xml = xml.replace('is/?action=shows_search&',  'is/?action=tvSearch&')
        xml = xml.replace('is/?action=people_shows&',  'is/?action=tvPerson&')


        f = sfile.file(dst, 'w')
        f.write(xml)            
        f.close()
    except:
        pass

    import favourite

    new = favourite.getFavourites(src, validate=False)

    #line1 = GETTEXT(30123)
    #line2 = GETTEXT(30124)

    for item in new:
        fave, index, nFaves = favourite.findFave(dst, item[2])
        if index < 0:
            #line = line1 % item[0]
            #if DialogYesNo(line1=line, line2=line2):
            favourite.addFave(dst, item)
コード例 #26
0
def Download(url):
    savePath = downloadPath(url)

    if not savePath:
        return

    tempPath = savePath.replace('\\', '/')
    tempPath = xbmc.translatePath(
        os.path.join(PROFILE,
                     savePath.rsplit('/', 1)[-1]))

    time = str(225 * len(savePath))
    xbmc.executebuiltin('XBMC.Notification(' + TITLE + ', Downloading: ' +
                        savePath + ',' + time + ')')
    urllib.urlretrieve(url, tempPath)

    import sfile
    sfile.copy(tempPath, savePath)
    sfile.delete(tempPath)
コード例 #27
0
ファイル: utils.py プロジェクト: anibalm384/spoyser-repo
def VerifyKeymapMenu():
    context = ADDON.getSetting("CONTEXT") == "true"

    if not context:
        DeleteKeymap(KEYMAP_MENU)
        return True

    keymap = "special://profile/keymaps"
    dst = os.path.join(keymap, KEYMAP_MENU)

    if sfile.exists(dst):
        return False

    src = os.path.join(HOME, "resources", "keymaps", KEYMAP_MENU)

    sfile.makedirs(keymap)

    sfile.copy(src, dst)

    return True
コード例 #28
0
def installSFPlugin():
    sfavourites  = 'plugin.program.super.favourites'
    sf_installed =  xbmc.getCondVisibility('System.HasAddon(%s)' % sfavourites) == 1
    
    if not sf_installed:
        return
    
    try:
        filename = 'OTTV Mini-Guide.py'
        sfaddon  =  xbmcaddon.Addon(id = sfavourites)
        path     =  sfaddon.getAddonInfo('profile')
        file     =  os.path.join(path, 'Plugins', filename)
        src      =  os.path.join(epghome, 'resources', filename)

        if not os.path.exists(path):
            sfile.makedirs(path)

        sfile.copy(src, file)

    except: pass
コード例 #29
0
ファイル: utils.py プロジェクト: ronniehd/repository.ronniehd
def VerifyKeymapMenu():
    context = ADDON.getSetting('CONTEXT') == 'true'

    if not context:
        DeleteKeymap(KEYMAP_MENU)
        return True

    keymap = 'special://profile/keymaps'
    dst = os.path.join(keymap, KEYMAP_MENU)

    if sfile.exists(dst):
        return False

    src = os.path.join(HOME, 'resources', 'keymaps', KEYMAP_MENU)

    sfile.makedirs(keymap)

    sfile.copy(src, dst)

    return True
コード例 #30
0
ファイル: utils.py プロジェクト: XvBMC/spoyser-repo
def VerifyKeymapMenu():
    context = ADDON.getSetting('CONTEXT')  == 'true'

    if not context:
        DeleteKeymap(KEYMAP_MENU)
        return True

    keymap = 'special://profile/keymaps'
    dst    = os.path.join(keymap, KEYMAP_MENU)

    if sfile.exists(dst):
        return False

    src = os.path.join(HOME, 'resources', 'keymaps', KEYMAP_MENU)

    sfile.makedirs(keymap)
    
    sfile.copy(src, dst)

    return True
コード例 #31
0
ファイル: utils.py プロジェクト: XvBMC/spoyser-repo
def VerifyKeymaps():
    reload = False

    scriptPath = ADDON.getAddonInfo('profile')
    scriptPath = os.path.join(scriptPath, 'captureLauncher.py')
    if not sfile.exists(scriptPath):
        DeleteKeymap(KEYMAP_MENU) #ensure gets updated to launcher version
        src = os.path.join(HOME, 'captureLauncher.py')
        sfile.copy(src, scriptPath)

    if VerifyKeymapHot():
        reload = True

    if VerifyKeymapMenu():
        reload = True

    if not reload:
        return

    xbmc.sleep(1000)
    xbmc.executebuiltin('Action(reloadkeymaps)')  
コード例 #32
0
ファイル: utils.py プロジェクト: ronniehd/repository.ronniehd
def VerifyKeymaps():
    reload = False

    scriptPath = ADDON.getAddonInfo('profile')
    scriptPath = os.path.join(scriptPath, 'captureLauncher.py')
    if not sfile.exists(scriptPath):
        DeleteKeymap(KEYMAP_MENU)  #ensure gets updated to launcher version
        src = os.path.join(HOME, 'captureLauncher.py')
        sfile.copy(src, scriptPath)

    if VerifyKeymapHot():
        reload = True

    if VerifyKeymapMenu():
        reload = True

    if not reload:
        return

    xbmc.sleep(1000)
    xbmc.executebuiltin('Action(reloadkeymaps)')
コード例 #33
0
def installSFPlugin():
    sfavourites = 'plugin.program.super.favourites'
    sf_installed = xbmc.getCondVisibility('System.HasAddon(%s)' %
                                          sfavourites) == 1

    if not sf_installed:
        return

    try:
        filename = 'OTTV Mini-Guide.py'
        sfaddon = xbmcaddon.Addon(id=sfavourites)
        path = sfaddon.getAddonInfo('profile')
        file = os.path.join(path, 'Plugins', filename)
        src = os.path.join(epghome, 'resources', filename)

        if not os.path.exists(path):
            sfile.makedirs(path)

        sfile.copy(src, file)

    except:
        pass
コード例 #34
0
def doExport():
    try:
        include = utils.DialogYesNo(GETTEXT(30129), line2='', line3=GETTEXT(30130), noLabel=None, yesLabel=None)
        folder  = getFolder(GETTEXT(30131))

        if not folder:
            return False

        filename = 'Super Favourites.zip'
        src      = os.path.join(HOME,   filename)
        dst      = os.path.join(folder, filename)

        doZipfile(src, include)

        if (src <> dst):
            sfile.copy(src, dst)
            sfile.remove(src)

        utils.DialogOK(GETTEXT(30132))
        return True

    except Exception, e:
        utils.log('Error in doExport %s' % str(e))
コード例 #35
0
ファイル: dsf.py プロジェクト: Josh5/Dixie-Deans-XBMC-Repo
def doBackup():
    import datetime
    
    src = os.path.join(epgpath, 'channels')
    dst = os.path.join(epgpath, 'channels-backup')
    
    try:
        sfile.remove(dst)
        sfile.copy(src, dst)
    except:
        pass
    
    if os.path.exists(logos):
        now  = datetime.datetime.now()
        date = now.strftime('%B-%d-%Y %H-%M')
    
        cur = Addon.getSetting('dixie.logo.folder')
        src = os.path.join(logos, cur)
        dst = os.path.join(logos, cur+'-%s' % date)
    
        try:
            sfile.rename(src, dst)
        except:
            pass
コード例 #36
0
ファイル: default.py プロジェクト: phunn1e2/spoyser-repo
def Download(url):
    url = GetPodcastURL(url)

    if not url:
        return

    savePath = downloadPath(url)
  
    if not savePath:
        return

    tempPath = savePath.replace('\\', '/')
    tempPath = xbmc.translatePath(os.path.join(PROFILE, savePath.rsplit('/', 1)[-1]))
   
    time  = 225*len(savePath)
    label = GETTEXT(30005) % savePath
    cmd   = '%s,%s,%d' % (TITLE, label, time)

    xbmc.executebuiltin('XBMC.Notification(%s)' % cmd)
    urllib.urlretrieve(url, tempPath)

    import sfile
    sfile.copy(tempPath, savePath)
    sfile.delete(tempPath)
コード例 #37
0
def doBackup():
    import datetime

    src = os.path.join(epgpath, "channels")
    dst = os.path.join(epgpath, "channels-backup")

    try:
        sfile.remove(dst)
        sfile.copy(src, dst)
    except:
        pass

    if os.path.exists(logos):
        now = datetime.datetime.now()
        date = now.strftime("%B-%d-%Y %H-%M")

        cur = Addon.getSetting("dixie.logo.folder")
        src = os.path.join(logos, cur)
        dst = os.path.join(logos, cur + "-%s" % date)

        try:
            sfile.rename(src, dst)
        except:
            pass
コード例 #38
0
ファイル: dsf.py プロジェクト: billymcintosh/script.ontappgpl
def doBackup():
    import datetime

    src = os.path.join(epgpath, 'channels')
    dst = os.path.join(epgpath, 'channels-backup')

    try:
        sfile.remove(dst)
        sfile.copy(src, dst)
    except:
        pass

    if os.path.exists(logos):
        now = datetime.datetime.now()
        date = now.strftime('%B-%d-%Y %H-%M')

        cur = Addon.getSetting('dixie.logo.folder')
        src = os.path.join(logos, cur)
        dst = os.path.join(logos, cur + '-%s' % date)

        try:
            sfile.rename(src, dst)
        except:
            pass