Puppy now has a home-grown weather forecast utility!

Business software, financial software, etc.
Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

Re: Further testing in Other Pups

#21 Post by musher0 »

davids45 wrote:G'day/jour,

I have now copied the missing libtinfo.so.5 to a number of different Pups.

Precise looks OK now, also PupJibaroJessie.

Slackos are also fine with the Tahr-derived libtinfo.so.5.

In PupJibaroWheezy, nothing happened so I tried running less in a terminal and got a 'Missing file' message that I don't understand - see screenshot. What file is missing?

In SnowPup, I saw a message about the wrong glibc - not surprising as this is a kernel-2.xxx Pup.

In DPupWheezy with a 3.5.2 kernel, after less gave the enigmatic above 'missing file' message from the terminal, I ran wttr.in.sh in the terminal and had another glibc message (screenshot).

I may need to explore the LIBRARYPATH option for the affected files?

Why I need as many weather apps as I can get:
:oops: I was wrong again (see my previous post)! Looks like we had 26+C today - so I gave my car its annual "whether it needs it or not" wash. Back to cold for the weekend by the looks of the forecasts :( .

David S.
Hi David.

Another informative report. Thanks.

Less needs a text file to show the user! The less program is a text reader. Proper
syntax is < less text-xyz.txt >. If you don't have a *.txt file nearby to feed it, you
could do as your screen cap suggests and type < less --help > ! This means that
less is working though.

The DPupWheezy libc result with st was to be expected. I compiled it on Precise
5.4.3 that has a glibc of 2.15, whereas wheezy's glibc is only a 2.13. Back to the
drawing board on that one.You don't need to change anything, I'll simply recompile
st on a lower glibc such as DpupWheezy's.

About yesterday's arrowheads: the Inconsolata font has been fired. It was "her
fault": she couldn't keep her heads. ;) The LiberationMono font is being called in
as a substitute.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#22 Post by musher0 »

Hello all!

Here is the latest version: WorldWeather-3.7c9-corr2.pet. Please download from:
http://www82.zippyshare.com/v/Nruf9Oqk/file.html

(If you downloaded earlier, please accept my apologies and download the above.
French member augras discovered an oversight in the previous archive. I also found
a couple of oversights. The archive above now contains the appropriate corrections.)

Changes :
-- The menu is now using vovchik's new evolution of aemenu, aemenu-pango
(please see attached capture). Many thanks to vovchik. This evolved aemenu
incorporates markups (such as typographic characters, bolds, etc.) to make the
menu easier to focus on, and generally clearer.

This welcome update by vovchik means that you can follow a kind of "style sheet"
to keep the parts of your menu consistent with one another.

-- Any advanced operation (such as cleaning up old weather reports in /var/tmp) is
now grouped under the "Expert" sub-menu.

-- The stations.txt list of world weather stations is now included in the "Expert"
sub-menu. This list enables the user to search for a location pretty much in any
country.

Once the list is displayed in the less reader, to search it you type "/" (forward
diagonal) character and the name of a location. To continue searching forward for the
word, you type "n"; to search backwards, you type "N" (capital n).

-- The icon is back in the middle of the screen.

-- The Inconsolata font has been replaced with the LiberationMono font because of
the arrowheads not showing properly in the Inconsolata font.

-- I recompiled the st terminal under a sulu Puppy (C library 2.11) to accommodate
use of the script with older Puppies.

-- The version number change from 2 to 3 means that this is the 3rd interface
(vovchik's "pango" aemenu is being used in this version, whereas the regular aemenu
was used in version 2, and a straight console was used in version 1). The other
numbers refer to the main script version (which means it has remained virtually
unchanged from last time.)

If you find a bug, please do not hesitate to leave a post here.

Enjoy! :)
Attachments
weather-menu-with-markups_2016-07-23(1).jpg
(28.37 KiB) Downloaded 548 times
weather-menu-with-markups_2016-07-23.jpg
(24.23 KiB) Downloaded 569 times
Last edited by musher0 on Sat 23 Jul 2016, 23:23, edited 2 times in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#23 Post by musher0 »

There was a suggested correction here, but it's not needed if you download the very latest
archive mentioned above.

Thanks for your understanding.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

Wind direction - almost right

#24 Post by davids45 »

