Exemplo n.º 1
0
def check_path():

	if not "backupdir" in USB:
		if HOME in USB:
			dialog = xbmcgui.Dialog()
			dialog.ok(AddonTitle, "Invalid path selected for your backups. The path you have selected will be removed during backup and cause an error. Please pick another path that is not in the Kodi directory")
			plugintools.open_settings_dialog()
			sys.exit(0)
	if not os.path.exists(USB):
		try:
			os.makedirs(USB)
		except:
			dialog = xbmcgui.Dialog()
			dialog.ok(AddonTitle, "Invalid path selected for your backups. The directory specified does not exist or is not writable.")
			plugintools.open_settings_dialog()
			sys.exit(0)
Exemplo n.º 2
0
    choice = xbmcgui.Dialog().yesno(
        AddonTitle,
        '[COLOR white]Do you agree to the terms and conditions of this addon?[/COLOR]',
        '',
        yeslabel='[COLOR lime]YES[/COLOR]',
        nolabel='[COLOR orangered]NO[/COLOR]')
    if choice == 1:
        f = open(INFO, mode='r')
        msg = f.read()
        f.close()
        common.TextBoxes("%s" % msg)
        dialog.ok(
            AddonTitle,
            "[COLOR pink]We can see this is the first time you have used XXX-O-DUS. The next prompt is important as it will allow you to enable the history section of the addon and it will also allow you to select the location you would like to be used to download videos.[/COLOR]"
        )
        plugintools.open_settings_dialog()
        open(I_AGREE, 'w')
    else:
        sys.exit(0)

download_location = plugintools.get_setting("download_location")
DOWNLOAD_FOLDER = xbmc.translatePath(download_location)
if not os.path.exists(DOWNLOAD_FOLDER):
    os.makedirs(DOWNLOAD_FOLDER)

if not os.path.isfile(HISTORY_FILE):
    f = open(HISTORY_FILE, 'w')
    f.write('#START OF FILE#')
    f.close()
if not os.path.isfile(FAVOURITES_FILE):
    f = open(FAVOURITES_FILE, 'w')