Changeset 944372e for src/python


Ignore:
Timestamp:
Sep 21, 2017, 1:59:48 PM (9 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, debian/jessie
Children:
6b3dd00
Parents:
949f66d (diff), 3145648 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
  • Merge branch 'master' into debian/jessie
  • Adapted debian files
    • control
      • python packages are architecture all now (thanks to Herbert)
      • added gpsbabel as runtime dependency for gnuboat (gnuboat-log-converter needs it to create GPX files)
    • source/options: Ignores egg-info now
Location:
src/python
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/python/bin/gnuboat

    r949f66d r944372e  
    2727from pytz import timezone
    2828import pytz
    29 import getopt
     29import argparse
    3030import sys
    3131import pynmea2
     32import traceback
    3233
    3334from gnuboat import daemon
    … …  
    4344logdir = "/var/log/gnuboat"
    4445logperiod = 2
     46logverbose = False
     47logsystemtime = False
    4548displayperiod = 5
    4649
    … …  
    7073    print "  gnuboat -r PATH_TO_RRD_DATABAE_FILE -s PATH_TO_SHUTDOWN_REQUEST_FILE [-l [LOG_UPDATE_PERIOD] [-d DISPLAY_UPDATE_PERIOD] [-o PATH_TO_NMEA1983_LOG]"
    7174    print ""
    72     print "  -h --help              Display this help"
    73     print "  -r --rrdfile           Path to the rrd database used by the webservice to serve the clients"
    74     print "  -s --shutdownfile      Path to the shutdown request file, used by the webservice to request a shutdown of the system running gnuboat"
    75     print "  -l --logperiod         Time in seconds to update the logs"
    76     print "  -d --displayperiod     Timein seconds to update the display"
    77     print "  -o --output            Directory where the log files are stored (e.g. the NMEA0183 log files)"
     75    print "  -h  --help              Display this help"
     76    print "  -r  --rrdfile           Path to the rrd database used by the webservice to serve the clients"
     77    print "  -s  --shutdownfile      Path to the shutdown request file, used by the webservice to request a shutdown of the system running gnuboat"
     78    print "  -l  --logperiod         Time in seconds to update the logs"
     79    print "  -lv --log-verbose       Log verbose information to nmea log file (Enables -ls and adds RMC sentences, with invalid GPS state, on non fixes"
     80    print "  -ls --log-system-time   Add to enable prefixing every logline with the system time (Default off)"
     81    print "  -d  --displayperiod     Timein seconds to update the display"
     82    print "  -o  --output            Directory where the log files are stored (e.g. the NMEA0183 log files)"
    7883
    7984def log(gpsFix, gpsTime, gpsStatus, latitude, latitudeDirection, longitude,
    80         longitudeDirection, courseOverGround, speedOverGround, waterDepth, waterTemperature, transducerValid):
     85        longitudeDirection, courseOverGround, speedOverGround, waterDepth, waterTemperature, transducerValid, logVerbose, logSystemTime):
    8186    global logdir
    8287    global nmeafile
    8388    global nmeaFileDate
    84    
     89
    8590    # Only log, if we have a gps fix
    8691    if gpsFix < 2:
    87         return
     92        if not logVerbose:
     93            return
     94        gpsStatus = 'V'
     95        mode = 'N'
     96        if gpsTime is None:
     97            gpsTime = datetime.datetime.utcnow()
    8898   
    8999    nmeaFileDateShould = datetime.datetime.utcnow().strftime("%Y-%m-%d")
    … …  
    99109            print "Could not open the logfile: %s" % error
    100110            sys.exit(2)
    101                
    102     nmeafile.write("%s\r\n" % str(pynmea2.RMC('GN', 'RMC',
    103                                               (gpsTime.strftime("%H%M%S"), gpsStatus, '%08.3f' % latitude,
    104                                                latitudeDirection, '%09.3f' % longitude, longitudeDirection,
    105                                                '%04.1f' % speedOverGround, '%04.1f' % courseOverGround,
    106                                                gpsTime.strftime("%d%m%y"), '', '', mode))))
    107     if transducerValid:
    108         nmeafile.write("%s\r\n" % str(pynmea2.DPT('SD', 'DPT', ('%05.2f' % waterDepth, '00.00'))))
    109         nmeafile.write("%s\r\n" % str(pynmea2.MTW('YX', 'MTW', ('%04.1f' % waterTemperature, 'C'))))
     111
     112    latitude = degreesDecimalToNmea(latitude)
     113    longitude = degreesDecimalToNmea(longitude)
     114
     115    logsystemtime = ""
     116    if logsystemtime:
     117        logsystemtime = "%s:" datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S")
     118       
     119    try:
     120        nmeafile.write("%s%s\r\n" % (logsystemtime, str(pynmea2.RMC('GN', 'RMC',
     121                                                     (gpsTime.strftime("%H%M%S"), gpsStatus,
     122                                                     '%02d%s' % (latitude['degrees'], latitude['minutes'])
     123                                                     latitudeDirection,
     124                                                     '%03d%s' % (longitude['degrees'], longitude['minutes']),
     125                                                     longitudeDirection,
     126                                                     '%04.1f' % speedOverGround, '%04.1f' % courseOverGround,
     127                                                     gpsTime.strftime("%d%m%y"), '', '', mode)))))
     128        if transducerValid:
     129            nmeafile.write("%s%s\r\n" % (logsystemtime, str(pynmea2.DPT('SD', 'DPT', ('%05.2f' % waterDepth, '00.00')))))
     130            nmeafile.write("%s%s\r\n" % (logsystemtime, str(pynmea2.MTW('YX', 'MTW', ('%04.1f' % waterTemperature, 'C')))))
     131    except:
     132        print "Failed writing to logfile %s" % nmeaLogFile
     133        print(traceback.format_exc())
     134
     135def degreesDecimalToNmea(decimalDegrees):
     136    degrees = math.floor(decimalDegrees)
     137    minutes = 60.0 * (decimalDegrees - degrees)
     138    return { 'degrees': degrees, 'minutes': minutes}
    110139
    111140def main(argv):
    … …  
    113142    global shutdownfile
    114143    global logperiod
     144    global logverbose
     145    global logsystemtime
    115146    global displayperiod
    116147    global logdir
    117148    global nmeafile
    118149
    119     try:
    120         opts, args = getopt.getopt(argv, "hr:s:l:d:o:", [
    121                                    "help", "rrdfile=", "shutdownfile=", "logperiod=", "displayperiod=", "output="])
    122     except getopt.GetoptError:
    123         usage()
    124         sys.exit(2)
    125 
    126     for option, argument in opts:
    127         if option == ("-h", "--help"):
    128             usage()
    129             sys.exit()
    130         elif option in ("-r", "--rrdfile"):
    131             rrdfile = argument
    132         elif option in ("-s", "--shutdownfile"):
    133             shutdownfile = argument
    134         elif option in ("-l", "--logperiod"):
    135             logperiod = argument
    136         elif option in ("-d", "--displayperiod"):
    137             displayperiod = argument
    138         elif option in ("-o", "--output"):
    139             logdir = argument
    140         else:
    141             assert False, "unhandled option"
     150    parser = argparse.ArgumentParser(description="Collects the data from canboat and gpsd and writes them to the rrd database and the nmea log file")
     151    parser.add_argument('-r', '--rrdfile', dest='rrd_file', metavar='rrd_file', type=str,
     152                        help='Path to the rrd database used by the webservice to serve the clients', default=rrdfile)
     153    parser.add_argument('-s', '--shutdownfile', dest='shutdown_file', metavar='shutdown_file', type=str,
     154                        help='Path to the shutdown request file, used by the webservice to request a shutdown of the system running gnuboat', default=shutdownfile)
     155    parser.add_argument('-lp', '--logperiod', dest='log_period', metavar='log_period', type=int,
     156                        help='Time in seconds to update the logs', default=logperiod)
     157    parser.add_argument('-lv', '--log-verbose', action='store_true', dest='log_verbose',
     158                        help='Log verbose information to nmea log file (Enables -ls and adds RMC sentences, with invalid GPS state, on non fixes (Default off)')
     159    parser.add_argument('-ls', '--log-system-time', action='store_true', dest='log_system_time',
     160                        help='Add to enable prefixing every logline with the system time (Default off)')
     161    parser.add_argument('-d', '--displayperiod', dest='display_period', metavar='display_period', type=int,
     162                        help='Time in seconds to update the display', default=displayperiod)
     163    parser.add_argument('-o', '--output', dest='output', metavar='output', type=str,
     164                        help='Directory where the log files are stored (e.g. the NMEA0183 log files)', default=logdir)
     165    arguments = parser.parse_args(argv)
     166   
     167    if arguments.rrd_file is not None:
     168        rrdfile = arguments.rrd_file
     169    if arguments.shutdown_file is not None:
     170        shutdownfile = arguments.shutdown_file
     171    if arguments.log_period is not None:
     172        logperiod = arguments.log_period   
     173    if arguments.log_verbose is not None:
     174        logverbose = arguments.log_verbose
     175        logsystemtime = True
     176    if arguments.log_system_time is not None and arguments.log_verbose is None:
     177        logsystemtime = arguments.log_system_time
     178    if arguments.display_period is not None:
     179        displayperiod = arguments.display_period
     180    if arguments.output is not None:
     181        logdir = arguments.output
    142182
    143183    if not os.path.exists(os.path.dirname(rrdfile)):
    … …  
    197237            log(gpsFix, gpsp.timeUtc(), gpsp.status(), latitude, gpsp.latitudeDirection(),
    198238                longitude, gpsp.longitudeDirection(), courseOverGround, speedOverGround,
    199                 waterDepth, waterTemperature, n2kd.waterDepthValid())
     239                waterDepth, waterTemperature, n2kd.waterDepthValid(), logverbose, logsystemtime)
    200240           
    201241            # display data
  • src/python/bin/gnuboat-log-converter

    r949f66d r944372e  
    2424from enum import Enum
    2525import csv
     26import re
     27import tempfile
     28import subprocess
    2629
    2730class Format(Enum):
    2831    CSV = 1
    29 
    30 input_file_path = None
    31 output_file_path = None
    32 output_format_option = None
    33 output_format = Format.CSV
    34 errors_ignore = False
     32    NMEA0183 = 2
     33    GPX = 3
     34
     35regex_nmea_sentence = re.compile(r"^([^\$!]{0,})([\$!]{1}[\w]{2}[\w]{3}[^\*]+\*[\da-zA-Z]+)$")
     36regex_nmea_position = re.compile(r"^([0-9]+)([0-9]{2}\.[0-9]+)$")
    3537
    3638def toFloat(string, current_row):
    … …  
    4446           return 0
    4547
     48def nmeaToDecimalDegrees(nmea_value, current_row):
     49    global regex_nmea_position
     50
     51    if toFloat(nmea_value, current_row) == 0:
     52        return 0
     53
     54    matches = regex_nmea_position.match(nmea_value)
     55    if matches is None:
     56        print 'INFO: Failed to convert position value from line %s into decimal degrees: %s' % (current_row, nmea_value)
     57        return
     58    decimalDegrees = toFloat(matches.group(1), current_row)
     59    decimalMinutes = toFloat(matches.group(2), current_row)
     60    return decimalDegrees + (decimalMinutes / 60.0)
     61
     62def convertToCsv(input_file_path, output_file_path, errors_ignore, strip_time):
     63    global regex_nmea_sentence
     64
     65    try:
     66        output_file = open(output_file_path, 'w', 0)
     67    except IOError as error:
     68        print "ERROR: Could not open the output file: %s" % error
     69        sys.exit(3)
     70
     71    output_file_csv = None
     72    fields = ['datetime', 'gps_status', 'latitude', 'latitude_direction', 'longitude',
     73              'longitude_direction', 'speed_over_ground', 'course_over_ground' ,
     74              'water_depth', 'water_temperature']
     75    output_file_csv = csv.DictWriter(output_file, delimiter=' ', quotechar='"',
     76                                     quoting=csv.QUOTE_NONNUMERIC, fieldnames=fields)
     77    output_file_csv.writeheader()
     78
     79    # reading input file
     80    try:
     81        input_file = open(input_file_path, 'r')
     82    except IOError as error:
     83        print "ERROR: Could not open the input file: %s" % error
     84        sys.exit(3)
     85    current_row = 1
     86    last_row = None
     87    for line in input_file:
     88        line = line.strip()
     89        matches = regex_nmea_sentence.match(line)
     90        if matches is None:
     91            print 'INFO: Failed to parse nmea sentence (%s) at line %s\n' % (line, current_row)
     92            if not errors_ignore:
     93                input_file.close()
     94                output_file.close()
     95                sys.exit(4)
     96        else:
     97            nmea_sentence = pynmea2.parse(matches.group(2))
     98            if nmea_sentence.sentence_type == 'RMC':
     99                if last_row is not None:
     100                    output_file_csv.writerow(last_row)
     101                last_row = {'datetime': '%s %s' % (nmea_sentence.datestamp, nmea_sentence.timestamp),
     102                            'gps_status': nmea_sentence.status,
     103                            'latitude': nmeaToDecimalDegrees(nmea_sentence.lat, current_row),
     104                            'latitude_direction': nmea_sentence.lat_dir,
     105                            'longitude': nmeaToDecimalDegrees(nmea_sentence.lon, current_row),
     106                            'longitude_direction': nmea_sentence.lon_dir,
     107                            'speed_over_ground': toFloat(nmea_sentence.spd_over_grnd, current_row),
     108                            'course_over_ground': toFloat(nmea_sentence.true_course, current_row),
     109                            'water_depth': None,
     110                            'water_temperature': None}
     111            elif nmea_sentence.sentence_type == 'DBT' and last_row is not None:
     112                last_row['water_depth'] = toFloat(nmea_sentence.depth_meters, current_row)
     113            elif nmea_sentence.sentence_type == 'MTW' and last_row is not None:
     114                last_row['water_temperature'] = toFloat(nmea_sentence.temperature, current_row)
     115            current_row += 1
     116    if last_row is not None:
     117        output_file_csv.writerow(last_row)
     118    output_file.close()
     119    input_file.close()
     120
     121def convertToNmea0183(input_file_path, output_file_path, errors_ignore, strip_time):
     122    global regex_nmea_sentence
     123
     124    try:
     125        output_file = open(output_file_path, 'w', 0)
     126    except IOError as error:
     127        print "ERROR: Could not open the output file: %s" % error
     128        sys.exit(3)
     129
     130    # reading input file
     131    try:
     132        input_file = open(input_file_path, 'r')
     133    except IOError as error:
     134        print "ERROR: Could not open the input file: %s" % error
     135        sys.exit(3)
     136    current_row = 1
     137    last_row = None
     138    for line in input_file:
     139        line = line.strip()
     140        matches = regex_nmea_sentence.match(line)
     141        if matches is None:
     142            print 'INFO: Failed to parse nmea sentence (%s) at line %s\n' % (line, current_row)
     143            if not errors_ignore:
     144                input_file.close()
     145                output_file.close()
     146                sys.exit(4)
     147        else:
     148            nmea_sentence = pynmea2.parse(matches.group(2))
     149            output_string = str(nmea_sentence)
     150            if not strip_time and matches.group(1):
     151                output_string = '%s%s' % (matches.group(1), output_string)
     152            output_file.write("%s\r\n" % str(output_string))
     153    output_file.close()
     154    input_file.close()
     155   
     156def convertToGpx(input_file_path, output_file_path, errors_ignore, strip_time):
     157    global regex_nmea_sentence
     158   
     159    # make sure, nmea input file, does not have timestamps in front of the nmea
     160    # sentences
     161    [nmea_without_timestamps_handle, nmea_without_timestamp_file_path] = tempfile.mkstemp(text=True)
     162    convertToNmea0183(input_file_path, nmea_without_timestamp_file_path, errors_ignore, True)
     163   
     164    subprocess.call(['gpsbabel', '-i', 'nmea', '-f', nmea_without_timestamp_file_path, '-o', 'gpx', '-F', output_file_path])
     165    os.remove(nmea_without_timestamp_file_path)
     166
    46167def main(argv):
     168    input_file_path = None
     169    output_file_path = None
     170    output_format_option = None
     171    output_format = Format.CSV
     172    errors_ignore = False
     173    strip_time = False
     174       
    47175    formats = []
    48176    for file_format in Format:
    … …  
    58186    parser.add_argument('output_file', metavar='output_file_path', type=str,
    59187                        help='Write the converted content to file (output)')
     188    parser.add_argument('--strip-time', dest='strip_time', action='store_true',
     189                        help='Removes timestamp in front of the nmea sentence, if it is there')
    60190    arguments = parser.parse_args(argv)
    61191   
    … …  
    67197               format_found = True
    68198        if not format_found:
    69             print 'Invalid input format specified: %s' % arguments.output_format
     199            print 'ERROR: Invalid input format specified: %s' % arguments.output_format
    70200            sys.exit(1)
    71201
    72202    if arguments.errors_ignore is not None:
    73203        errors_ignore = arguments.errors_ignore
     204       
     205    if arguments.strip_time is not None:
     206        strip_time = arguments.strip_time
    74207           
    75208    if arguments.input_file is None:
    76         print 'No input file specified'
     209        print 'ERROR: No input file specified'
    77210        sys.exit(2)
    78211    elif not os.path.exists(arguments.input_file):
    79         print 'Specified input file does not exists: %s' % arguments.input_file
     212        print 'ERROR: Specified input file does not exists: %s' % arguments.input_file
    80213        sys.exit(3)
    81214    else:
    … …  
    83216       
    84217    if arguments.output_file is None:
    85         print 'No output file specified'
     218        print 'ERROR: No output file specified'
    86219        sys.exit(2)
    87220    elif not os.path.exists(os.path.dirname(arguments.output_file)):
    88         print 'Specified directory of output file does not exists: %s' % arguments.output_file
     221        print 'ERROR: Specified directory of output file does not exists: %s' % arguments.output_file
    89222        sys.exit(3)
    90223    else:
    91224        output_file_path = arguments.output_file
    92225
    93     try:
    94         output_file = open(output_file_path, 'w', 0)
    95     except IOError as error:
    96         print "Could not open the output file: %s" % error
    97         sys.exit(3)
    98        
    99     output_file_csv = None
    100     if output_format == Format.CSV.value:
    101         fields = ['datetime', 'gps_status', 'latitude', 'latitude_direction', 'longitude',
    102                   'longitude_direction', 'speed_over_ground', 'course_over_ground' ,
    103                   'water_depth', 'water_temperature']
    104         output_file_csv = csv.DictWriter(output_file, delimiter=' ', quotechar='"',
    105                                          quoting=csv.QUOTE_NONNUMERIC, fieldnames=fields)
    106         output_file_csv.writeheader()
    107 
    108     # reading input file
    109     nmea_errors='raise'
    110     if errors_ignore:
    111         nmea_errors='ignore'
    112     nmea_file = pynmea2.NMEAFile(input_file_path)
    113     current_row = 1
    114     last_row = None
    115     for nmea_sentence in nmea_file:
    116         if output_format == Format.CSV.value:
    117             if nmea_sentence.sentence_type == 'RMC':
    118                 if last_row is not None:
    119                     output_file_csv.writerow(last_row)
    120                 last_row = {'datetime': '%s %s' % (nmea_sentence.datestamp, nmea_sentence.timestamp),
    121                             'gps_status': nmea_sentence.status,
    122                             'latitude': toFloat(nmea_sentence.lat, current_row),
    123                             'latitude_direction': nmea_sentence.lat_dir,
    124                             'longitude': toFloat(nmea_sentence.lon, current_row),
    125                             'longitude_direction': nmea_sentence.lon_dir,
    126                             'speed_over_ground': toFloat(nmea_sentence.spd_over_grnd, current_row),
    127                             'course_over_ground': toFloat(nmea_sentence.true_course, current_row),
    128                             'water_depth': None,
    129                             'water_temperature': None}
    130             elif nmea_sentence.sentence_type == 'DBT' and last_row is not None:
    131                 last_row['water_depth'] = toFloat(nmea_sentence.depth_meters, current_row)
    132             elif nmea_sentence.sentence_type == 'MTW' and last_row is not None:
    133                 last_row['water_temperature'] = toFloat(nmea_sentence.temperature, current_row)
    134         current_row += 1
    135     if last_row is not None:
    136         output_file_csv.writerow(last_row) 
    137        
    138     output_file.close()
     226    if output_format == Format.CSV.value:
     227        convertToCsv(input_file_path, output_file_path, errors_ignore, strip_time)
     228    elif output_format == Format.NMEA0183.value:
     229        convertToNmea0183(input_file_path, output_file_path, errors_ignore, strip_time)
     230    elif output_format == Format.GPX.value:
     231        convertToGpx(input_file_path, output_file_path, errors_ignore, strip_time)
     232    else:
     233        print "ERROR: Undefined output format!\n";
     234        sys.exit(1)
     235
    139236    sys.exit(0)
    140237
  • src/python/gnuboat/daemon/gpsdpoller.py

    r949f66d r944372e  
    2222import datetime
    2323import gps
     24import traceback
    2425
    2526# Copied from https://gist.github.com/wolfg1969/4653340
    … …  
    4142
    4243    def latitude(self):
    43         if self._session == None or self.gpsFix() < 2:
     44        if self._currentValue == None or self.gpsFix() < 2:
    4445            return 0
    45         return self._session.fix.latitude
     46        return self._currentValue.fix.latitude
    4647
    4748    def latitudeDirection(self):
    … …  
    4950
    5051    def longitude(self):
    51         if self._session == None or self.gpsFix() < 2:
     52        if self._currentValue == None or self.gpsFix() < 2:
    5253            return 0
    53         return self._session.fix.longitude
     54        return self._currentValue.fix.longitude
    5455
    5556    def longitudeDirection(self):
    … …  
    5758
    5859    def speedOverGround(self):
    59         if self._session == None or self.gpsFix() < 2:
     60        if self._currentValue == None or self.gpsFix() < 2:
    6061            return 0
    61         return self._session.fix.speed
     62        return self._currentValue.fix.speed
    6263
    6364    def courseOverGround(self):
    64         if self._session == None or self.gpsFix() < 2:
     65        if self._currentValue == None or self.gpsFix() < 2:
    6566            return 0
    66         return self._session.fix.track
     67        return self._currentValue.fix.track
    6768
    6869    def gpsFix(self):
    69         if self._session == None:
     70        if self._currentValue == None:
    7071            return 0
    71         return self._session.fix.mode
     72        return self._currentValue.fix.mode
    7273
    7374    def status(self):
    74         if self._session == None or self.gpsFix() < 2:
     75        if self._currentValue == None or self.gpsFix() < 2:
    7576            return "V"
    7677        return "A"
    7778
    7879    def timeUtc(self):
    79         if self._session == None or self.gpsFix() < 2:
     80        if self._currentValue == None or self.gpsFix() < 2:
    8081            return None
    81         currentTime = self._session.fix.time
     82        currentTime = self._currentValue.fix.time
    8283        if isinstance(currentTime, float):
    8384            return datetime.datetime.fromtimestamp(currentTime)
    84         return dateutil.parser.parse(self._session.fix.time)
     85        return dateutil.parser.parse(currentTime)
    8586
    8687    def stop(self):
    … …  
    9091        try:
    9192            while self._running:
    92                 self._currentValue = self._session.next()
    93                 time.sleep(float(self._logperiod) / 2.0)
     93                try:
     94                    self._currentValue = self._session.next()
     95                except StopIteration:
     96                    break;
     97                except:
     98                    print "Failed to read gpsd data"
     99                    print(traceback.format_exc())
     100                    self._currentValue = None
    94101        except StopIteration:
    95102            pass
  • src/python/gnuboat/daemon/n2kdpoller.py

    r949f66d r944372e  
    2121import socket
    2222import json
     23import traceback
    2324
    2425"""@class N2kdPoller
    … …  
    7879        response = ""
    7980        while 1:
    80             data = n2kdSocket.recv(1024)
     81            try:
     82                data = n2kdSocket.recv(1024)
     83            except:
     84                print "Failed to update n2kd data"
     85                print(traceback.format_exc())
     86                self._waterDepthValid = False
    8187            if not data:
    8288                break
  • src/python/gnuboat/daemon/rrdhandler.py

    r949f66d r944372e  
    1919import rrdtool
    2020import os
     21import traceback
    2122
    2223def rrd_create_database(database_file, logperiod, start_time = 'N'):
    … …  
    5253
    5354def rrd_update(rrdfile, value_string):
    54     rrdtool.update(rrdfile, value_string)
     55    try:
     56        rrdtool.update(rrdfile, value_string)
     57    except:
     58        print "Failed to update rrd database %s with values\n  %s" % (rrdfile, value_string)
     59        print(traceback.format_exc())
    5560
    5661def _rows(duration, resolution, step):
Note: See TracChangeset for help on using the changeset viewer.