Files
weewx/docs/upgrading.htm
Tom Keffer 5bff5b1624 v1.13.0a2
Changed the signature of the search functions in filegenerator.py
2012-03-13 18:10:59 +00:00

150 lines
8.1 KiB
HTML

<!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" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<!-- $Revision$ -->
<!-- $Author$ -->
<!-- $Date$ -->
<head>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Upgrading weewx</title>
<!-- CSS -->
<link href="weewx_docs.css" rel="stylesheet" />
</head>
<body>
<h1 class="title">Upgrading to <span class="code">weewx</span> v1.13</h1>
<h1>Version specific directions</h1>
<p>What follows are directions for upgrading from specific versions.</p>
<h2>V1.12 or earlier</h2>
<p>Version 1.13 changed the way binding happens to the databases used in reports
so that it happens much later. The upshot is that the signature of a few
functions changed. Most you are unlikely to encounter. The exception is if you
have written custom template <em>search lists</em>, as described in the section <em>
<a href="customizing.htm#Extending_an_existing_generator">Extending an existing report generator</a></em> in the
<a href="customizing.htm">Customizing weewx guide</a>. This section has been
updated to reflect the new function signatures. As a side effect, the
illustrated example actually has become much simpler!</p>
<p>No changes to skins.</p>
<h2>V1.9 or earlier</h2>
<p>Version 1.10 introduced several new features. </p>
<h3>New almanac features, icon, and mobile template</h3>
<p>Version 1.10 introduces some extra almanac features, such as the azimuth and
elevation of the sun and moon, or when the next solstice will be. It also
includes a template formatted for smartphones, as well as an icon (&quot;<span class="code">favicon.ico</span>&quot;)
that displays in your browser toolbar. The skins shipped with the distribution
take advantage of these features. If you do nothing, your old skins will
continue to work, but you will not take advantage of these new features. </p>
<p>If you want these new features then you have two choices:</p>
<ol>
<li>Rename your old skin directory (call it &quot;<span class="code">skin.old</span>&quot;)
then do the install. This will install the new skin distribution. You can
modify it to reflect any changes you have made, referring to <span class="code">
skin.old</span> for guidance.</li>
<li>Alternatively, change the contents of your existing skin directory to take
advantage of the new features. If you take this approach, you will need to
copy over files <span class="code">favicon.ico, mobile.css</span>, and
<span class="code">mobile.html.tmpl</span> from the distribution into your <span class="code">skin/Standard</span>
directory. Modify <span class="code">skins/Standard/index.html.tmpl</span>
to take advantage of the new almanac features, using the version shipped
with the distribution for guidance. You will then need to modify your <span class="code">skin.conf</span>.
<p>Add a new <span class="code">[[[Mobile]]]</span> section:</p>
<p class="tty">[FileGenerator]<br />
&nbsp; .<br />
&nbsp; .<br />
&nbsp; .<br />
&nbsp; [[ToDate]]<br />
&nbsp;&nbsp;&nbsp; .<br />
&nbsp;&nbsp;&nbsp; .<br />
&nbsp;&nbsp;&nbsp; .<br />
&nbsp;&nbsp;&nbsp; [[[Mobile]]]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; template = mobile.html.tmpl</p>
<p>Then add <span class="code">mobile.css</span> and <span class="code">
favicon.ico</span> to the list of files to be copied on report generation:</p>
<p class="tty">[CopyGenerator]<br />
&nbsp; copy_once = backgrounds/*, weewx.css, mobile.css, favicon.ico</p>
</ol>
<p>Which approach you should take will depend on how extensively you have
modified the stock skin distribution. If the modifications are slight, approach
#1 will be easier, otherwise use approach #2.</p>
<h3>Backwards compatibility</h3>
<p>With the introduction of explicit control of output units in the templates
such as</p>
<p class="tty">$day.outTemp.max.degree_C</p>
<p>the calling signature of the following two Python classes was changed</p>
<ul>
<li><span class="code">weewx.stats.TaggedStats</span></li>
<li><span class="code">weewx.stats.TimeSpanStats</span></li>
</ul>
<p>The example of writing a custom generator <span class="code">MyFileGenerator</span>
(which produced &quot;all time&quot; statistics) has been changed to reflect the new
signatures.</p>
<p>This will only affect you if you have written a custom generator.</p>
<h2>V1.7.0 or earlier</h2>
<p>With the introduction of a standard archiving service, <span class="code">
StdArchive</span>, the names of some events have changed. This will not affect
you unless you have written a custom service.</p>
<h2>V.1.5.0 or earlier</h2>
<p>V1.7 introduces <em>skins</em>. The skins live in subdirectory
<span class="code">skins</span>. They are <em>not</em> compatible with the old
<span class="code">template</span> subdirectory --- you can&#39;t simply rename
<span class="code">templates</span> to <span class="code">skins</span>. </p>
<p>The part of the configuration file dealing with the presentation layer has
been split off into a separate file <span class="code">skin.conf</span>. Hence,
once again, the installation script
<span class="code">setup.py</span> will NOT merge your old <span class="code">
weewx.conf</span> configuration file
into the new one. You will have to re-edit <span class="code">weewx.conf</span>
to put in your customizations. You may also have to edit <span class="code">
skin.conf</span> for whatever skin you choose (right now, only one skin, <em>Standard</em>,
comes with the distribution).</p>
<p>However, a reinstall of V1.7 <em>will</em> merge your changes for
<span class="code">weewx.conf</span>. It will also merge any changes you have made to <span class="code">skin.conf</span>
as well.</p>
<p>Please check the following:</p>
<ul>
<li>Option &quot;<span class="code">altitude</span>&quot; in section
<span class="code">[Station]</span> now takes a unit. Hence, it should look
something like: <pre> altitude = 120, meter</pre>
</li>
<li>In a similar manner, options <span class="code">heating_base</span> and
<span class="code">cooling_base</span> in <span class="code">skin.conf</span>
also take units:
<pre>heating_base = 65, degree_F
cooling_base = 65, degree_F</pre>
</li>
</ul>
<p>The directory &#39;<span class="code">templates</span>&#39; is no longer used;
it has been replaced with directory &#39;<span class="code">skins</span>&#39;. You
may delete it if you wish:</p>
<p class="tty">rm -r <em>$WEEWX_ROOT</em>/templates</p>
<h2>V1.4.0 or earlier</h2>
<p>Because the configuration file <span class="code">weewx.conf</span> changed
significantly going from V1.4 to V1.5, the installation script
<span class="code">setup.py</span> will NOT merge your old configuration file
into the new one. You will have to re-edit <span class="code">weewx.conf</span>
to put in your customizations.</p>
<h2>V1.2.0 or earlier</h2>
<h3>Optional</h3>
<p>Option <span class="code">clock_check</span>, previously found in the <span class="code">[VantagePro]</span> section, is now found in the
<span class="code">[Station]</span> section. The install program will put a
default value in the new place, but it will not delete nor move your old value
over. If you have changed this value or if you can&#39;t stand the thought of
<span class="code">clock_check</span> appearing in two different places, you
should delete the old one found under <span class="code">[VantagePro]</span> and
make sure the new value, found under <span class="code">[Station]</span> is
correct.</p>
<p>Two Python files are no longer used, so they may be deleted from your
installation if you wish:</p>
<p class="tty"><em>rm $WEEWX_ROOT</em>/bin/weewx/processdata.py<br />
<em>rm $WEEWX_ROOT</em>/bin/weewx/mainloop.py</p>
<p>In addition, file <span class="code">readme.htm</span> has been moved to
subdirectory <span class="code"><em>$WEEWX_ROOT</em>/docs</span>, so the old one
can be deleted:</p>
<p class="tty">rm <em>$WEEWX_ROOT</em>/readme.htm</p>
<p>&nbsp;</p>
</body>
</html>