Page 366 of 380 FirstFirst ... 266316356364365366367368376 ... LastLast
Results 3,651 to 3,660 of 3796

Thread: Conky Weather Forecast Python Script

  1. #3651
    Join Date
    Aug 2011
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    Quote Originally Posted by kaivalagi View Post
    Out of curiosity have you ever seen more than one alert for a single location? The json structure supports it, as a result I am going through it with a for loop just in case. I wonder if using the first element in the list is all that's needed or not?
    I just got a double alert.
    In case you wanted to see it here it is.
    Code:
        "alerts": [
            {
            "type": "WIN",
            "description": "Winter Weather Advisory",
            "date": "9:31 PM EST on January 12, 2012",
            "date_epoch": "1326421860",
            "expires": "3:00 PM EST on January 13, 2012",
            "expires_epoch": "1326484800",
            "message": "\u000A...Winter Weather Advisory remains in effect until 3 PM EST\u000AFriday...\u000A\u000A* locations...northeast Kentucky...southeast Ohio...a large\u000A portion of West Virginia...and extreme western Virginia.\u000A\u000A* Hazard types...snow showers of varying intensity.\u000A\u000A* Accumulations...1 to 3 inches of snow.\u000A\u000A* Timing...overnight into Friday afternoon.\u000A\u000A* Impacts...untreated surfaces may become slippery. Gusty winds\u000A will cause some blowing of the snow reducing visibility for\u000A brief periods of time.\u000A\u000A* Winds...southwest or west at 15 to 25 mph with gusts up to 35 \u000A mph. These gusts may cause minor damage or power outages. \u000A\u000A* Temperatures...falling to around 20 before dawn.\u000A\u000APrecautionary/preparedness actions...\u000A\u000AA Winter Weather Advisory for snow and blowing snow means that\u000Avisibilities will be limited due to a combination of falling and\u000Ablowing snow. Use caution when traveling...especially in open\u000Aareas. Please report snow accumulations to the National Weather\u000AService by calling toll free...877-633-6772.\u000A\u000A\u000A\u000A\u000A\u000A",
            "phenomena": "WW",
            "significance": "Y"
            }
            ,
            {
            "type": "SPE",
            "description": "Special Statement",
            "date": "8:48 PM EST on January 12, 2012",
            "date_epoch": "1326419280",
            "expires": "10:00 PM EST on January 12, 2012",
            "expires_epoch": "1326423600",
            "message": "\u000AHere is a Special Weather Statement from the National Weather\u000AService...\u000A\u000AJust before 9 o\u0027clock...temperatures have dropped below\u000Afreezing...or will do so very shortly.\u000A\u000AIf you plan to drive this evening...any untreated wet surface may\u000Abecome icy. This is especially true for elevated surfaces such as\u000Abridges.\u000A\u000A\u000A\u000AKtb\u000A\u000A\u000A",
            "phenomena": "SP",
            "significance": "S"
            }
        ]
    Now I need to decide what do when this happens in my weather script.
    Right now I just have a warning that adds +N More Alerts to the first alert "description" so I can look at the json to read the others if there are more than one alerts.
    I don't think I will leave it that way though.

  2. #3652
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    Quote Originally Posted by arclance View Post
    I just got a double alert.
    In case you wanted to see it here it is.
    Code:
        "alerts": [
            {
            "type": "WIN",
            "description": "Winter Weather Advisory",
            "date": "9:31 PM EST on January 12, 2012",
            "date_epoch": "1326421860",
            "expires": "3:00 PM EST on January 13, 2012",
            "expires_epoch": "1326484800",
            "message": "\u000A...Winter Weather Advisory remains in effect until 3 PM EST\u000AFriday...\u000A\u000A* locations...northeast Kentucky...southeast Ohio...a large\u000A portion of West Virginia...and extreme western Virginia.\u000A\u000A* Hazard types...snow showers of varying intensity.\u000A\u000A* Accumulations...1 to 3 inches of snow.\u000A\u000A* Timing...overnight into Friday afternoon.\u000A\u000A* Impacts...untreated surfaces may become slippery. Gusty winds\u000A will cause some blowing of the snow reducing visibility for\u000A brief periods of time.\u000A\u000A* Winds...southwest or west at 15 to 25 mph with gusts up to 35 \u000A mph. These gusts may cause minor damage or power outages. \u000A\u000A* Temperatures...falling to around 20 before dawn.\u000A\u000APrecautionary/preparedness actions...\u000A\u000AA Winter Weather Advisory for snow and blowing snow means that\u000Avisibilities will be limited due to a combination of falling and\u000Ablowing snow. Use caution when traveling...especially in open\u000Aareas. Please report snow accumulations to the National Weather\u000AService by calling toll free...877-633-6772.\u000A\u000A\u000A\u000A\u000A\u000A",
            "phenomena": "WW",
            "significance": "Y"
            }
            ,
            {
            "type": "SPE",
            "description": "Special Statement",
            "date": "8:48 PM EST on January 12, 2012",
            "date_epoch": "1326419280",
            "expires": "10:00 PM EST on January 12, 2012",
            "expires_epoch": "1326423600",
            "message": "\u000AHere is a Special Weather Statement from the National Weather\u000AService...\u000A\u000AJust before 9 o\u0027clock...temperatures have dropped below\u000Afreezing...or will do so very shortly.\u000A\u000AIf you plan to drive this evening...any untreated wet surface may\u000Abecome icy. This is especially true for elevated surfaces such as\u000Abridges.\u000A\u000A\u000A\u000AKtb\u000A\u000A\u000A",
            "phenomena": "SP",
            "significance": "S"
            }
        ]
    Now I need to decide what do when this happens in my weather script.
    Right now I just have a warning that adds +N More Alerts to the first alert "description" so I can look at the json to read the others if there are more than one alerts.
    I don't think I will leave it that way though.
    Thanks for sharing, I'll be sure to add that to the json based test files in the conkyForecast package

    As the second is a special statement and likely to always be I would think, I'd say you could get away with tagging it on the end of either/both the description and message text you have from the first. Just for loop it with new lines added as you go through as we have in the conkyForecastWU script

  3. #3653
    Join Date
    Apr 2010
    Beans
    14

    Re: Conky Weather Forecast Python Script

    Changing the icon set in ~/.conkyForecastWU.config as mentioned in a previous post (ie ICON_SET = e), does not appear to have any effect.

  4. #3654
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    Quote Originally Posted by petvet2 View Post
    Changing the icon set in ~/.conkyForecastWU.config as mentioned in a previous post (ie ICON_SET = e), does not appear to have any effect.
    You'll need to delete the existing files you've previously downloaded into the cache folder, it only downloads icon files when you don't have any

    I guess I could include the icon set ID in the file names so we have uniqueness...looking at it now

  5. #3655
    Join Date
    Apr 2010
    Beans
    14

    Re: Conky Weather Forecast Python Script

    Thank you for your swift reply @kaivalagi, that worked perfectly!

  6. #3656
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    Quote Originally Posted by petvet2 View Post
    Thank you for your swift reply @kaivalagi, that worked perfectly!
    No worries, glad I can help

  7. #3657
    Join Date
    Jul 2007
    Location
    North Central Ohio, USA
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    @arclance - I woke up this morning to old weather data; the python script stopped with an error about 5AM. When I ran the python manually, this is what I got:
    Code:
    no pull yet
    3666.36041093
    pulling data
    backupUsed: False
    pullFailure: False
    pullFailure2: False
    Traceback (most recent call last):
      File "/usr/share/conkyforecast/conkyWunderground.py", line 1107, in <module>
        conkyWeather()
      File "/usr/share/conkyforecast/conkyWunderground.py", line 173, in conkyWeather
        outputString = makeOutput(weatherData, intellicastData, lastPull, moonState, False, False, False) # make output string
      File "/usr/share/conkyforecast/conkyWunderground.py", line 315, in makeOutput
        [currentMoonPhaseString,currentMoonImagePath,moonState] = convertMoonPhase(int(currentMoonAge),int(currentMoonIllumination),moonState) # convert to moon phase string and moonphase image path
      File "/usr/share/conkyforecast/conkyWunderground.py", line 1103, in convertMoonPhase
        moonImagePath = "/usr/share/conkyforecast/images/moonicons/" + moonImage
    UnboundLocalError: local variable 'moonImage' referenced before assignment
    Examining the json_readable.txt file indicates the following moon info:
    Code:
        ,    "moon_phase": {
            "percentIlluminated":"48",
            "ageOfMoon":"22",
            "current_time": {
            "hour":"8",
            "minute":"57"
            },
            "sunset": {
            "hour":"17",
            "minute":"27"
            },
            "sunrise": {
            "hour":"7",
            "minute":"52"
            }
        }
    If I am reading the the python correctly, with a percentilluminated of 48, it should be building a path to image 20.png.

    Any ideas?
    AMD Phenom II X4 B55 3.4GHz, 8GB RAM, Galaxy NVIDIA GT620 2GB, Biostar A880G+ mobo, dual-booting LinuxMint 14 Nadia MATE 64-bit , Windows 7 64-bit.

  8. #3658
    Join Date
    Aug 2011
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    Quote Originally Posted by Bob63 View Post
    @arclance - I woke up this morning to old weather data; the python script stopped with an error about 5AM. When I ran the python manually, this is what I got:
    Code:
    no pull yet
    3666.36041093
    pulling data
    backupUsed: False
    pullFailure: False
    pullFailure2: False
    Traceback (most recent call last):
      File "/usr/share/conkyforecast/conkyWunderground.py", line 1107, in <module>
        conkyWeather()
      File "/usr/share/conkyforecast/conkyWunderground.py", line 173, in conkyWeather
        outputString = makeOutput(weatherData, intellicastData, lastPull, moonState, False, False, False) # make output string
      File "/usr/share/conkyforecast/conkyWunderground.py", line 315, in makeOutput
        [currentMoonPhaseString,currentMoonImagePath,moonState] = convertMoonPhase(int(currentMoonAge),int(currentMoonIllumination),moonState) # convert to moon phase string and moonphase image path
      File "/usr/share/conkyforecast/conkyWunderground.py", line 1103, in convertMoonPhase
        moonImagePath = "/usr/share/conkyforecast/images/moonicons/" + moonImage
    UnboundLocalError: local variable 'moonImage' referenced before assignment
    Examining the json_readable.txt file indicates the following moon info:
    Code:
        ,    "moon_phase": {
            "percentIlluminated":"48",
            "ageOfMoon":"22",
            "current_time": {
            "hour":"8",
            "minute":"57"
            },
            "sunset": {
            "hour":"17",
            "minute":"27"
            },
            "sunrise": {
            "hour":"7",
            "minute":"52"
            }
        }
    If I am reading the the python correctly, with a percentilluminated of 48, it should be building a path to image 20.png.

    Any ideas?
    I woke up to the same error too
    Code:
    Traceback (most recent call last):
      File "conkyWunderground_Weather_confailtest_icast2_moonTest2.py", line 1148, in <module>
        conkyWeather()
      File "conkyWunderground_Weather_confailtest_icast2_moonTest2.py", line 164, in conkyWeather
        outputString = makeOutput(weatherData, intellicastData, lastPull, moonState, False, False, False) # make output string
      File "conkyWunderground_Weather_confailtest_icast2_moonTest2.py", line 309, in makeOutput
        [currentMoonPhaseString,currentMoonImagePath,moonState] = convertMoonPhase(int(currentMoonAge),int(currentMoonIllumination),moonState) # convert to moon phase string and moonphase image path
      File "conkyWunderground_Weather_confailtest_icast2_moonTest2.py", line 1113, in convertMoonPhase
        moonImagePath = "/usr/share/conkyforecast/images/moonicons/" + moonImage
    UnboundLocalError: local variable 'moonImage' referenced before assignment
    It found out that it was a typo...
    This line
    PHP Code:
        elif moonState == True:
            if 
    percentIlluminated 5
    should be this
    PHP Code:
        elif moonState == True:
            if 
    percentIlluminated 50
    it should be line 1068 for you.

  9. #3659
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    Quote Originally Posted by kaivalagi View Post
    All conkyForecastWU users please ensure that your localised ~/.conkyForecastWU.config file is updated to align to the one found in /usr/share/conkyforecast/conkyForecastWU.config as there have been a number of updates to the configuration data within!

    I see a lot of coding changes in the past little while are they a part of:
    Code:
      14:01:10 ~
             $ conkyForecast --version
    conkyForecast v2.24
    
      14:01:15 ~
             $ conkyForecastWU --version
    conkyForecastWU v2.24
    I'm slowly coming out of hibernation!

  10. #3660
    Join Date
    Jul 2007
    Location
    North Central Ohio, USA
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    Quote Originally Posted by arclance View Post
    I woke up to the same error too
    Code:
    Traceback (most recent call last):
      File "conkyWunderground_Weather_confailtest_icast2_moonTest2.py", line 1148, in <module>
        conkyWeather()
      File "conkyWunderground_Weather_confailtest_icast2_moonTest2.py", line 164, in conkyWeather
        outputString = makeOutput(weatherData, intellicastData, lastPull, moonState, False, False, False) # make output string
      File "conkyWunderground_Weather_confailtest_icast2_moonTest2.py", line 309, in makeOutput
        [currentMoonPhaseString,currentMoonImagePath,moonState] = convertMoonPhase(int(currentMoonAge),int(currentMoonIllumination),moonState) # convert to moon phase string and moonphase image path
      File "conkyWunderground_Weather_confailtest_icast2_moonTest2.py", line 1113, in convertMoonPhase
        moonImagePath = "/usr/share/conkyforecast/images/moonicons/" + moonImage
    UnboundLocalError: local variable 'moonImage' referenced before assignment
    It found out that it was a typo...
    This line
    PHP Code:
        elif moonState == True:
            if 
    percentIlluminated 5
    should be this
    PHP Code:
        elif moonState == True:
            if 
    percentIlluminated 50
    it should be line 1068 for you.
    Yup! That fixed it.
    AMD Phenom II X4 B55 3.4GHz, 8GB RAM, Galaxy NVIDIA GT620 2GB, Biostar A880G+ mobo, dual-booting LinuxMint 14 Nadia MATE 64-bit , Windows 7 64-bit.

Page 366 of 380 FirstFirst ... 266316356364365366367368376 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •