This forum has been archived. All content is frozen. Please use KDE Discuss instead.

script: data files

Tags: None
(comma "," separated)
JJL
Karma
0

script: data files

Sun Nov 27, 2005 12:13 am
Hi,

I\'m writing a script for amaroK which needs some data read from files.
I create the .amarokscript.tar as described in the wiki with my script and my data. Installation is ok, but when the script is started, the cwd is set to ~/.kde/.../script-data/ so I cannot open my data files stored in script/
Can I install some files in script-data ? if yes how ?

Thanks
JJL
User avatar
eean
KDE Developer
Posts
1016
Karma
0
OS

Re:script: data files

Sun Nov 27, 2005 3:37 pm
Your scripting language should have some facility to lookup what the filename of the running script is. You can use this to derive what directory the script was installed in.


Amarok Developer
JJL
Karma
0

Re:script: data files

Sun Nov 27, 2005 8:48 pm
Ok, so i\'ll do this way.

For information in python I get it using :
[code:1]os.path.expanduser(\"~/.kde/share/apps/amarok/scripts/\"«») + os.path.basename(sys.argv[0])[:-3][/code:1]
with a script named scriptname.py

Thank you


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], daret, Evergrowing, Google [Bot], lockheed, sandyvee, Sogou [Bot]