Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 35877 Details for
Bug 57848
Gnome weather 2.{4,6} does not supply forecasts for UK locations
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch (v. Gnome applets/gweather 2.6.2) to enable UK forecasts
gw.diff (text/plain), 11.27 KB, created by
Jonathan Hudson
on 2004-07-21 07:12:41 UTC
(
hide
)
Description:
Patch (v. Gnome applets/gweather 2.6.2) to enable UK forecasts
Filename:
MIME Type:
Creator:
Jonathan Hudson
Created:
2004-07-21 07:12:41 UTC
Size:
11.27 KB
patch
obsolete
>--- weather.c.orig 2004-07-20 23:21:17.483361120 +0100 >+++ weather.c 2004-07-20 23:25:37.807785792 +0100 >@@ -1163,89 +1163,122 @@ > > static char *met_reprocess(char *x, int len) > { >- char *p = x; >- char *o; >- int spacing = 0; >- static gchar *buf; >- static gint buflen = 0; >- gchar *lastspace = NULL; >- int count = 0; >- int lastcount = 0; >- >- if(buflen < len) >- { >- if(buf) >- g_free(buf); >- buf=g_malloc(len); >- buflen=len; >- } >- memcpy(buf, x, len); >- >- o=buf; >- >- while(*p) >- { >- if(isspace(*p)) >- { >- spacing=1; >- p++; >- continue; >- } >- if(spacing) >- { >- if(count>75) >- { >- if(lastspace) >- *lastspace = '\n'; >- count -= lastcount; >- } >- lastspace = o; >- lastcount = count; >- *o++=' '; >- spacing=0; >- } >+ char *p = x; >+ char *o; >+ int spacing = 0; >+ static char *buf; >+ static int buflen = 0; >+ char *lastspace = NULL; >+ int count = 0; >+ >+ if(buflen < len) >+ { >+ if(buf) >+ g_free(buf); >+ buf=g_malloc(len); >+ buflen=len; >+ } >+ memcpy(buf, x, len); >+ >+ o=buf; >+ >+ while(*p) >+ { >+ if(isspace(*p)) >+ { >+ p++; >+ spacing = 1; >+ continue; >+ } > >- if(*p=='&') >- { >- if(strncasecmp(p, "&", 5)==0) >- { >- *o++='&'; >- count++; >- p+=5; >- continue; >- } >- if(strncasecmp(p, "<", 4)==0) >- { >- *o++='<'; >- count++; >- p+=4; >- continue; >- } >- if(strncasecmp(p, ">", 4)==0) >- { >- *o++='>'; >- count++; >- p+=4; >- continue; >- } >- } >- if(*p=='<') >- { >- if(strncasecmp(p, "<BR>", 4)==0) >- { >- *o++='\n'; >- count=0; >- lastspace = NULL; >- p+=4; >- continue; >- } >- break; >- } >- *o++=*p++; >- count++; >- } >- *o=0; >- return buf; >+ if(spacing) >+ { >+ if(count > 75) >+ { >+ if(lastspace) >+ { >+ *lastspace = '\n'; >+ count = o - lastspace; >+ } >+ } >+ if(count) >+ { >+ lastspace = o; >+ *o++ = ' '; >+ count++; >+ } >+ spacing = 0; >+ continue; >+ } >+ >+ if(*p=='&') >+ { >+ if(strncasecmp(p, "&", 5)==0) >+ { >+ *o++='&'; >+ count++; >+ p+=5; >+ continue; >+ } >+ if(strncasecmp(p, "<", 4)==0) >+ { >+ *o++='<'; >+ count++; >+ p+=4; >+ continue; >+ } >+ if(strncasecmp(p, ">", 4)==0) >+ { >+ *o++='>'; >+ count++; >+ p+=4; >+ continue; >+ } >+ if(strncasecmp(p, " ", 6)==0) >+ { >+ *o++=' '; >+ count++; >+ p+=6; >+ continue; >+ } >+ } >+ if(*p=='<') >+ { >+ if(strncasecmp(p, "<p>", 3)==0) >+ { >+ *o++='\n'; >+ *o++='\n'; >+ spacing = 0; >+ count=0; >+ lastspace = NULL; >+ p+=3; >+ continue; >+ } >+ >+ if(strncasecmp(p, "<br>", 4)==0) >+ { >+ *o++='\n'; >+ spacing = 0; >+ count=0; >+ lastspace = NULL; >+ p+=4; >+ continue; >+ } >+ else >+ { >+ while(*p && *p != '>') >+ { >+ p++; >+ } >+ p++; >+ continue; >+ } >+ } >+ *o++=*p++; >+ count++; >+ } >+ *o=0; >+ return buf; > } > > >@@ -1261,59 +1294,27 @@ > gchar *rp; > gchar *r = g_strdup("Met Office Forecast\n"); > gchar *t; >- gint i=0; > >- static char *key[]= >- { >- "<!-- <!TODAY_START> -->", >- "<!-- <!TONIGHT_START> -->", >- "<!-- <!TOMORROW_START> -->", >- "<!-- <!OUTLOOK_START> -->", >- NULL >- }; >- static char *keyend[]= >- { >- "<!-- <!TODAY_END> -->", >- "<!-- <!TONIGHT_END> -->", >- "<!-- <!TOMORROW_END> -->", >- "<!-- <!OUTLOOK_END> -->", >- NULL >- }; >- static char *name[4]= >- { >- "Today:", >- "Tonight:", >- "Tomorrow:", >- "Outlook:" >- }; >- >- >- while(key[i]!=NULL) >- { >- p=strstr(meto, key[i]); >- if(p==NULL) >- { >- printf("No %s\n", key[i]); >- i++; >- continue; >- } >- p+=strlen(key[i]); >- >- rp = strstr(p, keyend[i]); >- if(rp==NULL) >- { >- printf("No %s\n", keyend[i]); >- i++; >- continue; >- } >- >- /* p to rp is the text block we want but in HTML malformat */ >+ static char *key[] = {"Issued at:","Summary:"}; >+ static char *keyend = "<table"; > >- t = g_strconcat(r, name[i], "\n", met_reprocess(p, rp-p), "\n", NULL); >- >- g_free(r); >- r = t; >- i++; >+ p=strstr(meto, key[1]); >+ if(p) >+ { >+ rp = strstr(p, keyend); >+ if(rp) >+ { >+ rp -= strlen(keyend); >+ *(++rp) = 0; >+ /* p to rp is the text block we want but in HTML malformat */ >+ t = g_strconcat(r, "", "\n", met_reprocess(p, rp-p), "\n", NULL); >+ g_free(r); >+ r = t; >+ } >+ else >+ { >+ puts("fscked"); >+ } > } > return r; > } >@@ -1400,7 +1401,7 @@ > WeatherLocation *loc; > loc = info->location; > >- url = g_strdup_printf("http://www.metoffice.gov.uk/datafiles/%s.html", loc->zone+1); >+ url = g_strdup_printf("http://www.met-office.gov.uk/weather/europe/uk/%s_printable.html", loc->zone+1); > > gnome_vfs_async_open(&info->met_handle, url, GNOME_VFS_OPEN_READ, > 0, met_finish_open, info); >--- Locations.orig 2004-07-20 23:21:31.414243304 +0100 >+++ Locations 2004-07-20 23:27:14.336111256 +0100 >@@ -2316,117 +2316,117 @@ > name=East & South East > loc0=Barkston\\ Heath EGYE ------ --- > loc1=Benson EGUB ------ --- >-loc2=Biggin\\ Hill EGKB :RBPMS --- >-loc3=Cambridge EGSC :RNPMS- --- >+loc2=Biggin\\ Hill EGKB :southeast --- >+loc3=Cambridge EGSC :eastern- --- > loc4=Coltishall EGYC ------ --- >-loc5=Cranfield EGTC :RIPMS --- >+loc5=Cranfield EGTC :centralsouthern --- > loc6=Farnborough EGLF ------ --- > loc7=Holbeach EGYH ------ --- >-loc8=London/City EGLC :RBPMS --- >-loc9=London/Gatwick EGKK :RBPMS --- >-loc10=London/Heathrow EGLL :RBPMS --- >-loc11=London/Stansted EGSS :RBPMS --- >-loc12=Luton EGGW :RBPMS --- >+loc8=London/City EGLC :southeast --- >+loc9=London/Gatwick EGKK :southeast --- >+loc10=London/Heathrow EGLL :southeast --- >+loc11=London/Stansted EGSS :southeast --- >+loc12=Luton EGGW :southeast --- > loc13=Manston EGMH ------ --- > loc14=Marham EGYM ------ --- > loc15=Mildenhall EGUN ------ --- > loc16=Northolt EGWU ------ --- >-loc17=Norwich EGSH :RNPMS --- >+loc17=Norwich EGSH :eastern --- > loc18=Odiham EGVO ------ --- >-loc19=Shoreham EGKA :RBPMS --- >-loc20=Southend EGMC :RBPMS --- >+loc19=Shoreham EGKA :southeast --- >+loc20=Southend EGMC :southeast --- > loc21=Wattisham EGUW ------ --- > loc22=Wittering EGXT ------ --- > loc23=Wyton EGUY ------ --- > > [EU_UK_MI] > name=Midlands >-loc0=Birmingham EGBB :BBPMS --- >+loc0=Birmingham EGBB :midlands --- > loc1=Brize\\ Norton EGVN ------ --- > loc2=Cosford EGWC ------ --- > loc3=Coventry EGBE ------ --- >-loc4=East\\ Midlands EGNX :BBPMS --- >+loc4=East\\ Midlands EGNX :midlands --- > loc5=Gloustershire EGBJ ------ --- >-loc6=Shawbury EGOS :BBPMS --- >+loc6=Shawbury EGOS :midlands --- > > [EU_UK_NE] > name=North East > loc0=Coningsby EGXC ------ --- > loc1=Cranwell EGYD ------ --- > loc2=Dishforth EGXD ------ --- >-loc3=Humberside EGNJ :RTPMS --- >+loc3=Humberside EGNJ :yorkslincs --- > loc4=Leeming EGXE ------ --- > loc5=Linton-on-Ouse EGXU ------ --- >-loc6=Newcastle EGNT :RTPMS --- >+loc6=Newcastle EGNT :yorkslincs --- > loc7=Scampton EGXP ------ --- >-loc8=Teesside EGNV :RTPMS --- >+loc8=Teesside EGNV :yorkslincs --- > loc9=Topcliffe EGXZ ------ --- > loc10=Waddington EGXW ------ --- > > [EU_UK_NW] > name=North West >-loc0=Blackpool EGNH :RCPMS --- >-loc1=Boulmer EGQM :RTPMS --- >-loc2=Carlisle EGNC :RCPMS --- >+loc0=Blackpool EGNH :northwest --- >+loc1=Boulmer EGQM :yorkslincs --- >+loc2=Carlisle EGNC :northwest --- > loc3=Hawarden EGNR ------ --- >-loc4=Isle\\ of\\ Man EGNS :RCPMS --- >-loc5=Leeds/Bradford EGNM :RYPMS --- >-loc6=Liverpool EGGP :RCPMS --- >-loc7=Manchester EGCC :RCPMS --- >+loc4=Isle\\ of\\ Man EGNS :northwest --- >+loc5=Leeds/Bradford EGNM :yorkslincs --- >+loc6=Liverpool EGGP :northwest --- >+loc7=Manchester EGCC :northwest --- > > [EU_UK_SW] > name=South and South West > loc0=Alderney EGJA ------ --- > loc1=Boscombe\\ Down EGDM ------ --- >-loc2=Bournemouth EGHH :RIPMS --- >-loc3=Bristol EGGD :RDPMS --- >+loc2=Bournemouth EGHH :centralsouthern --- >+loc3=Bristol EGGD :westcountry --- > loc4=Bristol\\ Filton EGTG ------ --- >-loc5=Culdrose EGDR :RD2PMS --- >-loc6=Exeter EGTE :RD2PMS --- >+loc5=Culdrose EGDR :devoncornwall --- >+loc6=Exeter EGTE :devoncornwall --- > loc7=Guernsey EGJB ------ --- > loc8=Jersey EGJJ ------ --- >-loc9=Lyneham EGDL :BBPMS --- >+loc9=Lyneham EGDL :midlands --- > loc10=Middle\\ Wallop EGVP ------ --- >-loc11=Plymouth EGHD :RD2PMS --- >-loc12=Portland EGDP :RIPMS --- >-loc13=Scilly\\ St\\ Mary\'s EGHE :RD2PMS --- >-loc14=Southampton EGHI :RIPMS --- >-loc15=St\\ Mawgan EGDG :RD2PMS --- >-loc16=Staverton EGBJ :RDPMS --- >-loc17=Yeovilton EGDY :RDPMS --- >+loc11=Plymouth EGHD :devoncornwall --- >+loc12=Portland EGDP :centralsouthern --- >+loc13=Scilly\\ St\\ Mary\'s EGHE :devoncornwall --- >+loc14=Southampton EGHI :centralsouthern --- >+loc15=St\\ Mawgan EGDG :devoncornwall --- >+loc16=Staverton EGBJ :westcountry --- >+loc17=Yeovilton EGDY :westcountry --- > > > [EU_UK_NI] > name=Northern Ireland >-loc0=Belfast/Aldergrove EGAA :AAPMS --- >-loc1=Belfast/City EGAC :AAPMS --- >-loc2=Londonderry EGAE :AAPMS --- >+loc0=Belfast/Aldergrove EGAA :nireland --- >+loc1=Belfast/City EGAC :nireland --- >+loc2=Londonderry EGAE :nireland --- > > [EU_UK_SC] > name=Scotland >-loc0=Aberdeen EGPD :RQPMS --- >-loc1=Benbecula EGPL :RAPMS --- >-loc2=Dundee EGPN :RAPMS --- >-loc3=Edinburgh EGPH :RAPMS --- >-loc4=Glasgow EGPF :RAPMS --- >-loc5=Inverness EGPE :RQPMS --- >+loc0=Aberdeen EGPD :sescotland --- >+loc1=Benbecula EGPL :nwscotland --- >+loc2=Dundee EGPN :nwscotland --- >+loc3=Edinburgh EGPH :nwscotland --- >+loc4=Glasgow EGPF :nwscotland --- >+loc5=Inverness EGPE :sescotland --- > loc6=Islay EGPI ------ --- >-loc7=Kinloss EGQK :RQPMS --- >+loc7=Kinloss EGQK :sescotland --- > loc8=Kirkwall EGPA ------ --- >-loc9=Leuchars EGQL :RQPMS --- >-loc10=Lossiemouth EGQS :RQPMS --- >-loc11=Prestwick EGPK :RAPMS --- >-loc12=Scatsta EGPM :RQPMS --- >-loc13=Stornoway EGPO :RQPMS --- >-loc14=Sumburgh EGPB :RQPMS --- >+loc9=Leuchars EGQL :sescotland --- >+loc10=Lossiemouth EGQS :sescotland --- >+loc11=Prestwick EGPK :nwscotland --- >+loc12=Scatsta EGPM :sescotland --- >+loc13=Stornoway EGPO :sescotland --- >+loc14=Sumburgh EGPB :sescotland --- > loc15=Tain EGQA ------ --- >-loc16=Tiree EGPU :RQPMS --- >-loc17=Unst EGPW :RQPMS --- >-loc18=Wick EGPC :RQPMS --- >+loc16=Tiree EGPU :sescotland --- >+loc17=Unst EGPW :sescotland --- >+loc18=Wick EGPC :sescotland --- > > [EU_UK_WA] > name=Wales >-loc0=Cardiff EGFF :RGPMS --- >+loc0=Cardiff EGFF :wales --- > loc1=Pembrey EGOP ------ --- > loc2=St\\ Athan EGDX ------ --- > loc3=Valley EGOV ------ ---
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 57848
: 35877