~kernevil/ubuntu/saucy/pylons/fix-useless-import

« back to all changes in this revision

Viewing changes to pylons/helpers.py

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ożarowski
  • Date: 2011-08-02 21:17:36 UTC
  • mfrom: (1.2.3 upstream) (10.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20110802211736-ejqil9b3yqgxt6lr
Tags: 1.0-2
* Add ipython_0.11_compatibility patch (thanks to Julian Taylor)
* Add build-arch and build-indep targets to debian/rules 
* Switch from dh_pysupport to dh_python2
* Source format changed to 3.0 (quilt)
* Standards-Version bumped to 3.9.2 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
"""Deprecated: This module has moved to pylons.controllers.util"""
2
 
import warnings
3
 
 
4
 
import pylons
5
 
import pylons.controllers.util
6
 
import pylons.legacy
7
 
from pylons.util import deprecated, func_move
8
 
 
9
 
__all__ = ['abort', 'etag_cache', 'log', 'redirect_to']
10
 
 
11
 
warnings.warn('The pylons.helper module has moved to pylons.controllers.util; '
12
 
              'please update your imports.', DeprecationWarning, 2)
13
 
 
14
 
def log(msg):
15
 
    """Deprecated: Use the logging module instead.
16
 
 
17
 
    Log a message to the output log.
18
 
    """
19
 
    warnings.warn(pylons.legacy.log_warning, DeprecationWarning, 2)
20
 
    pylons.request.environ['wsgi.errors'].write('=> %s\n' % str(msg))
21
 
 
22
 
abort = deprecated(pylons.controllers.util.abort,
23
 
                   func_move('abort', 'pylons.controllers.util'))
24
 
etag_cache = deprecated(pylons.controllers.util.etag_cache,
25
 
                        func_move('etag_cache', 'pylons.controllers.util'))
26
 
redirect_to = deprecated(pylons.controllers.util.redirect_to,
27
 
                         func_move('redirect_to', 'pylons.controllers.util'))