G'jour/day musher0,

I'm trying your latest version (link in your second last post).

The weather icon was screen centre and not behind my widgets :) , although in this Wheezy Pup, it did make the widgets disappear as before. Pwidgets sometimes does this with other packages, so it is probably a pwidgets issue. Re-starting pwidgets and all is good again.

Also I still have the "terminal not fully functioning" message and I need to hit <Enter> for the report to display. Check the top line of the attached report screenshot where this warning/error is still present. Your early report screenshots don't have this start-up message so it is a puzzle for me as all my Pups seem to do this Warning.

Your fix for getting the wind direction arrows to fully display is nearly right. In the attached screenshot, the SE wind arrow looks thicker than the easterly wind arrow and is very slightly cut at its tip?

Can the wind arrows be coloured (e.g. blue, which does not look like it is used for other coloured text)? Today, these are very cold winds here, so blue looks appropriate, for this hemisphere anyway :) ).

Thanks for your efforts,

David S.
Attachments
weather_windarrows.png
Top corner of latest report
(34.52 KiB) Downloaded 510 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#25 Post by musher0 »

Hello David.

Thanks for the thanks and thanks for testing.

About the arrowheads: at least now it affects only part of the NW and the SW
arrows. But I'm still looking for a better font.

As to coloring the arrows in blue or another color, I'm afraid that the change for
that would be up river from this script, on Mr. Chubin's originating site. Besides,
the wind speed numbers right next to the wind arrow are colored, no?

I have discovered that our developer colleague Chubin has color-coded the digits
for the wind speed and the temperatures: if you look closely, you'll see that the
higher those digits are, the "redder" they get!

~~~~~~~~~
I found a number of potential solutions for the "Terminal Warning" through
http://www.ask.com/web?q=linux+terminal ... archTopBox

Are you running your Puppies on a Windows-based virtual machine of some kind?
The bug seems to happen mostly on WhineDose machines. In any case, what
does

Code: Select all

echo $TERM
tell you?

A potential solution suggested by ubuntu users could be to type, in terminal,

Code: Select all

export TERM=xterm
and/or to include it near the top of your /root/.bashrc configuration file.
(Please see attached screen captures.)

Have a great day!
Attachments
this-is-what-I-have_2016-07-24.jpg
(2.95 KiB) Downloaded 506 times
this-is-what-I-have_2016-07-24(2).jpg
(43.54 KiB) Downloaded 502 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#26 Post by musher0 »

@David:

About you having to restart pwidgets after the weather script icon has been placed,
here's a new take on the pinstall.sh script.

This script should :
-- kill any running pwidgets
-- place the weather con in the middle of the screen
-- then restore the pwidgets to their former state.

Care to try it? You can try it on its own. It will just put another weather-script icon
on screen. It worked on my set-up, but I'd like to have a second opinion, please,
before I incorporate it in my next version. Thanks in advance.

BFN.
~~~~~~~~~~~~~~~~~~

Code: Select all

#!/bin/sh
# pinstall.sh # pour / for Meteo-ds-le-monde
# (c) Christian L'Écuyer, alias « musher0 » (forum PuppyLinux), 
#     ... Gatineau (Qc), Canada, 23 juillet 2016. GPL3. ...
#  /usr/share/doc/meteo-tradFR/gpl3_fr.sh affichera la license.
####
fc-cache -r # pour installer la fonte requise. / To install the required font.

####
# Icone-Meteo # pour déposer l'icône sur le bureau
####
[ "`ps | grep pwidgets`" ] && PwidgetS=1 && killall -q conky
# Remove any running pwidgets.

# Prepare 
cd /root/Choices/ROX-Filer
cp -f PuppyPin PuppyPin.cdr # Copie de réserve / Back-up

HauTPPin="`wc -l < PuppyPin`";HauTPPin="`expr $HauTPPin - 1`"
head -n $HauTPPin PuppyPin > PuppyPin.tmp

# Measure screen
VertIcN="`xwininfo -root | awk '$1=="Height:" { print $2/2}'`" 
HorizIcN="`xwininfo -root | awk '$1=="Width:" { print $2/2}'`" # 8*7
# En plein milieu de l'écran. / Right in the middle of the screen.
[ "${LANG:0:2}" = "fr" ] && EtiqT="Météo" || EtiqT="Weather"

