Ticket #7128: 7128.diff

File 7128.diff, 9.2 KB (added by Joe Ripley <vitaminjoe@…>, 11 years ago)

Add copyright notices, update README, remove warnings

  • mythplugins/mythweather/mythweather/scripts/README

     
    6767pause text or the current date and time.  A + prepending the item name signifies
    6868an item that is required to show the screen, these are provided by scripts.  The
    6969text of the name within the weather-ui.xml file (with prepending flag removed)
    70 must match exactly the string returned by the -T flag; as well as the token
     70must match exactly the string returned by the '-t' flag; as well as the token
    7171returned when retrieving data.
    7272
    7373If you want to see the code that controls the scripts within the plugin, look at
  • mythplugins/mythweather/mythweather/scripts/us_nws/ndfd.pl

     
    1414our ($opt_v, $opt_t, $opt_T, $opt_l, $opt_u, $opt_d);
    1515
    1616my $name = 'NDFD-6_day';
    17 my $version = 0.1;
     17my $version = 0.2;
    1818my $author = 'Lucien Dunning';
    1919my $email = 'ldunning@gmail.com';
    2020my $updateTimeout = 15*60;
     
    2323        'high-0', 'high-1', 'high-2', 'high-3', 'high-4', 'high-5',
    2424        'low-0', 'low-1', 'low-2', 'low-3', 'low-4', 'low-5',
    2525        'icon-0', 'icon-1', 'icon-2', 'icon-3', 'icon-4', 'icon-5',
    26         'date-0', 'date-1', 'date-2', 'date-3', 'date-4', 'date-5');
     26        'date-0', 'date-1', 'date-2', 'date-3', 'date-4', 'date-5', 'copyright');
    2727my $dir = './';
    2828getopts('Tvtlu:d:');
    2929
     
    141141printf "updatetime::Last Updated on %s\n",
    142142       UnixDate($creationdate, "%b %d, %I:%M %p %Z");
    143143
     144printf "copyright::National Digital Forecast Database\n";
     145
    144146foreach $time (sort(keys(%$result))) {
    145147    my $date;
    146148    if ($time =~ m/,/) {
  • mythplugins/mythweather/mythweather/scripts/us_nws/nws-alert.pl

     
    102102our ($opt_v, $opt_t, $opt_T, $opt_l, $opt_u, $opt_d);
    103103
    104104my $name = 'NWS-Alerts';
    105 my $version = 0.1;
     105my $version = 0.2;
    106106my $author = 'Lucien Dunning';
    107107my $email = 'ldunning@gmail.com';
    108108my $updateTimeout = 10*60;
    109109my $retrieveTimeout = 30;
    110 my @types = ('swlocation', 'updatetime', 'alerts');
     110my @types = ('swlocation', 'updatetime', 'alerts', 'copyright');
    111111my $dir = "./";
    112112
    113113getopts('Tvtlu:d:');
     
    182182
    183183print "updatetime::Last Updated on " .
    184184UnixDate(Date_ConvTZ(ParseDate($updatetime)), "%b %d, %I:%M %p %Z") . "\n";
     185print "copyright::NOAA,National Weather Service\n";
    185186
    186187sub doLocation {
    187188    my $code = shift;
  • mythplugins/mythweather/mythweather/scripts/us_nws/ndfd18.pl

     
    99our ($opt_v, $opt_t, $opt_T, $opt_l, $opt_u, $opt_d);
    1010
    1111my $name = 'NDFD-18_Hour';
    12 my $version = 0.1;
     12my $version = 0.2;
    1313my $author = 'Lucien Dunning';
    1414my $email = 'ldunning@gmail.com';
    1515my $updateTimeout = 15*60;
     
    1818        'temp-0', 'temp-1', 'temp-2', 'temp-3', 'temp-4', 'temp-5',
    1919        '18icon-0', '18icon-1', '18icon-2', '18icon-3', '18icon-4', '18icon-5',
    2020        'pop-0', 'pop-1', 'pop-2', 'pop-3', 'pop-4', 'pop-5',
    21         'time-0', 'time-1', 'time-2', 'time-3', 'time-4', 'time-5');
     21        'time-0', 'time-1', 'time-2', 'time-3', 'time-4', 'time-5', 'copyright');
    2222my $dir = './';
    2323
    2424getopts('Tvtlu:d:');
     
    130130my $icon;
    131131printf "updatetime::Last Updated on %s\n",
    132132       UnixDate($creationdate, "%b %d, %I:%M %p %Z");
     133printf "copyright::National Digital Forecast Database\n";
    133134my $pop12;
    134135foreach my $time (sort keys %$result) {
    135136    if (defined $result->{$time}->{'probability-of-precipitation_12 hour'}) {
  • mythplugins/mythweather/mythweather/scripts/us_nws/nwsxml.pl

     
    1010our ($opt_v, $opt_t, $opt_T, $opt_l, $opt_u, $opt_d);
    1111
    1212my $name = 'NWS-XML';
    13 my $version = 0.2;
     13my $version = 0.3;
    1414my $author = 'Lucien Dunning';
    1515my $email = 'ldunning@gmail.com';
    1616my $updateTimeout = 15*60;
     
    2121        'wind_dir', 'wind_degrees', 'wind_speed', 'wind_gust',
    2222        'pressure_string', 'pressure', 'dewpoint_string', 'dewpoint',
    2323        'heat_index_string', 'heat_index', 'windchill_string', 'windchill',
    24         'visibility', 'weather_icon', 'appt', 'wind_spdgst');
     24        'visibility', 'weather_icon', 'appt', 'wind_spdgst', 'copyright');
    2525my $dir = "./";
    2626
    2727getopts('Tvtlu:d:');
     
    9999            $xml->{$key} = int($xml->{'wind_mph'} * 1.609344 + .5);
    100100        }
    101101    } elsif (/wind_gust/) {
    102         if ($units =~ /ENG/ || $xml->{'wind_gust_mph'} eq 'NA') {
    103             $key = 'wind_gust_mph';
     102        if (defined($xml->{'wind_gust_mph'})) {
     103            if ($units =~ /ENG/ || $xml->{'wind_gust_mph'} eq 'NA') {
     104                $key = 'wind_gust_mph';
     105            } else {
     106                $key = 'wind_gust_kph';
     107                $xml->{$key} = int($xml->{'wind_gust_mph'} * 1.609344 + .5);
     108            }
    104109        } else {
    105             $key = 'wind_gust_kph';
    106             $xml->{$key} = int($xml->{'wind_gust_mph'} * 1.609344 + .5);
     110            $xml->{'wind_gust_mph'} = 'NA';
     111            $xml->{'wind_gust_kph'} = 'NA';
     112            $key = 'wind_gust';
    107113        }
    108114    } elsif (/visibility/) {
    109115        if ($units =~ /ENG/) {
     
    128134    } elsif (/cclocation/) {
    129135        $key = 'location';   
    130136    } elsif (/appt$/) {
    131         if ($xml->{windchill_f} eq 'NA') {
    132             $key = 'heat_index_f' if ($units =~ /ENG/);
    133             $key = 'heat_index_c' if ($units =~ /SI/);
    134         } else {
    135             $key = 'windchill_f' if ($units =~ /ENG/);
    136             $key = 'windchill_c' if ($units =~ /SI/);
    137         };
    138        
     137        if (defined($xml->{windchill_f})) {
     138            if ($xml->{windchill_f} eq 'NA') {
     139                $key = 'heat_index_f' if ($units =~ /ENG/);
     140                $key = 'heat_index_c' if ($units =~ /SI/);
     141            } else {
     142                $key = 'windchill_f' if ($units =~ /ENG/);
     143                $key = 'windchill_c' if ($units =~ /SI/);
     144            };
     145        } else {
     146            $key = 'appt';
     147        }
    139148    } elsif (/wind_spdgst/) {
    140149        # relying on this being after speed and gust
    141150        $key = "wind_spdgst";
     
    144153        } else {
    145154            $xml->{$key} = "$xml->{wind_kph} ($xml->{wind_gust_kph}) kph";
    146155        }
    147 
     156    } elsif (/copyright/) {
     157        $key = "copyright";
     158        $xml->{$key} = $xml->{credit};
    148159    } else {
    149160        $key = $label;
    150161    }
    151     printf $label . "::" . $xml->{$key}. "\n";
     162
     163    print $label . "::";
     164    if (defined($xml->{$key})) {
     165        print $xml->{$key};
     166    } else {
     167        print "NA";
     168    }
     169    print "\n";
    152170}
  • mythplugins/mythweather/mythweather/scripts/us_nws/animaps.pl

     
    88our ($opt_v, $opt_t, $opt_T, $opt_l, $opt_u, $opt_d);
    99
    1010my $name = 'Animated-Map-Download';
    11 my $version = 0.1;
     11my $version = 0.2;
    1212my $author = 'Lucien Dunning';
    1313my $email = 'ldunning@gmail.com';
    1414my $updateTimeout = 10*60;
    1515my $retrieveTimeout = 30;
    16 my @types = ('amdesc', 'updatetime', 'animatedimage');
     16my @types = ('amdesc', 'updatetime', 'animatedimage', 'copyright');
    1717my $dir = "./";
    1818
    1919getopts('Tvtlu:d:');
     
    7575print "amdesc::$desc\n";
    7676printf "animatedimage::${path}%%1-$i%s\n", ($size && "-$size" || '');
    7777print "updatetime::Last Updated on " . UnixDate("now", "%b %d, %I:%M %p %Z") . "\n";
     78print "copyright::The Weather Channel Interactive, Inc.\n";
  • mythplugins/mythweather/mythweather/scripts/us_nws/maps.pl

     
    88our ($opt_v, $opt_t, $opt_T, $opt_l, $opt_u, $opt_d);
    99
    1010my $name = 'Map-Download';
    11 my $version = 0.1;
     11my $version = 0.2;
    1212my $author = 'Lucien Dunning';
    1313my $email = 'ldunning@gmail.com';
    1414my $updateTimeout = 10*60;
    1515my $retrieveTimeout = 30;
    16 my @types = ('smdesc', 'updatetime', 'map');
     16my @types = ('smdesc', 'updatetime', 'map', 'copyright');
    1717my $dir = "./";
    1818
    1919getopts('Tvtlu:d:');
     
    7070print "smdesc::$desc\n";
    7171printf "map::$path%s\n", ($size && "-$size" || '');
    7272print "updatetime::Last Updated on " . UnixDate("now", "%b %d, %I:%M %p %Z") . "\n";
     73print "copyright::The Weather Channel Interactive, Inc.\n";