The branch, frodo has been updated
       via  7df3edb5ba6df8d3b57fe22d750bc6779557987e (commit)
      from  cf3e867e6e1c9a963d6e96c8be674be1067d74db (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=7df3edb5ba6df8d3b57fe22d750bc6779557987e

commit 7df3edb5ba6df8d3b57fe22d750bc6779557987e
Author: Martijn Kaijser <[email protected]>
Date:   Sat Mar 16 11:21:39 2013 +0100

    [weather.ozweather] 0.6.3

diff --git a/weather.ozweather/addon.xml b/weather.ozweather/addon.xml
index 0df909a..1ae6a8b 100644
--- a/weather.ozweather/addon.xml
+++ b/weather.ozweather/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="weather.ozweather" name="Oz Weather" version="0.6.1" 
provider-name="Bossanova808">
+<addon id="weather.ozweather" name="Oz Weather" version="0.6.3" 
provider-name="Bossanova808">
        <requires>
                <import addon="xbmc.python" version="2.1.0"/>
     <import addon="script.module.parsedom" version="1.2.0"/>
diff --git a/weather.ozweather/changelog.txt b/weather.ozweather/changelog.txt
index fe0d4d0..56020e1 100644
--- a/weather.ozweather/changelog.txt
+++ b/weather.ozweather/changelog.txt
@@ -1,3 +1,6 @@
+V0.6.3
+- Can now search by suburb name not just postcode
+
 V0.6.1
 - Bump for Frodo
 - Cleanup, better logging (in debug mode)
diff --git a/weather.ozweather/default.py b/weather.ozweather/default.py
index bd19344..5345458 100644
--- a/weather.ozweather/default.py
+++ b/weather.ozweather/default.py
@@ -498,14 +498,14 @@ socket.setdefaulttimeout(100)
 
 #the being called from the settings section where the user enters their 
postcodes
 if sys.argv[1].startswith('Location'):
-    keyboard = xbmc.Keyboard('', 'Enter your 4 digit postcode e.g. 3000', 
False)
+    keyboard = xbmc.Keyboard('', LANGUAGE(30195), False)
     keyboard.doModal()
     if (keyboard.isConfirmed() and keyboard.getText() != ''):
         text = keyboard.getText()
 
         log("Doing locations search for " + text)
         #need to submit the postcode to the weatherzone search
-        searchURL = 'http://www.weatherzone.com.au/search/'
+        searchURL = WEATHERZONE_URL + '/search/'
         user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
         host = 'www.weatherzone.com.au'
         headers = { 'User-Agent' : user_agent, 'Host' : host }
@@ -526,22 +526,27 @@ if sys.argv[1].startswith('Location'):
             log("Single result " + str(locations) + " URL " + str(locationids))
         else:
             #we got back a page to choose a more specific location
-            middle = common.parseDOM(resultPage, "div", attrs = { "id": 
"structure_middle" })
-            skimmed = common.parseDOM(middle, "ul", attrs = { "class": "typ2" 
})
-            #ok now get two lists - one of the friendly names
-            #and a matchin one of the URLs to store
-            locations = common.parseDOM(skimmed[0], "a")
-            templocs = common.parseDOM(skimmed[0], "a", ret="href")
-            #build the full urls
-            locationids = []
-            for count, loc in enumerate(templocs):
-                locationids.append(WeatherZoneURL + loc)
-            #if we did not get enough data back there are no locations with 
this postcode
-            if len(locations)<=1:
-                log("No locations found with this postcode")
-                locations = []
+            try:
+                locations=[]
+                locationids=[]
+                middle = common.parseDOM(resultPage, "div", attrs = { "id": 
"structure_middle" })
+                skimmed = common.parseDOM(middle, "ul", attrs = { "class": 
"typ2" })
+                #ok now get two lists - one of the friendly names
+                #and a matchin one of the URLs to store
+                locations = common.parseDOM(skimmed[0], "a")
+                templocs = common.parseDOM(skimmed[0], "a", ret="href")
+                #build the full urls
                 locationids = []
-            log("Multiple result " + str(locations) + " URLs " + 
str(locationids))
+                for count, loc in enumerate(templocs):
+                    locationids.append(WEATHERZONE_URL + '/' + loc)
+                #if we did not get enough data back there are no locations 
with this postcode
+                if len(locations)<=1:
+                    log("No locations found with this postcode")
+                    locations = []
+                    locationids = []
+                log("Multiple result " + str(locations) + " URLs " + 
str(locationids))
+            except:
+                log("Error - middle: " + str(middle) + " skimmed " + 
str(skimmed))
 
 
         #now get them to choose an actual location
diff --git a/weather.ozweather/resources/language/English/strings.xml 
b/weather.ozweather/resources/language/English/strings.xml
index c1df911..e7e1a04 100644
--- a/weather.ozweather/resources/language/English/strings.xml
+++ b/weather.ozweather/resources/language/English/strings.xml
@@ -1,22 +1,17 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <strings>
        <string id="30101">OzWeather Settings</string>
-       
-  <string id="30111">Change Postcode 1</string>
-       <string id="30112">Change Postcode 2</string>
-       <string id="30113">Change Postcode 3</string>
-       <string id="30114">Change Postcode 4</string>
-       <string id="30115">Change Postcode 5</string>
-       <string id="30116">Change Postcode 6</string>
-       
-       <string id="30155">Change Radar ID for Postcode 1</string>
-       <string id="30156">Change Radar ID for Postcode 2</string>
-       <string id="30157">Change Radar ID for Postcode 3</string>
-       <string id="30158">Change Radar ID for Postcode 4</string>
-       <string id="30159">Change Radar ID for Postcode 5</string>
-       <string id="30160">Change Radar ID for Postcode 6</string>
+
+    <string id="30111">Change Suburb 1</string>
+       <string id="30112">Change Suburb 2</string>
+       <string id="30113">Change Suburb 3</string>
+
+       <string id="30155">Change Radar ID for Suburb 1 (e.g. IDR022)</string>
+       <string id="30156">Change Radar ID for Suburb 2</string>
+       <string id="30157">Change Radar ID for Suburb 3</string>
 
        <string id="30194">Use extended features (long forecast, radar 
loop)</string>
 
+    <string id="30195">Enter suburb name, or your 4 digit postcode e.g. 
3051</string>
+
 </strings>
-                      
\ No newline at end of file
diff --git a/weather.ozweather/resources/settings.xml 
b/weather.ozweather/resources/settings.xml
index 29be02f..ceb04ef 100644
--- a/weather.ozweather/resources/settings.xml
+++ b/weather.ozweather/resources/settings.xml
@@ -4,28 +4,13 @@
                <setting id="Location1" label="30111" type="action" 
action="RunScript($ID,Location1)" default=""/>
                <setting id="Location2" label="30112" type="action" 
action="RunScript($ID,Location2)" enable="!eq( -1,)" default=""/>
                <setting id="Location3" label="30113" type="action" 
action="RunScript($ID,Location3)" enable="!eq( -1,)" default=""/>
-               <!--
-    <setting id="Location4" label="30114" type="action" 
action="RunScript($ID,Location4)" enable="!eq( -1,)" default=""/>
-               <setting id="Location5" label="30115" type="action" 
action="RunScript($ID,Location5)" enable="!eq( -1,)" default=""/>
-               <setting id="Location6" label="30116" type="action" 
action="RunScript($ID,Location6)" enable="!eq( -1,)" default=""/>
-               -->
-    <setting id="ExtendedFeaturesToggle" label="30194" type="bool" 
default="false"/>        
+    <setting id="ExtendedFeaturesToggle" label="30194" type="bool" 
default="false"/>
                <setting id="Radar1" label="30155" type="text" 
default="IDR00004"/>
                <setting id="Radar2" label="30156" type="text" enable="!eq( 
-4,)" default=""/>
                <setting id="Radar3" label="30157" type="text" enable="!eq( 
