Use new features of PyOtherSide 1.1.0

This commit is contained in:
Thomas Perl 2014-02-06 23:49:45 +01:00
parent 2ef9bfe581
commit 238cac1eb8
2 changed files with 11 additions and 6 deletions

View file

@ -40,9 +40,13 @@ Python {
signal updatedPodcast(var podcast) signal updatedPodcast(var podcast)
Component.onCompleted: { Component.onCompleted: {
setHandler('hello', function (version, copyright) { setHandler('hello', function (version, copyright, date, url) {
console.log('gPodder version ' + version + ' starting up'); console.log('gPodder ' + version + ' (' + date + ')');
console.log('Copyright: ' + copyright); console.log(url);
console.log(copyright);
console.log('PyOtherSide ' + py.pluginVersion());
console.log('Python ' + py.pythonVersion());
}); });
setHandler('downloading', py.downloading); setHandler('downloading', py.downloading);
@ -57,8 +61,7 @@ Python {
setHandler('updated-podcast', py.updatedPodcast); setHandler('updated-podcast', py.updatedPodcast);
setHandler('refreshing', function(v) { py.refreshing = v; }); setHandler('refreshing', function(v) { py.refreshing = v; });
var path = Qt.resolvedUrl('../..').substr('file://'.length); addImportPath(Qt.resolvedUrl('../..'));
addImportPath(path);
// Load the Python side of things // Load the Python side of things
importModule('main', function() { importModule('main', function() {

View file

@ -294,7 +294,9 @@ class gPotherSide:
gpotherside = gPotherSide() gpotherside = gPotherSide()
pyotherside.atexit(gpotherside.atexit) pyotherside.atexit(gpotherside.atexit)
pyotherside.send('hello', gpodder.__version__, gpodder.__copyright__) pyotherside.send('hello',
gpodder.__version__, gpodder.__copyright__,
gpodder.__date__, gpodder.__url__)
# Exposed API Endpoints for calls from QML # Exposed API Endpoints for calls from QML
initialize = gpotherside.initialize initialize = gpotherside.initialize