include userdata with plugin or get plugin folder?
#1
I need a data file with my addon. This should be (I suppose) stored in userdata/addon_data/plugin.name folder. But that folder is not included in zip that the addon is zipped to when making zip for repository....

Is there a way to include this folder?

If not, I need to get the folder of the addon? I am talking about actual addon folder, not userdata (so xbmc.translatePath( __addon__.getAddonInfo('profile').decode('utf-8') ) is not gonna help me, that points to USERDATA folder....

If this is impossible, where do I keep this extra file? It holds data, not code.

Thanx
D.
Reply
#2
you need to get the addon_data folder of your addon?

try appending the addonid to the addon_data folder

Code:
addon         = xbmcaddon.Addon()
addon_path    = addon.getAddonInfo('path')
addonID       = addon.getAddonInfo('id')
addonUserDataFolder = xbmc.translatePath("special://profile/addon_data/"+addonID)
Reply
#3
No that is not the problem Smile

If I keep this file in userdata/addon_data/plugin.name - I can't include that file with the addon in repository. It could be CREATED on addon start, but I can't include it. So it must be in addon's own folder, where python script is.

So I want to know path to ADDON FOLDER, because the files from addon folders can be included with addon...
Reply
#4
Path to the userdata addon folder:
Code:
Addon.getAddonInfo('path')

Path to the addon_data addon folder:
Code:
Addon.getAddonInfo('profile')


Sent from my iPhone
Reply
#5
I have not tried it myself bit I think your addon should have access to the path where it is located -Addon.getAddonInfo('path')

you can include the file in repository and then check if it exists.
Code:
if not os.path.exists( path_and_filename ):

copy it from Addon.getAddonInfo('path') to Addon.getAddonInfo('profile')

or you can create it into the addon_data addon folder
Reply
#6
Yes, that seems to be it. Will give it a try, thanx.

I just realized I can put this file on the net and download it to userdata folder anyway Smile Smile Smile
Reply

Logout Mark Read Team Forum Stats Members Help
include userdata with plugin or get plugin folder?0