Python Sript Related Questions

Hello All

I recently joined the Dia mailing list and i have some questions regarding the scripting capability using python. Yes, i have searched the mailing list for answers to my questions and i did not find any, Yes i might be using the wrong words for what i want :-)

I am using Dia 0.94, What i am trying to do is to change the property of an element. I have looked at the example scripts but there is no clear explanation of how to do it. What i am trying to do is this:

import dia


#So far so good, now let me change a color["fill_colour"]

And here is where i get the
TypeError: 'DiaColor' object has only read-only attributes (assign to .red)

What does it mean when it says (assign to .red) ? I AM trying to assign it to .red (I have also tried and"1.0" with no luck :-( )

Then i tried to do something like:["fill_colour"].value=DiaColor(0,0,0)

Which did not work as well because i can not instantiate DiaColor (Anything similar to type casting with Python that i am not aware of?)

Is there a way to completely reload a package in Python? I hate to restart Dia everytime i am making a change to my script.

How does the dia.register_* family of functions works? I mean, i am assigning a function to a particular menu item but it does not appear there :-/ am i missing something there?

Looking forward to hearing from you

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]