Package turbogears

Source Code for Package turbogears

 1  """TurboGears Front-to-Back Web Framework""" 
 2   
 3  import warnings 
 4   
 5  import pkg_resources 
 6   
 7  from turbogears.release import (version as __version__, author as __author__, 
 8      email as __email__, license as __license__, copyright as __copyright__) 
 9  from turbogears.config import update_config 
10  from turbogears.controllers import (absolute_url, expose, flash, validate, 
11      redirect, error_handler, exception_handler, url) 
12  from turbogears.paginate import paginate 
13  from turbogears.widgets import mochikit, jsi18nwidget 
14  from turbogears.startup import start_server 
15  from turbogears import (config, controllers, view, database, validators, command, 
16      i18n, widgets, startup, scheduler) 
17   
18  # load global symbols for TG extensions (currently only used by tgfastdata) 
19  extensions = pkg_resources.iter_entry_points("turbogears.extensions") 
20  for entrypoint in extensions: 
21      try: 
22          extension = entrypoint.load() 
23          if hasattr(extension, "tgsymbols"): 
24              globals().update(extension.tgsymbols()) 
25      except Exception, exception: 
26          warnings.warn("Could not load extension %s from %s: %s" 
27              % (entrypoint, entrypoint.dist, exception), stacklevel=2) 
28   
29  i18n.install() # adds _ (gettext) to builtins namespace 
30   
31   
32  __all__ = [ 
33      "absolute_url", 
34      "database", 
35      "command", 
36      "config", 
37      "controllers", 
38      "expose", 
39      "flash", 
40      "error_handler", 
41      "exception_handler", 
42      "mochikit", 
43      "redirect", 
44      "scheduler", 
45      "start_server", 
46      "update_config", 
47      "url", 
48      "validate", 
49      "validators", 
50      "view", 
51      "widgets", 
52  ] 
53