-4,)" default=""/>
-               <!--
-    <setting id="Radar4" label="30158" type="text" enable="!eq( -8,)" 
default=""/>
-               <setting id="Radar5" label="30159" type="text" enable="!eq( 
-8,)" default=""/>
-               <setting id="Radar6" label="30160" type="text" enable="!eq( 
-8,)" default=""/>
-               -->
-    <setting id="Location1id" type="text" visible="false" default=""/>
+           <setting id="Location1id" type="text" visible="false" default=""/>
                <setting id="Location2id" type="text" visible="false" 
default=""/>
                <setting id="Location3id" type="text" visible="false" 
default=""/>
-               <!--
-    <setting id="Location4id" type="text" visible="false" default=""/>
-               <setting id="Location5id" type="text" visible="false" 
default=""/>
-               <setting id="Location6id" type="text" visible="false" 
default=""/>
-               -->
        </category>
 </settings>
 

-----------------------------------------------------------------------

Summary of changes:
 weather.ozweather/addon.xml                        |    2 +-
 weather.ozweather/changelog.txt                    |    3 ++
 weather.ozweather/default.py                       |   39 +++++++++++---------
 .../resources/language/English/strings.xml         |   25 +++++--------
 weather.ozweather/resources/settings.xml           |   19 +---------
 5 files changed, 38 insertions(+), 50 deletions(-)


hooks/post-receive
-- 
Scripts

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to