2009/5/6 Stéphane Bisinger <stephane.bisin...@gmail.com>:
> Hi,
>
> 2009/5/6 Boris "billiob" Faure <bill...@gmail.com>:
>> Here's how i think this should be done :
>> all those stuff you modify (nick, dp = display picture, music, psm =
>> pm) should be stored in what i want to call "profile". Those should be
>> properties : set + get.
>
> Yep I agree, these are all info part of a user profile.

A UI can have it's CLW (CL Window...) register for events about
profile changed, but it's not mandatory.

>> Then, we should have a real EventManager where you can register for
>> events and emit events. Look at how it's done for the contact list.
>
> There it is done with goject's signals, are we keeping that?

It's not done with gobjects, just plain python code, no threading, no
real event loop... look at the code ;)

>
>> When you register for an event, you say if you want to edit the data
>> sent (will be used by plugins...) or if the receiver is read only.
>> Then, each callbacks registered for a specific event are stored in a
>> list : rw in the head, ro in the end.
>
> Here I have a couple of doubts: this way you order callbacks so that
> ro callbacks get called only after the information has been modified
> by the other callbacks. But what about the rw callbacks? I mean there
> could be issues of ordering there too, IE if one cb depends on another
> being already called... How do we deal with that? (Not that I have
> better suggestions...)
>
>> When we Emit, we just do a "for each" on that list. rw callbacks will
>> return the value changed.
>> Or should all callback return the view given as parameter?
>
> It should give back the modified view, I think it makes it easier overall

Yes, and maybe have a "priority list"... this sucks... i don't know
how to fix that.


>> In the UI, you just have a "onProfileViewUpdated(core, view)" and with
>> the core, you do a core.profile.nick = "LoL :p" and
>> core.profile.nick will emit that the profile has been updated...
>
> I think you mean core.profile.setNick("LoL :p") ;)

No, i meant :
core.profile.nick = "LoL :p"
just like :
  22     @property
  23     def rad():
  24         '''The angle in radians'''
  25         def fget(self):
  26             return self._rad
  27         def fset(self, angle):
  28             if isinstance(angle, Angle):
  29                 angle = angle.rad
  30             self._rad = float(angle)
(from http://wiki.python.org/moin/PythonDecoratorLibrary)


-- 
Boris 'billiob' Faure

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel

Reply via email to