# Create new PuppyPin
echo "<icon x=\"$HorizIcN\" y=\"$VertIcN\" label=\"$EtiqT\">/usr/share/applications/Weather_around_the_World.desktop</icon>
</pinboard>" >> PuppyPin.tmp

# Enable
mv -f PuppyPin.tmp PuppyPin
rox -p /root/Choices/ROX-Filer/PuppyPin

# Restore pwidgets if they were active.
[ $PwidgetS -eq 1 ] && /root/Startup/0_show_widgets
Attachments
pinstall.sh.zip
Unzip in /root/my-applications/bin, make executable and run. (It's the same script as the one above.)
(960 Bytes) Downloaded 533 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

Success with Wheezies with latest version (glibc fixed?)

#27 Post by davids45 »

G'jour/day musher0,

I've now tested your latest version in two Wheezy Pups that hadn't reported with earlier versions but now both do :D .

I don't have Windows on this computer and 'echo $TERM' returned 'xterm' in this Pup (Frugal PupjibaroWheezy).

I had noticed the colouring of the numbers for temperature and wind speed, and now you've pointed it out, the higher values have the psychologically warmer colours. Although looking at a few currently warm cities, there is a bit of variation for the change-over values. I wonder what the colour change will be for +50C which is more likely in the future - I'd almost class that as 'getting a bit hot' :shock: .
What about colouring the wind direction arrow the same colour as the first speed value, or would that detract from its visibility - where the wind is coming from is as important as its speed range, if not more so, in my experience.

I see you displaying a fancier set of dialog boxes during location selecting than I get. Is that with vovchik's aemenu-pango pet which must be separately installed? Will it affect all program menus?

I'll test when I can the other fixes you've offered in recent posts, and report back.

An ongoing thank you.

David S.

ASD

#28 Post by ASD »

Hi again musher0,

Just to let you know; I took up your suggestion and sent an email to Igor a few days ago - asking for clarification about the precise meaning of some of the output.

He may be away or perhaps he is busy with important matters, but I'll post again if I have anything useful to report.

I tried your later version and note that "Noon" now reads "Afternoon", which seems have been effected by you rather than Igor.

There will be hundreds of UK locations where local postcodes work well so that's encouraging.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#29 Post by musher0 »

ASD wrote:Hi again musher0,

Just to let you know; I took up your suggestion and sent an email to Igor a few days ago - asking for clarification about the precise meaning of some of the output.

He may be away or perhaps he is busy with important matters, but I'll post again if I have anything useful to report.

I tried your later version and note that "Noon" now reads "Afternoon", which seems have been effected by you rather than Igor.

There will be hundreds of UK locations where local postcodes work well so that's encouraging.
Hi ASD!

Yeah, translating "noon" to "afternoon" is my doing! Guilty as charged! Also thanks
for trying to get in touch with the "up river" author.

You are right about the postal codes. I tested my postal code for Canada and it
works fine. Another way to find the weather for your exact location is entering the
latitude and longitude of your home. You may get that info using a little program
called Locator, which the forum has right here!

I mention these little tricks because sometimes entering the name of your city or of
the nearest airport doesn't quite cut it. For example, this morning, for my city, the
wttr report said there was intermittent rain, but it was pouring outside my window!!
When I narrowed it down with the postal code and even more so with the lat./long.
coordinates, the weather report and the actual weather "agreed", as davids45 once
put it! :)

Finally, responding to an earlier concern of yours, I found a way to integrate the
imperial (aka Fahrenheit) degrees in the menu. I published it already on the
French side. However, I didn't have the time to translate the presentation and
explanations of the changes and additions yet and publish it here.

Also the new archive is in two parts, which you have to reassemble with this line

Code: Select all

cat WorldWeather-3.8a.pet-0? > WorldWeather-3.8a.pet
before installation proper. (If you wish to get it from there.)

TWYL. (Talk With You Later.)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#30 Post by musher0 »

Good evening everyone.

Please welcome version 3.8a.

Changes
-- You can now search the Stations.txt reference without worrying about upper-case
or lower-case.

-- The script has been promoted : version 3.8a ;)

New
-- Four new items in the « Expert » sub-menu :

