Hallo Gary,

to explain and illustrate

please look http://wh3080.hes61.de/tempAlt.html (limited) so my ideas

the "tempAlt.html.tmpl " a detail
...
#for $year in $alletime.years($data_binding='wxAlt_binding')
    <tr>
      <td>$year.dateTime.format("%Y")</td>
     #for $month in $year.months($data_binding='wxAlt_binding')
         #if $month.outTemp.max.raw is not None:
            <td class="stats_data" style="$decorator_color('tempO', 
$month.outTemp.max.raw)">$month.outTemp.max.formatted</td>
         #else
            <td>-</td>
         #end if
     #end for
    </tr>
#end for
    <tr><td colspan='13'>minimale Tagestemperatur</td></tr>
#for $year in $alletime.years($data_binding='wxAlt_binding')
    <tr>
      <td>$year.dateTime.format("%Y")</td>
     #for $month in $year.months($data_binding='wxAlt_binding')
         #if $month.outTemp.min.raw is not None:
            <td class="stats_data" style="$decorator_color('tempO', 
$month.outTemp.min.raw)">$month.outTemp.min.formatted</td>
         #else
            <td>-</td>
         #end if
     #end for
    </tr>
#end for
</table>
<hr />
<h3>Tagestemperatur in °C (Maximal und Minimal) Aufzeichnung alle 5 min (
wd_binding)</h3>

<table>
    <tr>
      <td>&nbsp;</td>
      <td>Jan</td><td>Feb</td><td>Mär</td>
     <td>Apr</td><td>Mai</td><td>Jun</td>
     <td>Jul</td><td>Aug</td><td>Sep</td>
     <td>Okt</td><td>Nov</td><td>Dez</td>
    </tr>
    <tr><td colspan='13'>maximale Tagestemperatur in der Zeit von 06:00 Uhr 
bis 18:00 Uhr</td></tr>
#for $year in $alletime.years($data_binding='wd_binding')
    <tr>
      <td>$year.dateTime.format("%Y")</td>
     #for $month in $year.months($data_binding='wd_binding')
         #if $month.outTempDay.max.raw is not None:
            <td class="stats_data" style="$decorator_color('tempO', 
$month.outTempDay.max.raw)">$month.outTempDay.max.formatted</td>
         #else
            <td>-</td>
         #end if
     #end for
    </tr>
#end for
...



not surprised "alletime" is correct, to the distinction for alltime in weewx

alletime it is from WD_WEEWX

#    Copyright (c) 2009-2015 Tom Keffer <[email protected]>
#    See the file LICENSE.txt for your rights.

"""Example of how to extend the search list used by the Cheetah generator.
*******************************************************************************
This search list extension offers two extra tags:
    'alletime':   All time statistics.
                 For example, "what is the all time high temperature?"

*******************************************************************************
To use this search list extension:
1) copy this file to the user directory
2) modify the option search_list in the skin.conf configuration file, adding
the name of this extension.  When you're done, it will look something like
this:
[CheetahGenerator]
    search_list_extensions = user.wd_alltime.wd_AlleTime
You can then use tags such as $alletime.outTemp.max for the all-time max
temperature.
*******************************************************************************
"""

import datetime
import time
import os.path
import itertools
#import user.wdTaggedStats3
import weewx
import weeutil.weeutil
import weewx.almanac
import weewx.units
import syslog
import math
import calendar
import weewx.tags

from weewx.cheetahgenerator import SearchList
from weewx.tags import TimeBinder, TimespanBinder
from weeutil.weeutil import TimeSpan, archiveDaySpan, genMonthSpans, 
genDaySpans, startOfDay, option_as_
list, isMidnight
from weewx.units import ValueHelper, getStandardUnitType, ValueTuple
from datetime import date

from dateutil.relativedelta import relativedelta

WEEWXWD_SLE_VERSION = '1.2.0b1'
class wd_AlleTime(SearchList):

    def __init__(self, generator):
        SearchList.__init__(self, generator)

    def get_extension_list(self, timespan, db_lookup):
        """ Returns a search list extension with all time and last seven 
days
            stats. """
        class wdBinder(TimeBinder):

            def __init__(self, db_lookup, report_time,
                         formatter=weewx.units.Formatter(), 
converter=weewx.units.Converter(), **option_dict):
                self.db_lookup    = db_lookup
                self.report_time  = report_time
                self.formatter    = formatter
                self.converter    = converter
                self.option_dict  = option_dict
            def alletime(self, data_binding=None):
                # to avoid problems where our data_binding might have a 
first
                # good timestamp that is different to timespan.start (and 
thus
                # change which manager is used) we need to reset our
                # timespan.start to the first good timestamp of our 
data_binding

                # get a manager
                db_manager = db_lookup(data_binding)
                # get our first good timestamp
                start_ts = db_manager.firstGoodStamp()
                # reset our timespan
                alletime_tspan = TimeSpan(start_ts, timespan.stop)

                return TimespanBinder(alletime_tspan,
                                      self.db_lookup, context='alletime',
                                      data_binding=data_binding, # 
overrides the default
                                      formatter=self.formatter,
                                      converter=self.converter)


        tspan_binder = wdBinder(db_lookup, timespan.stop, 
self.generator.formatter, self.generator.converter)

        return [tspan_binder]




what I miss are the valid start and end times for the "wxAlt_binding" or 
"wd_binding" 
datetime for wxAlt_binding start by 0
datetime for wd_binding and wx_binding start by 1383254340

I hope I understand
Hartmut

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to