/usr/share/doc/python-werkzeug-doc/html/transition.html is in python-werkzeug-doc 0.10.4+dfsg1-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Transition to Werkzeug 1.0 — Werkzeug 0.10.4 documentation</title>
<link rel="stylesheet" href="_static/werkzeug.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.10.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Werkzeug 0.10.4 documentation" href="index.html" />
<link rel="next" title="Werkzeug Tutorial" href="tutorial.html" />
<link rel="prev" title="Installation" href="installation.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="tutorial.html" title="Werkzeug Tutorial"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="installation.html" title="Installation"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Werkzeug 0.10.4 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="transition-to-werkzeug-1-0">
<h1>Transition to Werkzeug 1.0<a class="headerlink" href="#transition-to-werkzeug-1-0" title="Permalink to this headline">¶</a></h1>
<p>Werkzeug originally had a magical import system hook that enabled
everything to be imported from one module and still loading the actual
implementations lazily as necessary. Unfortunately this turned out to be
slow and also unreliable on alternative Python implementations and
Google’s App Engine.</p>
<p>Starting with 0.7 we recommend against the short imports and strongly
encourage starting importing from the actual implementation module.
Werkzeug 1.0 will disable the magical import hook completely.</p>
<p>Because finding out where the actual functions are imported and rewriting
them by hand is a painful and boring process we wrote a tool that aids in
making this transition.</p>
<div class="section" id="automatically-rewriting-imports">
<h2>Automatically Rewriting Imports<a class="headerlink" href="#automatically-rewriting-imports" title="Permalink to this headline">¶</a></h2>
<p>For instance, with Werkzeug < 0.7 the recommended way to use the escape function
was this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">werkzeug</span> <span class="kn">import</span> <span class="n">escape</span>
</pre></div>
</div>
<p>With Werkzeug 0.7, the recommended way to import this function is
directly from the utils module (and with 1.0 this will become mandatory).
To automatically rewrite all imports one can use the
<a class="reference external" href="http://bit.ly/import-rewrite">werkzeug-import-rewrite</a> script.</p>
<p>You can use it by executing it with Python and with a list of folders with
Werkzeug based code. It will then spit out a hg/git compatible patch
file. Example patch file creation:</p>
<div class="highlight-python"><div class="highlight"><pre>$ python werkzeug-import-rewrite.py . > new-imports.udiff
</pre></div>
</div>
<p>To apply the patch one of the following methods work:</p>
<p>hg:</p>
<blockquote>
<div><div class="highlight-python"><div class="highlight"><pre>hg import new-imports.udiff
</pre></div>
</div>
</div></blockquote>
<p>git:</p>
<blockquote>
<div><div class="highlight-python"><div class="highlight"><pre>git apply new-imports.udiff
</pre></div>
</div>
</div></blockquote>
<p>patch:</p>
<blockquote>
<div><div class="highlight-python"><div class="highlight"><pre><span class="n">patch</span> <span class="o">-</span><span class="n">p1</span> <span class="o"><</span> <span class="n">new</span><span class="o">-</span><span class="n">imports</span><span class="o">.</span><span class="n">udiff</span>
</pre></div>
</div>
</div></blockquote>
</div>
<div class="section" id="stop-using-deprecated-things">
<h2>Stop Using Deprecated Things<a class="headerlink" href="#stop-using-deprecated-things" title="Permalink to this headline">¶</a></h2>
<p>A few things in Werkzeug will stop being supported and for others, we’re
suggesting alternatives even if they will stick around for a longer time.</p>
<p>Do not use:</p>
<ul class="simple">
<li><cite>werkzeug.script</cite>, replace it with custom scripts written with
<cite>argparse</cite> or something similar.</li>
<li><cite>werkzeug.template</cite>, replace with a proper template engine.</li>
<li><cite>werkzeug.contrib.jsrouting</cite>, stop using URL generation for
JavaScript, it does not scale well with many public routing.</li>
<li><cite>werkzeug.contrib.kickstart</cite>, replace with hand written code, the
Werkzeug API became better in general that this is no longer
necessary.</li>
<li><cite>werkzeug.contrib.testtools</cite>, not useful really.</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper"><p class="logo"><a href="index.html">
<img class="logo" src="_static/werkzeug.png" alt="Logo"/>
</a></p>
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Transition to Werkzeug 1.0</a><ul>
<li><a class="reference internal" href="#automatically-rewriting-imports">Automatically Rewriting Imports</a></li>
<li><a class="reference internal" href="#stop-using-deprecated-things">Stop Using Deprecated Things</a></li>
</ul>
</li>
</ul>
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="installation.html" title="previous chapter">Installation</a></li>
<li>Next: <a href="tutorial.html" title="next chapter">Werkzeug Tutorial</a></li>
</ul></li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/transition.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
© Copyright 2011, The Werkzeug Team.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
</div>
</body>
</html>
|