Im totally unfamiliar with python - and need a little help.
Im trying to add one command to superkaramba theme - it must be done in python file

I know how that command looks when given from command line (bash)
command is:

dcop knotify default notify eventname appname 'You got mail' '/home/server/superkaramba/popcheck/gotmail.wav' ' ' 3 0

I tried something like this ( It was just a guest - so don't laught: :rolleyes:)

playCommand = ["dcop knotify default notify eventname appname","<p>%s</p>" %('/home[B]/[/B]server/superkaramba/popcheck/gotmail.wav'), ' ',3,0]
( it ofcourse was not right ):sad:

next step will be:
karamba.executeInteractive(widget, playCommand)

So I will very much aproxiate If someone can give me the right syntax to use

10 Years
Discussion Span
Last Post by prinitor

Might be it is easier if I include that function as it is described:

void notify(QString event,QString fromApp,QString text,QString sound,QString file,int present,int level)

Please, someone help me with this??


Looks a lot more like C or C++ rather than Python!

Superkarampa uses two kind of files .theme and .py
Python files has command import karamba - so there are some karamba specifig funktions - like: karamba.executeInteractive(widget, command), which i want to use.
So it is possible to command directly for example KDE applications - use sound , browsers, email clients etc..

That command:
void notify(QString event,QString fromApp,QString text,QString sound,QString file,int present,int level)
is for dcop ( DCOP is KDE's interprocess communication (IPC)/remote procedure call (RPC) technology). It is nice because with that users default aplications are used.

I know that Kdialog can be used in python very much same way (used it myself)
forexample command line command:

kdialog --title "Input dialog" --inputbox "What name would you like to use" "default Name".

can be "translated to python"

default_name = "Default Name"
command = ["kdialog", "--title", "[B]What name would you like to use[/B]", "--inputbox","<p>%s</p>" %("Account username:"),default_name]

and then ececuted by karamba:
commandpid = karamba.executeInteractive(widget, command)

That command which I like to use:
dcop knotify default notify eventname appname 'You got mail!' '/path/to/gotmail.wav' '' 3 0

Is too complicated ( for me ) to figure out because it is a compination of strings and int's ( and I have no experiment of python )
the beginning:

dcop knotify default - can be thought as application

next there is command:
- with following information
eventname - string
appname - string
text - string
soud - string
present - int
level int

I have problem to figure out how to write it so that strings and int's are right

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.