comparison engine/extensions/pychan/__init__.py @ 251:92c7ce181881

Documentation cross reference fixes.
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Fri, 27 Mar 2009 11:52:55 +0000
parents 756b895e1dab
children 51cc05d862f2
comparison
equal deleted inserted replaced
250:6527d53c7133 251:92c7ce181881
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 # coding: utf-8
3 2
4 """\ 3 """\
5 Pythonic Guichan Wrapper - PyChan 4 Pythonic Guichan Wrapper - PyChan
6 ================================= 5 =================================
7 6
98 }) 97 })
99 98
100 Other important places to look for information: 99 Other important places to look for information:
101 - L{widgets.Widget} - Attributes explained. 100 - L{widgets.Widget} - Attributes explained.
102 - L{loadXML} - Explain the XML format. 101 - L{loadXML} - Explain the XML format.
103 - L{LayoutBase} - Working of the layout engine. 102 - L{widgets.layout.LayoutBase} - Working of the layout engine.
104 103
105 Initialization, data distribution and collection 104 Initialization, data distribution and collection
106 ================================================ 105 ================================================
107 106
108 Very often a dialogs text fields, labels and listboxes have to be filled with data 107 Very often a dialogs text fields, labels and listboxes have to be filled with data
237 'loadFonts', 236 'loadFonts',
238 'init', 237 'init',
239 'manager' 238 'manager'
240 ] 239 ]
241 240
241
242 # For epydoc
243 import widgets
244 import widgets.ext
245
246 # This *import should really be removed!
242 from widgets import * 247 from widgets import *
248
243 from exceptions import * 249 from exceptions import *
244 250
245 from fonts import loadFonts 251 from fonts import loadFonts
246
247 # Text munging befor adding it to TextBoxes
248 252
249 ### Initialisation ### 253 ### Initialisation ###
250 254
251 manager = None 255 manager = None
252 def init(engine,debug=False): 256 def init(engine,debug=False):
420 raise InitializationError("PyChan is not initialized yet.") 424 raise InitializationError("PyChan is not initialized yet.")
421 manager.setupModalExecution(mainLoop,breakFromMainLoop) 425 manager.setupModalExecution(mainLoop,breakFromMainLoop)
422 426
423 def setUnicodePolicy(*policy): 427 def setUnicodePolicy(*policy):
424 """ 428 """
429 Set the unicode error handling policy.
430
425 Possible options are: 431 Possible options are:
426 - 'strict' meaning that encoding errors raise a UnicodeEncodeError. 432 - 'strict' meaning that encoding errors raise a UnicodeEncodeError.
427 - 'ignore' all encoding errors will be silently ignored. 433 - 'ignore' all encoding errors will be silently ignored.
428 - 'replace' all errors are replaced by the next argument. 434 - 'replace' all errors are replaced by the next argument.
429 435
430 For further information look at the python documentation, 436 For further information look at the python documentation,
431 especially L{codecs.register_error}. 437 especially L{codecs.register_error}.
432 438
433 Example: 439 Example::
434 pychan.setUnicodePolicy('replace','?') 440 pychan.setUnicodePolicy('replace','?')
435 """ 441 """
436 if not manager: 442 if not manager:
437 raise InitializationError("PyChan is not initialized yet.") 443 raise InitializationError("PyChan is not initialized yet.")
438 manager.unicodePolicy = policy 444 manager.unicodePolicy = policy