Does HTTP web server in kodi system the same of SimpleHTTPServer ?
#46
(2018-09-27, 21:36)Spiderfish Wrote: it works now like this:


source = 'smb://kodi:[email protected]/userdata/addon_data/test2.py'
destination = 'special://home/userdata/addon_data/test.py'
success  = xbmcvfs.copy(source, destination)


thanks
Good stuff, glad you've got it working Smile

And see, 3 lines of code and leveraging Kodi's inbuilt routines is much better than installing unnecessary software and adding bloat and cpu cycles to your machine for no good reason.

Now, I don't know what test2.py does, but I do remember that you were importing it and then checking for the value in 'x'. If it's the only variable or value that you need, you could write the value to a file on the remote machine and then read it into a script with

Code:
remote_file = xbmcvfs.File('smb://kodi:[email protected]/userdata/addon_data/test2.var')
x = remote_file.read()
remote_file.close()
if x == ....... etc

Again, it depends on what you are trying to achieve and if you just need the variable value, or the full script.  Even if you need multiple values, as long as you parse the file in the same way that you wrote it out (comma/tab/newline separated) then you can transfer multiple values this way.
Learning Linux the hard way !!
Reply
#47
yes you are right!

Actually I was wanted to send x value with executing addon through json-rpc and want to send x value withing json-rpc file this is the script from sender :

data = '{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.addon"},"id":1}'

then the receiver script in addon will take the x value and use it in it's IF function Huh
Reply

Logout Mark Read Team Forum Stats Members Help
Does HTTP web server in kodi system the same of SimpleHTTPServer ?0