Re: need help on my javascript plasmoid

2009-07-24 Thread Richard Dale
On Thu, Jul 23, 2009 at 6:37 PM, Aaron J. Seigoase...@kde.org wrote:
 On Thursday 23 July 2009, Richard Dale wrote:
 Not specifically, but Arno Rehn is doing a GSOC project working on a
 bindings generator that uses one of Roberto Raggi's parsers. He said
 that the parser used for the QtScript bindings was about the oldest of
 the lot (the one on gitorious - is that the same as the Amarok one?).
 Arno is using the parser from KDevelop with KDE dependencies removed.
 At the moment Roberto is actively maintaining the parser used in
 QtCreator. So I think it would be a really good idea to consolidate
 all these parsers, so that KDE only actually uses one of them. Then we
 could use that one for QtScript bindings generation for the Qt and KDE
 classes.

 hmmm... ok, good to know. my concern is that we just remain in limbo forever
 with the ecma script bindings. i really don't care if we have three generators
 (Or whatever) as long as we have bindings; but that's just me as a selfish
 prospective user of said bindings speaking ;)

 hopefully Arno Rehn's project will produce something we can use, then?
Well only Arno's expertise about the state of the various 'Raggi'
parsers and how to use them. The tool he is writing produces bindings
for the 'Smoke' libs used by Ruby, C# and Perl etc. and not QtScript.
If we want to produce bindings for the KDE classes for ECMA script, I
think upgrading the parser would be the best first step. I don't mind
helping if it is something that would be popular, as opposed to 'just
for completeness'.

But I wonder if the current QtScript bindings with some enhancements
like being able to use a HTTP download Plasma service and so on, would
be good enough. By the time you have dependencies on large KDE
bindings libs then maybe the advantage of QtScript over Ruby and
Python of it always being installed would be negated. And for larger
more complex applets I certainly think JavaScript could start being a
bit of a pain compared with Python/Ruby. I'd like to hear some
feedback from the Amarok guys about what sort of programmer the
QtScript bindings were being used by, and how well they are coping
with the full Qt api.

-- Richard
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: need help on my javascript plasmoid

2009-07-24 Thread Aaron J. Seigo
On Friday 24 July 2009, Richard Dale wrote:
 think upgrading the parser would be the best first step. I don't mind
 helping if it is something that would be popular, as opposed to 'just
 for completeness'.

i'd like to see JavaScript be _the_ recommended method for writing plasmoids. 
it's nice to have Python and Ruby as options, but JavaScript really ought to 
be the preferred solution (including for us on the plasma team).

 But I wonder if the current QtScript bindings with some enhancements
 like being able to use a HTTP download Plasma service and so on, would
 be good enough. By the time you have dependencies on large KDE
 bindings libs then maybe the advantage of QtScript over Ruby and
 Python of it always being installed would be negated.

well, plasma already relies on kdelibs, obviously, so sucking in kdelibs isn't 
an issue.

the benefits of JavaScript are:

* way more people in this world know ECMA Script (for better or worse)

* it has zero extra dependencies over what Plasma already has (qt, kdelibs)

* it's realistic to consider sandboxing ECMA Script

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: need help on my javascript plasmoid

2009-07-24 Thread Aaron J. Seigo
On Thursday 23 July 2009, Patrick Aljord wrote:
 Another feature that would be cool for JS plasmoids (and all scripted
 plasmoids in general), the possibility for plasmoids to update
 automatically like firefox and chrome extensions
 (http://dev.chromium.org/developers/design-documents/extensions/autoupdate)
, that could be done by adding an update_url to plasmoids
 metadata.desktop file :)

this should probably be handled using get hot new stuff. i've already talked 
with them about this feature.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: need help on my javascript plasmoid

