Developer Corner

logging system

Problem

at the moment we give a bool debug parameter to each function parameter over to all/most constructors and use it like that:

if self.debug: print "...." 

Possible Solutions:

for configuration using a seperate logging.conf and load use it in submodules without additional configuration as described here


more modular code

  • divide code in more packages/modules/classes and methods

better file-structure

examples:

Current Better _Reason
canta/display/core_init.py canta/core.py init is a constructor and display makes also no sense alternativ we could do it in a game directory DONE
canta/display/sing_screen.py canta/screen/game.py display makes here also no sense
canta/song/song_editor.py canta/screen/editor.py its also a "screen" or window so in the same dir as sing_screen
canta/song/song_segment.py canta/song/segment.py segment is in the package song so it's naturaly a song segment
canta/song/song_line.py canta/song/line.py same reason as segment
canta/event/observer/cuby_list.py canta/?/cube_list.py it's no observer so it makes no sense possible would be gui_obj ?
canta/event/observer/main_cube_observer.py canta/event/observer/target_cubes.py observer is double and main is inexact

Also available in: HTML TXT