-- 2 little no-fuss converters, from Celsius to Fahrenheit and vice versa

-- You can select to have the reports in Celsius ou Fahrenheit degrees. (Watch it:
if you change degrees, all existing weather reports will be erased.)

Installation
-- Detection of pwidgets at install time: if pwidgets is active, it is closed before the
weather script icon is placed on the desktop, and then it is re-activated. Thanks to
davids45 for making me aware of the problem.

-- The pet archive is attached, but in two parts. To re-assemble it, type:

Code: Select all

cat WorldWeather-3.8a.pet-0? > WorldWeather-3.8a.pet
Screen caps will follow.

Enjoy!
Attachments
Script_Meteo-3.8a_EN-2016-07-26.jpg
(37.86 KiB) Downloaded 424 times
WorldWeather-3.8a.pet-01.zip
Please see how-to below.
(188.46 KiB) Downloaded 539 times
WorldWeather-3.8a.pet-02.zip
Unzip the two parts in a convenient place. Open a terminal in that directory and type the line above to reassemble the parts. Then install the reassembled pet archive as usual.
(188.45 KiB) Downloaded 529 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

A stand-alone Config directory (not /var/tmp)?

#31 Post by davids45 »

G'day/jour musher0,

Thanks for the continuing improvements to the "weather".

I see the expert information is held in separate files in /var/tmp.

I run lots of Pups on this computer and wherever possible, centralise personal program data such as config files on my data partition and symlink these out to the Pups. Every Pup has the same personal information so I don't need to do a lot of re-installing of profiles and the like. Any new or updated 'expert' information can be immediately shared by all Pups.

Could the 'expert' information (that is, stuff I create for me within the program as my 'profile') be held in a separate and specifically named directory, for example, /var/myweather/ or /root/.config/myweather? I then just symlink this special directory to keep every Pup up to date.

This is rather than use separate files in a 'general' directory like /var/tmp that other programs may also send files to? Symlinking every Pup's /var/tmp to my data partition may give problems with other programs or other programs could over-write my 'expert' profile.

This symlink of profile data is particularly handy with frugals who already share sfs files. Have you tried an .sfs yet as an alternative to the .pets?

David S.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

Re: A stand-alone Config directory (not /var/tmp)?

#32 Post by musher0 »

davids45 wrote:G'day/jour musher0,

Thanks for the continuing improvements to the "weather".

I see the expert information is held in separate files in /var/tmp.

I run lots of Pups on this computer and wherever possible, centralise personal program data such as config files on my data partition and symlink these out to the Pups. Every Pup has the same personal information so I don't need to do a lot of re-installing of profiles and the like. Any new or updated 'expert' information can be immediately shared by all Pups.

Could the 'expert' information (that is, stuff I create for me within the program as my 'profile') be held in a separate and specifically named directory, for example, /var/myweather/ or /root/.config/myweather? I then just symlink this special directory to keep every Pup up to date.

This is rather than use separate files in a 'general' directory like /var/tmp that other programs may also send files to? Symlinking every Pup's /var/tmp to my data partition may give problems with other programs or other programs could over-write my 'expert' profile.

This symlink of profile data is particularly handy with frugals who already share sfs files. Have you tried an .sfs yet as an alternative to the .pets?

David S.
Hi David.

My pleasure!

Interesting idea.

Not an sfs, no, because sfs's are static, and weather data is dynamic by nature.

A directory outside the pupsave file, possibly at /mnt/home/Weather comes to
mind. It could be accessed from different Pups. I'll give it some thought.

BFN.

~~~~~~~~~~~~~
PS. What do you think of this other idea?
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#33 Post by musher0 »

Hello again, David.

Here you go!

This little script will let you change where you store your weather reports. It's
reversible. From /var/tmp to /mnt/home/Vetero and vice versa. ("Vetero" is the
esperanto word for "weather".)

The script will move "almost" all your data from A to B. I say "almost": the only
caveat seems to be any longitude/latitude data that you would have: those will
have to be re-fetched in the usual way.

Any feedback on bugs is welcome, as you know.

Enjoy!
~~~~~~~~~~~

Code: Select all