2009-07-23 Thread Patrick Aljord
On Wed, Jul 22, 2009 at 11:24 PM, Aaron J. Seigoase...@kde.org wrote:
 On Wednesday 22 July 2009, Patrick Aljord wrote:
 xmlUrl = new QUrl( http://ws.audioscrobbler.com; );
 http   = new QHttp;

 * do not use QHttp

 * the JS bindings do not have support for fetching things via KIO; note that
 this represents a security issue that would need to be address _FIRST_ before
 being added to the simple JS bindings

 * the simple JS bindings for plasma are NOT INTENDED to be complete bindings
 for a number of reasons (security, easy of learning, etc)

 * a full set should hopefully appear in qt 4.4 (richard, did you ever find
 time to fiddle with that while at GCDS?)

 * what, precisely, are you trying to accomplish? (just to understand the use
 case properly)

 --

Hey Aaron,

Thanks for your answer. I'm trying to fetch an xml file from a website
that has an xml api and display the results in my plasmoid. Also, I
understand the security issues so I'm curious if the fact that it's
possible in ruby and python could also give security issues?

Thanks in advance,

Pat
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: need help on my javascript plasmoid

2009-07-23 Thread Aaron J. Seigo
On Thursday 23 July 2009, Patrick Aljord wrote:
 Thanks for your answer. I'm trying to fetch an xml file from a website
 that has an xml api and display the results in my plasmoid. 

will you be parsing the xml before displaying it in some custom manner? (just 
wondering what all would be needed to be added to make this easy to 
accomplish)

 Also, I
 understand the security issues so I'm curious if the fact that it's
 possible in ruby and python could also give security issues?

yes. c/c++ is inherently un-securable due to the ability to fiddle with memory 
at a rather low level. ruby and python are better in that regard, but 
otherwise (given today's runtime envs for each) are capable of far too many 
other things with very few ways of actually sandboxing them appropriately to 
be considered for a secure scripting system. 

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: need help on my javascript plasmoid

2009-07-23 Thread Patrick Aljord
On Thu, Jul 23, 2009 at 2:28 AM, Aaron J. Seigoase...@kde.org wrote:
 On Thursday 23 July 2009, Patrick Aljord wrote:
 Thanks for your answer. I'm trying to fetch an xml file from a website
 that has an xml api and display the results in my plasmoid.

 will you be parsing the xml before displaying it in some custom manner? (just
 wondering what all would be needed to be added to make this easy to
 accomplish)


Yes I would be parsing the xml before displaying, that would be useful
to show a feed to though for that I could use a plasma engine I guess.
It would be good to be able to download and parse xml and json (well
json is easy with JS). And even better, also being able to POST http
request. That way we'd be able to interact with most web api (eg
twitter, wikipedia, feeds etc).

 ruby and python are better in that regard, but
 otherwise (given today's runtime envs for each) are capable of far too many

I think right now I could write a ruby script  that execute
File.rm_f('~'), upload it on kde-apps and people would be able to
install that directly from the desktop, no?
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: need help on my javascript plasmoid

2009-07-23 Thread Richard Dale
On Thu, Jul 23, 2009 at 5:24 AM, Aaron J. Seigoase...@kde.org wrote:
 * a full set should hopefully appear in qt 4.4 (richard, did you ever find
 time to fiddle with that while at GCDS?)
Not specifically, but Arno Rehn is doing a GSOC project working on a
bindings generator that uses one of Roberto Raggi's parsers. He said
that the parser used for the QtScript bindings was about the oldest of
the lot (the one on gitorious - is that the same as the Amarok one?).
Arno is using the parser from KDevelop with KDE dependencies removed.
At the moment Roberto is actively maintaining the parser used in
QtCreator. So I think it would be a really good idea to consolidate
all these parsers, so that KDE only actually uses one of them. Then we
could use that one for QtScript bindings generation for the Qt and KDE
classes.

-- Richard
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: need help on my javascript plasmoid

2009-07-23 Thread Aaron J. Seigo
On Thursday 23 July 2009, Patrick Aljord wrote:
 On Thu, Jul 23, 2009 at 2:28 AM, Aaron J. Seigoase...@kde.org wrote:
  On Thursday 23 July 2009, Patrick Aljord wrote:
  Thanks for your answer. I'm trying to fetch an xml file from a website
  that has an xml api and display the results in my plasmoid.
 
  will you be parsing the xml before displaying it in some custom manner?
  (just wondering what all would be needed to be added to make this easy to
  accomplish)

 Yes I would be parsing the xml before displaying, that would be useful
 to show a feed to though for that I could use a plasma engine I guess.
 It would be good to be able to download and parse xml and json (well
 json is easy with JS). And even better, also being able to POST http
 request. That way we'd be able to interact with most web api (eg
 twitter, wikipedia, feeds etc).

yes, i almost wonder if we shouldn't have some generic web api interaction 
bits in there, either via an engine or a Plasma::Service a Service plugin 
is probably the way to go, i think, and would be pretty easy to write, indeed.

  ruby and python are better in that regard, but
  otherwise (given today's runtime envs for each) are capable of far too
  many

 I think right now I could write a ruby script  that execute
 File.rm_f('~'), upload it on kde-apps and people would be able to
 install that directly from the desktop, no?

yes. not great, i know.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: need help on my javascript plasmoid

2009-07-23 Thread Aaron J. Seigo
On Thursday 23 July 2009, Richard Dale wrote:
 Not specifically, but Arno Rehn is doing a GSOC project working on a
 bindings generator that uses one of Roberto Raggi's parsers. He said
 that the parser used for the QtScript bindings was about the oldest of
 the lot (the one on gitorious - is that the same as the Amarok one?).
 Arno is using the parser from KDevelop with KDE dependencies removed.
 At the moment Roberto is actively maintaining the parser used in
 QtCreator. So I think it would be a really good idea to consolidate
 all these parsers, so that KDE only actually uses one of them. Then we
 could use that one for QtScript bindings generation for the Qt and KDE
 classes.

hmmm... ok, good to know. my concern is that we just remain in limbo forever 
with the ecma script bindings. i really don't care if we have three generators 
(Or whatever) as long as we have bindings; but that's just me as a selfish 
prospective user of said bindings speaking ;)

hopefully Arno Rehn's project will produce something we can use, then?

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: need help on my javascript plasmoid

2009-07-23 Thread Patrick Aljord
On Thu, Jul 23, 2009 at 12:36 PM, Aaron J. Seigoase...@kde.org wrote:
 I think right now I could write a ruby script  that execute
 File.rm_f('~'), upload it on kde-apps and people would be able to
 install that directly from the desktop, no?

 yes. not great, i know.


Maybe we could do one of the following for now:

a) put a warning when the user install a non JS plasmoid from GHNS
b) put a system on kde-apps.org where people could flag the plasmoids
as secure or not. Only the one who have been flagged secure by X user
could be installable on GHNS

