Re: [pygtk] How to organize my app?

2010-01-22 Thread Tobias Weber
On 21.01.2010, at 23:14, middleofdre...@gmail.com wrote:

I think you're looking for the MVC pattern. You can read it up and do  
it on foot or use a framework like Kiwi.

 For example - I have main class in main file and I want to move  
 widgets (loading widgets from gladefile) into new file.

View

 Or signal handlers - how to move them into other file and do it right?

Controller

 self.gui.some_widget.show()


This is exactly how it'd look with 
http://sourceforge.net/apps/trac/pygtkmvc/wiki
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] How to organize my app?

2010-01-22 Thread middleofdre...@gmail.com
I forgot something like MVC exists
Is it hard to learn for example pygtkmvc and rebuild existing app (which is
written in chaos mode - everything everywhere)? In which point of my app I
should start? I'll give you the code... as messy as it is.

http://github.com/middleofdreams/pybber

comments are in polish but it doesn't really matter.

2010/1/22 Tobias Weber t...@celvina.de

 On 21.01.2010, at 23:14, middleofdre...@gmail.com wrote:

 I think you're looking for the MVC pattern. You can read it up and do
 it on foot or use a framework like Kiwi.

  For example - I have main class in main file and I want to move
  widgets (loading widgets from gladefile) into new file.

 View

  Or signal handlers - how to move them into other file and do it right?

 Controller

  self.gui.some_widget.show()


 This is exactly how it'd look with
 http://sourceforge.net/apps/trac/pygtkmvc/wiki
 ___
 pygtk mailing list   pygtk@daa.com.au
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://faq.pygtk.org/

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] PyGtk on Windows (SOLVED)

2010-01-22 Thread Timo
On 21-01-10 18:36, John Stowers wrote:

 I saw you saying that gtk+-2.18 is broken on Windows a couple of times.
 But I used it about 2-3 months ago for my application, and everything
 worked ok.
  
 That certainly sounds promising, would you mind testing something for me
 plese?

 Can you please launch gtk-demo with the latest Gtk+ bundle and confirm
 that you see the behaviour I describe in

 https://bugzilla.gnome.org/show_bug.cgi?id=607603

I currently don't have access to a Windows install, but I will try it soon.

I can tell you what I used for my app though. It was with GTK+ 2.18.3 
and PyGTK 2.12.1 (both the latest at that time).
It worked as it should on the several Windows XP it was tested on.

Timo

 John




___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] How to organize my app?

2010-01-22 Thread Tomeu Vizoso
Sorry for not directly replying your question, but (if you have the
interest) I would recommend reading up about object oriented design
and design patterns. Code organization is an important aspect of
controlling complexity.

http://en.wikipedia.org/wiki/GRASP_%28Object_Oriented_Design%29
http://en.wikipedia.org/wiki/Solid_%28Object_Oriented_Design%29
http://en.wikipedia.org/wiki/Code_smell
http://c2.com/cgi/wiki?CodeSmell

After you grasp the concepts, by reading others' code you can learn
lots of tricks.

Regards,

Tomeu

On Thu, Jan 21, 2010 at 23:14, middleofdre...@gmail.com
middleofdre...@gmail.com wrote:
 Hi,
 I don't have experience in creating big apps. I want to know how to split
 app into files. For example - I have main class in main file and I want to
 move widgets (loading widgets from gladefile) into new file. It should be in
 the mainclass i think.. but i can't import something inside class (it works
 but it's not proper). Or signal handlers - how to move them into other file
 and do it right? Another thing is i have some (not main) class, but it
 should interact with gui (some changes like showing widgets etc). It's
 assigned in mainclass and constructor of it looks like this:
 __init__(gui):
 self.gui=gui
 and then.. in functions of this class I can change for example
 self.gui.some_widget.show()
 And again.. I don't think it's proper method for doing this.
 Some tips, please?


 ___
 pygtk mailing list   pygtk@daa.com.au
 http://www.daa.com.au/mailman/listinfo/pygtk
 Read the PyGTK FAQ: http://faq.pygtk.org/




-- 
«Sugar Labs is anyone who participates in improving and using Sugar.
What Sugar Labs does is determined by the participants.» - David
Farning
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


[pygtk] ANNOUNCE: python-gudev 147 (initial release)

2010-01-22 Thread John Stowers
What is it?
===

python-gudev is a Python (PyGObject) binding to the GUDev udev library

What's changed in 147


 * Initial release, complete coverage of the GUDev 147 API

Where can I get it?
===

Source code:
http://www.johnstowers.co.nz/files/python-gudev/python-gudev-147.tar.gz

Home page:
http://github.com/nzjrs/python-gudev

Notes
==

 * I created this library because the PyGI (gobject introspection for
python) is not yet mature. I expect this package will be useful and
sufficient for those applications written in python that want to move
away from using HAL, but for whom PyGI is not available.

 * Help in packaging this in the major distributions would be
appreciated.

John Stowers

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/