#!/bin/sh
# Vetero.sh # Change from /var/tmp to /mnt/home/Vetero and vice versa.
# Changer de /var/tmp à /mnt/home/Vetero et vice versa.
# Dépendance / dependency : replaceit
# (c) Christian L'Écuyer, alias « musher0 » (forum PuppyLinux), 
#     ... Gatineau (Qc), Canada, 27 juillet 2016. GPL3. ...
#  /usr/share/doc/meteo-tradFR/gpl3_fr.sh affichera la license. 
#  /usr/share/doc/meteo-tradFR/gpl3.sh will show the licence.
####
case "${LANG:0:2}" in
	fr)MssG="
\t\e[1;3;37mVeuillez entrer où vous voulez enregistrer les bulletins météo :

\t\t\e[1;3;37m'var' pour les enregistrer dans /var/tmp
\t   \e[1;3;37m'home' pour les enregistrer dans /mnt/home/Vetero\e[0m
" ;;	
	*)MssG="
\t\e[1;3;37mPlease type where you want your weather info to be stored:

\t\t\e[1;3;37m'var' if you want it stored in /var/tmp
\t   \e[1;3;37m'home' if you want it stored in /mnt/home/Vetero\e[0m
" ;;
esac
echo -e "$MssG"

read W

case "$W" in
	home)mkdir -p /mnt/home/Vetero # The word "weather" in esperanto!
	mv -f /var/tmp/* /mnt/home/Vetero
	replaceit --input=/usr/local/bin/meteo-tradFR-8a.sh "/var/tmp" "/mnt/home/Vetero" 
	;;
	var)# In reverse
	mkdir -p /var/tmp
	mv -f /mnt/home/Vetero/* /var/tmp
	replaceit --input=/usr/local/bin/meteo-tradFR-8a.sh "/mnt/home/Vetero" "/var/tmp"
	;;
esac # echo $W

chmod +x /usr/local/bin/meteo-tradFR-8a.sh

case "${LANG:0:2}" in
	fr)NotE="
\t\e[1;3;37mNOTA -- Veuillez noter qu'un tel déplacement des données peut
\t\e[1;3;37mrendre inutilisables vos enregistrements en longitude et latitude. 
\t\e[1;3;37mSi tel était le cas, veuillez effacer ces données en long./lat.
\t\e[1;3;37met demander de nouvelles prévisions avec ces coordonnéees.\e[0m
" ;;
	*)NotE="
\t\e[1;3;37mNOTE -- Please be aware that this move process can make your 
\t\e[1;3;37mlongitude/latitude data unusable. If such was the case, 
\t\e[1;3;37mplease erase the former long./lat. data and ask for a new  
\t\e[1;3;37mreport with the same coordinates.\e[0m
" ;;
esac
echo -e "$NotE"
Attachments
Vetero.sh.zip
Unzip in /usr/local/bin and make executable.
(1.04 KiB) Downloaded 617 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

Vetero script

#34 Post by davids45 »

G'day/jour musher0,

I downloaded the .zip you posted and made the extract executable.

I run it in a terminal but get nothing but a blinking cursor after a few blank lines (see screenshot). (The screenshot happened during a blink of the cursor :roll: so it's missing )
There is no new directory in /mnt/home/ and my sydney.source file is still in /var/tmp
I have the dependency (replaceit) installed.

I'd like the weather package to put the sydney weather source file into /mnt/sda5/Puppy_Archive/weather/ rather than /var/tmp by default.

Is this what your script will do? I can then make my own pet from the installed files that will automatically include Sydney when this pet is installed into any new Pup. Likewise an sfs for the Frugals with Sydney already 'loaded' in the expert area.

Thanks,

David S.
Attachments
image-7.png
missing cursor about halfway down window
(21.11 KiB) Downloaded 555 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#35 Post by musher0 »

Hi David.

Oops. :oops: My oversight. I forgot that some people prefer their console to have
black type on a white background. I prefer white on black myself.

I used ANSI codes to color the type white, which is why you are seeing nothing...
Sorry about that... :oops:

Ok. I'll change the color of the type. What is your favorite color ? Red? Green?
Blue? :D How about purple? In ANSI we have a limited choice of 8 colors, but still.

Unless you have a ready-made black background console somewhere?
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#36 Post by musher0 »

Hopefully this will be better -- in green ! (Even if the screen capture is white on black.)

I also introduced some sanity checks and made sure that the appropriate menu
entries were changed as well.

Code: Select all

#!/bin/sh
# Vetero.sh # Change from /var/tmp to /mnt/home/Vetero and vice versa.
# Changer de /var/tmp à /mnt/home/Vetero et vice versa.
# (c) Christian L'Écuyer, alias « musher0 » (forum PuppyLinux), 
#     ... Gatineau (Qc), Canada, 27-28 juillet 2016. GPL3. ...
#  /usr/share/doc/meteo-tradFR/gpl3_fr.sh affichera la license. 
#  /usr/share/doc/meteo-tradFR/gpl3.sh will show the licence.
####
case "${LANG:0:2}" in
	fr)MssG="
\t      \e[4mScript pour changer les données météo de répertoire\e[0m

\t\e[1;3;32mVeuillez entrer où vous voulez enregistrer les bulletins météo :

\t\t\e[1;3;32m'var' pour les enregistrer dans /var/tmp
\t   \e[1;3;32m'home' pour les enregistrer dans /mnt/home/Vetero\e[0m
" ;;	
	*)MssG="
\t        \e[4mScript to change the weather data directory\e[0m

\t\e[1;3;32mPlease type where you want your weather info to be stored:

\t\t\e[1;3;32m'var' if you want it stored in /var/tmp
\t   \e[1;3;32m'home' if you want it stored in /mnt/home/Vetero\e[0m
" ;;
esac
clear
echo -e "$MssG"

read W

case "$W" in
	home)if [ "`ls /mnt/home/Vetero`" != "" ];then 
			[ "${LANG:0:2}" = "fr" ] && ActiF="Ce répertoire est déjà actif. Veuillez choisir l'autre !" || ActiF="This directory is already active. Please choose the other one."
			echo -e "\t\e[2;3;5m$ActiF\e[0m\n"
			exit
		else
			mkdir -p /mnt/home/Vetero # The word "weather" in esperanto!
			mv -f -u /var/tmp/* /mnt/home/Vetero
			for i in /usr/local/bin/meteo-tradFR-8a.sh /usr/local/share/Listes_Meteo/wttr.FR.lst /usr/local/share/Listes_Meteo/wttr.EN.lst
			do
				replaceit --input=$i "/var/tmp" "/mnt/home/Vetero" 
				replaceit --input=$i "/var/tmp" "/mnt/home/Vetero"
			done 
		fi ;;
	var)# In reverse
		if [ "`ls /var/tmp`" != "" ];then 
			[ "${LANG:0:2}" = "fr" ] && ActiF="Ce répertoire est déjà actif. Veuillez choisir l'autre !" || ActiF="This directory is already active. Please choose the other one."
			echo -e "\t\e[2;3;5m$ActiF\e[0m\n"
			exit
		else
			mkdir -p /var/tmp
			mv -f -u /mnt/home/Vetero/* /var/tmp
			for i in /usr/local/bin/meteo-tradFR-8a.sh /usr/local/share/Listes_Meteo/wttr.FR.lst /usr/local/share/Listes_Meteo/wttr.EN.lst
			do
				replaceit --input=$i "/mnt/home/Vetero" "/var/tmp"
				replaceit --input=$i "/mnt/home/Vetero" "/var/tmp"
			done 
		fi ;;
esac # echo $W

chmod +x /usr/local/bin/meteo-tradFR-8a.sh

case "${LANG:0:2}" in
	fr)NotE="
\t\e[1;3;32mNOTA -- Veuillez noter qu'un tel déplacement des données peut
\t\e[1;3;32mrendre inutilisables vos enregistrements en longitude et latitude. 
\t\e[1;3;32mSi tel est le cas, veuillez effacer ces données en long./lat.
\t\e[1;3;32met demander de nouvelles prévisions avec ces coordonnéees.\e[0m
" ;;
	*)NotE="
\t\e[1;3;32mNOTE -- Please be aware that this move process can make your 
\t\e[1;3;32mlongitude/latitude data unusable. If such was the case, 
\t\e[1;3;32mplease erase the former long./lat. data and ask for a new  
\t\e[1;3;32mreport with the same coordinates.\e[0m
" ;;
esac
echo -e "$NotE"
Attachments
Change-dir_2016-07-28(1).jpg
(21.57 KiB) Downloaded 521 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

ASD

#37 Post by ASD »

Hi musher0,

Igor has not, thus far, replied to my (polite though he may well think cranky) email seeking his clarification of the precise meaning of his wttr output.

The screen shot showing the weather for New Orleans airport (where the time is exactly six hours earlier than here in England)
was taken using the terminal code "curl wttr.in/New?u"

The best sense I can make of the screen shot is:

The highlighted block (to which the green left arrow points) actually represents today 12.01 a.m. to 6.00 a.m. and, if this is correct, it seems, to me, to be highly misleading that it bears no description. It also seems that the green right arrow really displays the identical period for tomorrow.

It also seems, to me, that the four periods (if six hours each) would be better described as:
12.01 a.m. to 6.00 a.m. - Morning - Afternoon - 6.01 p.m. to 12.00 p.m.

Also, all the boxed blocks would then be best displayed by moving every block one space to its right except for the last block, which would be lost unless an extra day were to be shown (Sun 31 Jul in this case), with the highlighted block dropped down into the, now vacated, first position.
--------------------------------------------
The picture was taken a few minutes after noon (local time here in England) when the time in New Orleans was just after 6.00 a.m.
So, I would expect all data to refer to New Orleans time, but (strangely though hopefully not suspiciously) the rain spots for Noon today (though equally oddly for Noon on Sat 30) were flashing.
--------------------------------------------
On some minor points:
For the imperial measures I like Farenheit, Miles and Inches
I don't like the dots in the dates
As an option, I quite like plain white text on a black background.
--------------------------------------------
I am aware that you are aware of much, probably all, of the above and that you have already replaced Noon with Afternoon.
Attachments
wttr.png
(48.67 KiB) Downloaded 557 times

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#38 Post by musher0 »

Hello ASD.

I think you're basically right. The report could have a few extra words for the top
left "rectangle", such as "your weather now", perhaps. It wouldn't hurt at all.

Also, I always found strange in the wttr report that the day began at 6 am. That is
indeed confusing, because at change of date (normally midnight, no?) the forecast
for the current day appears, but you don't know for certain if the box at the far
right is for this night or the next.

As you say, the order of the boxes should be: night, morning, afternoon and
evening, optionally with hours of the day.

Technically, I am certain some Puppy developer could put the boxes in that order
at this end, it would only take perhaps a couple of seconds more to process and
then display.

The challenge is rather patience on the dev's part: if you look at the report in a
text editor, there's a forest of sensitive ANSI codes in there. How do you play
blocks with them? ANSI codes are also called "escape sequence codes", and this
escape sequence makes it difficult to work with them in awk or replaceit or even in
the bash strings processor.

And the killer argument, IMO: if a dev could correct the presentation logic at this
end, it wouldn't really solve the problem -- which is up river from this script, isn't?

About the discrepancy in your screen capture, the top box apparently not being
related to any other box in the report : it can happen that the forecast becomes a
prediction ?! ;)

As an aside, I don't know Mr. Chubin at all, but I'm sure he's a busy man, his
site serving the world, as I understand it.

If you are not happy with this type of weather report in console, here are others
that I have heard of:
-- the inxi utility has one
-- the BBC (I don't mean the news! They have a site similar to wttr.in.)
-- Also the US government at http://www.weather.gov/tg/siteloc.shtml,
-- and your own, no doubt. For ex. the Canadian government has its weather
agency at https://meteo.gc.ca/city/pages/qc-126_metric_f.html

Finally, you may have noticed that my latest version of the script allows the user
to get the weather report in Fahrenheit degrees as well as Celsius.

IHTH.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#39 Post by musher0 »

@David:

The script below is almost the same as the one above, but the type is in "straight
green" rather than "bold green", for better readability (IMO) on black or white
background.

IHTH. BFN.

~~~~~~~~~~~

Code: Select all

#!/bin/sh
# Vetero.sh # Change from /var/tmp to /mnt/home/Vetero and vice versa.
# Changer de /var/tmp à /mnt/home/Vetero et vice versa.
# (c) Christian L'Écuyer, alias « musher0 » (forum PuppyLinux), 
#     ... Gatineau (Qc), Canada, 27-28 juillet 2016. GPL3. ...
#  /usr/share/doc/meteo-tradFR/gpl3_fr.sh affichera la license. 
#  /usr/share/doc/meteo-tradFR/gpl3.sh will show the licence.
####
case "${LANG:0:2}" in
	fr)MssG="
\t      \e[4mScript pour changer les données météo de répertoire\e[0m

\t\e[32mVeuillez entrer où vous voulez enregistrer les bulletins météo :

\t\t\e[32m'var' pour les enregistrer dans /var/tmp
\t   \e[32m'home' pour les enregistrer dans /mnt/home/Vetero\e[0m
" ;;	
	*)MssG="
\t        \e[4mScript to change the weather data directory\e[0m

\t\e[32mPlease type where you want your weather info to be stored:

\t\t\e[32m'var' if you want it stored in /var/tmp
\t   \e[32m'home' if you want it stored in /mnt/home/Vetero\e[0m
" ;;
esac
clear
echo -e "$MssG"

read W

case "$W" in
	home)if [ "`ls /mnt/home/Vetero`" != "" ];then 
			[ "${LANG:0:2}" = "fr" ] && ActiF="Ce répertoire est déjà actif. Veuillez choisir l'autre !" || ActiF="This directory is already active. Please choose the other one."
			echo -e "\t\e[2;3;5m$ActiF\e[0m\n"
			exit
		else
			mkdir -p /mnt/home/Vetero # The word "weather" in esperanto!
			mv -f -u /var/tmp/* /mnt/home/Vetero
			for i in /usr/local/bin/meteo-tradFR-8a.sh /usr/local/share/Listes_Meteo/wttr.FR.lst /usr/local/share/Listes_Meteo/wttr.EN.lst
			do
				replaceit --input=$i "/var/tmp" "/mnt/home/Vetero" 
				replaceit --input=$i "/var/tmp" "/mnt/home/Vetero"
			done 
		fi ;;
	var)# In reverse
		if [ "`ls /var/tmp`" != "" ];then 
			[ "${LANG:0:2}" = "fr" ] && ActiF="Ce répertoire est déjà actif. Veuillez choisir l'autre !" || ActiF="This directory is already active. Please choose the other one."
			echo -e "\t\e[2;3;5m$ActiF\e[0m\n"
			exit
		else
			mkdir -p /var/tmp
			mv -f -u /mnt/home/Vetero/* /var/tmp
			for i in /usr/local/bin/meteo-tradFR-8a.sh /usr/local/share/Listes_Meteo/wttr.FR.lst /usr/local/share/Listes_Meteo/wttr.EN.lst
			do
				replaceit --input=$i "/mnt/home/Vetero" "/var/tmp"
				replaceit --input=$i "/mnt/home/Vetero" "/var/tmp"
			done 
		fi ;;
esac # echo $W

chmod +x /usr/local/bin/meteo-tradFR-8a.sh

case "${LANG:0:2}" in
	fr)NotE="
\t\e[32mNOTA -- Veuillez noter qu'un tel déplacement des données peut
\t\e[32mrendre inutilisables vos enregistrements en longitude et latitude. 
\t\e[32mSi tel est le cas, veuillez effacer ces données en long./lat.
\t\e[32met demander de nouvelles prévisions avec ces coordonnéees.\e[0m
" ;;
	*)NotE="
\t\e[32mNOTE -- Please be aware that this move process can make your 
\t\e[32mlongitude/latitude data unusable. If such was the case, 
\t\e[32mplease erase the former long./lat. data and ask for a new  
\t\e[32mreport with the same coordinates.\e[0m
" ;;
esac
echo -e "$NotE"
Attachments
Vetero.sh.zip
Unzip in /usr/local/bin and make executable before using.
(1.29 KiB) Downloaded 597 times
Change-dir_2016-07-28(2).jpg
Pardon my use of the French, but it's as an illustration of the new color appearance.
I think it's quite readable now, independently of the color of the background.
(55.39 KiB) Downloaded 496 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

ASD

#40 Post by ASD »

Hi again,

Firstly, the level of detail and the display style is ideally suited to my needs, if only I fully understood the display.


However,
The report could have a few extra words for the top
left "rectangle", such as "your weather now", perhaps. It wouldn't hurt at all.
I do not think it can ever be “now

Post Reply