I guess it's too late for kde 4.3, especially b).
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: need help on my javascript plasmoid

2009-07-23 Thread Aaron J. Seigo
On Thursday 23 July 2009, Patrick Aljord wrote:
 b) put a system on kde-apps.org where people could flag the plasmoids

s,people,plasma dev team,

some of these things will become a lot easier with Rob's work on remote 
widgets

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: need help on my javascript plasmoid

2009-07-23 Thread Patrick Aljord
Another feature that would be cool for JS plasmoids (and all scripted
plasmoids in general), the possibility for plasmoids to update
automatically like firefox and chrome extensions
(http://dev.chromium.org/developers/design-documents/extensions/autoupdate),
that could be done by adding an update_url to plasmoids
metadata.desktop file :)
Then again plasma devs would need to flag the update as OK first
before the plasmoids updates automatically unless plasmoids are not
downloaded from kde-apps.org, maybe when installing a plasmoid from a
host, the user would have to confirm he/she trusts that hosts so that
future updates may apply automatically.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


need help on my javascript plasmoid

2009-07-22 Thread Patrick Aljord
Hey all,

I've been following the Getting Started tutorial on techbase and it works great.
Since then, I've been trying to use QHttp and other Qt classes in my
main.js file but the plasmoid fails. I'm trying to download an xml
file such as in this amarok script example:
http://amarok.kde.org/forum/index.php?topic=17084.0

Something like that:


Importer.loadQtBinding( qt.core );
Importer.loadQtBinding( qt.xml );

xmlUrl = new QUrl( http://ws.audioscrobbler.com; );
http   = new QHttp;

Any idea why it fails? By the way, how do I get any debugging? When I
do plasmoidviewer . I just get the plasmoid with the Script
initialization failed message, nothing more.

Thanks in advance

Pat
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: need help on my javascript plasmoid

2009-07-22 Thread Patrick Aljord
On Wed, Jul 22, 2009 at 3:03 AM, Marco Martinnotm...@gmail.com wrote:
 in amarok js bindings are complete and autogenerated.
 for now in plasma hey are just a tiny subset and you can call only stuff
 explicitly exported by libplasma
 probably in the future we will have complete bindings too


Ok thanks for the info, that kinds of limits a lot what can be done
with JS, I hope it will improve soon. Do you know whether the ruby and
python engines are limited in the same way too?
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: need help on my javascript plasmoid

2009-07-22 Thread Marco Martin
On Wednesday 22 July 2009, Patrick Aljord wrote:
 On Wed, Jul 22, 2009 at 3:03 AM, Marco Martinnotm...@gmail.com wrote:
  in amarok js bindings are complete and autogenerated.
  for now in plasma hey are just a tiny subset and you can call only stuff
  explicitly exported by libplasma
  probably in the future we will have complete bindings too

no, from python and ruby pretty much everything from qt and kdelibs shoud be 
available


 Ok thanks for the info, that kinds of limits a lot what can be done
 with JS, I hope it will improve soon. Do you know whether the ruby and
 python engines are limited in the same way too?
 ___
 Plasma-devel mailing list
 Plasma-devel@kde.org
 https://mail.kde.org/mailman/listinfo/plasma-devel


-- 
Marco Martin
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: need help on my javascript plasmoid

2009-07-22 Thread Aaron J. Seigo
On Wednesday 22 July 2009, Patrick Aljord wrote:
 xmlUrl = new QUrl( http://ws.audioscrobbler.com; );
 http   = new QHttp;

* do not use QHttp

* the JS bindings do not have support for fetching things via KIO; note that 
this represents a security issue that would need to be address _FIRST_ before 
being added to the simple JS bindings

* the simple JS bindings for plasma are NOT INTENDED to be complete bindings 
for a number of reasons (security, easy of learning, etc)

* a full set should hopefully appear in qt 4.4 (richard, did you ever find 
time to fiddle with that while at GCDS?)

* what, precisely, are you trying to accomplish? (just to understand the use 
case properly)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel