File size: 653 Bytes
ce4b573 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # StationPlaylist add-on installation tasks
# Copyright 2015-2021 Joseph Lee, released under GPL.
# Provides needed routines during add-on installation and removal.
# Partly based on other add-ons, particularly Place Markers by Noelia Martinez (thanks add-on authors).
import addonHandler
addonHandler.initTranslation()
def onInstall():
import os
import shutil
profiles = os.path.join(os.path.dirname(__file__), "..", "stationPlaylist", "profiles")
# Import old profiles.
if os.path.exists(profiles):
newProfiles = os.path.join(os.path.dirname(__file__), "profiles")
try:
shutil.copytree(profiles, newProfiles)
except IOError:
pass
|