Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#476 Le 03/05/2013, à 16:33

ragamatrix

Re : [Conky] Alternative à weather.com (3)

j'ai modifié le template pour le script v9000 afin d'avoir des thermomètres qui changent de couleur en fonction de la T°:
thermo_lua
Il vous faudra aussi les fontes arrows et lobster ou mettez celles que vous voulez smile arrows-font  lobster-font
template_v9000.lua:

 --[[
 The latest script is a lua only weather script. aka: v9000
 http://crunchbang.org/forums/viewtopic.php?id=16100

 the file:
 http://dl.dropbox.com/u/19008369/weatheragain9000.lua.tar.gz

 mrppeachys LUA Tutorial
 http://crunchbang.org/forums/viewtopic.php?id=17246
--====================Modified---script---by---ragamatrix---===========================================--
--====================                                      ===========================================--
_________________________________________________________________________________________________________
]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="Droid-Sans-Bold"--font must be in quotes
default_font_size=9
default_color=0xffffff	--white
default_alpha=1		--fully opaque
default_image_width=50
default_image_height=50
-- ## New Options ###
default_face="bold"
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER
--[[
set a string named val to the valyue you want to display first, then use that string in the following 2 functions
use tonumber so that the output is a number
--]]
val=tonumber(now["temp"])
--val=tonumber(os.date("%S"))-10
--[[
get_color settings - this calculates the color of the thermometer inside
settings are inside ({ and }) and seperated by commas
	val needs to always be the first things set.  following val sub tables containing a number and a hex color are set
	sub tables set between { and } with the 2 values separated by a comma
	each sub table {},{} must be seperated from another sub table using a comma
the first number is the number at which the thermometer is that color
eg...  {0,0x00ff00} means that at value 0 the thermometer would be green
by setting multiple colors you can have the thermometer change according to a gradient
{0,0x00ff00},{100,0xff0000} would be green a 0, red at 100 and a gracient between the two colors at values in between

the get_color function outputs a lua formatted table containing the rgba color
tcol=get_color({}) stores that color in the tcol variable which is then used in the drawing function below
--]]
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
--[[
thermometer settings - this draws the thermometer
settings are inside ({ and }) and seperated by commas
x=x position (center of thermometer circle)
y=y position
lines=1 or 0 , 1 for scale lines, 0 for no scale lines
f=font (font name in quotes)
fs=font size
label=text to display on side, must be in brackets.  Do not set or set label=nil for no label
scale=size of thermometer, this affects all sizes including font size
units="C" or "F" 
val=val, leave this as it is, val is set above
tcol=tcol, leave this as it is to get the correct color change, tcol is set above
---##############################################################################################example#####################################
#################################################################################################       #####################################

val=tonumber(high_temp[10])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=100.5,y=300,numbers=0,lines=0,f="sans",fs=12,label=weather_location,scale=1,units="C",tcol=tcol,val=val})

val=tonumber(low_temp[10])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=200.5,y=300,numbers=0,lines=0,f="sans",fs=12,label=weather_location,scale=1,units="C",tcol=tcol,val=val})

val=tonumber(high_temp[9])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=300.5,y=300,numbers=0,lines=0,f="sans",fs=12,label=weather_location,scale=1,units="C",tcol=tcol,val=val})

val=tonumber(low_temp[9])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=400,y=300,numbers=0,lines=0,f="sans",fs=12,label=weather_location,scale=1,units="C",tcol=tcol,val=val})

etc
--]]
--##thermo actuel##--
thermometer ({x=720,y=123,numbers=1,lines=1,f="Mono",fs=12,label=weather_location,scale=0.6,units="C",tcol=tcol,val=val})
--Thermo j+10
val=tonumber(high_temp[10])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1785.5,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1780,y=25,txt="c"})
val=tonumber(low_temp[10])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1855,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1850,y=25,txt="d"})
--Thermo j+9
val=tonumber(high_temp[9])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1660,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1655,y=25,txt="c"})
val=tonumber(low_temp[9])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1730,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1725,y=25,txt="d"})
--Thermo j+8
val=tonumber(high_temp[8])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1535,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1530,y=25,txt="c"})
val=tonumber(low_temp[8])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1605,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1600,y=25,txt="d"})
--Thermo j+7
val=tonumber(high_temp[7])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1410,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1405,y=25,txt="c"})
val=tonumber(low_temp[7])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1480,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1475,y=25,txt="d"})
--Thermo j+6
val=tonumber(high_temp[6])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1285,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1280,y=25,txt="c"})
val=tonumber(low_temp[6])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1355,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1350,y=25,txt="d"})
--Thermo j+5
val=tonumber(high_temp[5])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1160,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1155,y=25,txt="c"})
val=tonumber(low_temp[5])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1230,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1225,y=25,txt="d"})
--Thermo j+4
val=tonumber(high_temp[4])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1035,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1030,y=25,txt="c"})
val=tonumber(low_temp[4])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1105,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1100,y=25,txt="d"})
--Thermo j+3
val=tonumber(high_temp[3])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=910,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=905,y=25,txt="c"})
val=tonumber(low_temp[3])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=980,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=975,y=25,txt="d"})
--Thermo j+2
val=tonumber(high_temp[2])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=785,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=780,y=25,txt="c"})
val=tonumber(low_temp[2])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=855,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=850,y=25,txt="d"})


--####End set thermo

--[[ forecast
datay=450  --375
datayy=15 --datay+(datayy*1)

datafx1=20

imgx=35
imgy=575
imgyy=60 -- imgy+(imgyy*1)
]]
-- forecast
datay=450
datayy=15 --datay+(datayy*1)

datafx1=20

imgx=45
imgy=575
imgyy=60 -- imgy+(imgyy*1)

ih=60
iw=60


-- ======================================================================
-- CURRENT FOR TODAY - SEE TOP LEFT -------------------------------------
   out({c=0xffd433,a=1,f="Lobster1.4",fs=20,x=30,y=26,txt="Horgen"})
   image({x=30,y=30,w=60,h=60,file=now["weather_icon"]})
 --image({x=20,y=25,w=87,h=130,file="/home/raphix/v9000/additional_files/s12.png"})
   out({c=0xFAFAEC,a=1,x=40,y=135,fs=15,txt="T° "})
      out({c=0xFF8C00,fs=15,a=1,x=63,y=135,txt=now["temp"].."°"})
   out({c=0xC0C0C0,a=1,x=40,y=115,fs=15,txt="± "})
      out({c=0xC0C0C0,fs=15,a=1,x=63,y=115,txt=now["feels_like"].."°"})

-- FORECAST TODAY - SEE TOP RIGHT ---------------------------------------
	out({c=silver,fs=15,a=1,x=320,y=25,txt="Tendance"})
   image({x=325,y=30,w=60,h=60,file=weather_icon[1]})
-- image({x=285,y=100,w=60,h=60,file="/media/5/Conky/images/red+.png"})
   out({c=0xff0000,a=1,f="Arrows",fs=20,x=590,y=26,txt="c"})
     out({c=0xff0000,fs=15,a=1,x=603,y=25,txt=high_temp[1].."°"})
   out({c=0x00ffff,a=1,f="Arrows",fs=20,x=645,y=26,txt="d"})
     out({c=0x00ffff,fs=15,a=1,x=658,y=25,txt=low_temp[1].."°"})
-- ======================================================================
-- MOON------------------------------------------------------
   --out({c=0xFAFAEC,a=1,x=20,y=35,txt="Lever Soleil "})
      --out({c=0x00BFFF,a=1,x=30,y=50,txt=sun_rise_24[1]})
-- MOON PHASE - CENTRE --------------------------------------------------
   out({c=0xffd433,a=1,f="Lobster1.4",fs=20,x=150,y=26,txt="Ephéméride"})
   image({x=165,y=30,w=60,h=60,file=moon_icon[1]})
-- image({x=170,y=170,w=120,h=120,file="/media/5/Conky/images/red+.png"})
   --out({c=0xFFFFFF,a=1.0,x=190,y=235,txt=moon_phase[1]})
   --out({c=0xFAFAEC,a=1,x=90,y=35,txt=" Lever Lune"})
      out({c=0x00BFFF,fs=15,a=1,x=170,y=115,txt=moon_rise_24[1]})
   --out({c=0xFAFAEC,a=1,x=100,y=65,txt=" Coucher Lune"})
      out({c=0xFF8C00,fs=15,a=1,x=170,y=135,txt=moon_set_24[1]})
-- SUN-------------------------------------------------------
   --out({c=0x00BFFF,a=1,x=275,y=115,fs=15,txt="Lever :"})
      out({c=0x00BFFF,a=1,x=330,y=115,fs=15,txt=sun_rise_24[1]})
   --out({c=0xFF8C00,a=1,x=254,y=135,fs=15,txt="Coucher :"})
      out({c=0xFF8C00,a=1,x=330,y=135,fs=15,txt=sun_set_24[1]})
-- ======================================================================
-- ======================================================================x=465,y=25
-- WIND INFORMATION - SEE BOTTOM ----------------------------------------
   image({x=665,y=103,w=30,h=30,file=now["wind_icon"]})
-- image({x=185,y=290,w=90,h=90,file="/media/5/Conky/images/red+.png"})
   out({c=0xffffff,a=1,x=642,y=115,txt=now["wind_deg"]})
   out({c=0xffffff,a=1,x=642,y=125,txt=now["wind_nesw"]})
--   out({c=0xffffff,a=1,x=333,y=295,txt="@"})
      out({c=0xFF8C00,a=1,x=660,y=140,txt=now["wind_km"]..""})

-- ======================================================================
-- Barometric Pressure
   out({c=0xFAFAEC,a=1,x=590,y=45,txt="Pression:"})
	out({c=0xFF8C00,a=1,x=635,y=45,txt=now["pressure_mb"].." mb"})
-- Humidity -------------------------------------------------------------
   out({c=0xFAFAEC,a=1,x=590,y=55,txt="Humidité:"})
      out({c=0x00BFFF,a=1,x=640,y=55,txt=now["humidity"].."%"})
-- Dew Point ------------------------------------------------------------
   --out({c=0xFAFAEC,a=1,x=90,y=520,txt="DP:"})
      --out({c=0xC0C0C0,a=1,x=135,y=520,txt=now["dew_point"].."°"})
-- ======================================================================
-- BOTTOM RIGHT
-- Ceiling
   out({c=0xFAFAEC,a=1,x=590,y=65,txt="Plafond:"})
     out({c=0x00BFFF,a=1,x=640,y=65,txt=now["ceiling"]})
-- Chance of Rain -------------------------------------------------------
   out({c=0xFAFAEC,a=1,x=590,y=75,txt="Prob Préc:"})
      out({c=0x00BFFF,a=1,x=640,y=75,txt=precipitation[1].."%"})
-- Cloud Cover
   out({c=0xFAFAEC,a=1,x=590,y=85,txt="Couv Nuages:"})
      out({c=0x00BFFF,a=1,x=658,y=85,txt=cloud_cover[1].."%"})
-- ======================================================================
-- BOTTOM CENTRE
-- UV -------------------------------------------------------------------
   out({c=0xFAFAEC,a=1,x=590,y=96,txt="UV :"})
     out({c=0xFF8C00,a=1,x=615,y=96,txt=uv_index_num[1]})
       out({c=0xFF8C00,a=1,x=625,y=96,txt=uv_index_txt[1]})

-- ======================================================================
-- FORECAST FOR NEXT 3 HOURS --------------------------------------------
  --image({x=450,y=50,w=240,h=2,file="/home/climatix/.conky/conky37/red_1.png"})
--out({c=0xFAFAEC,a=1,f="Droid-Sans-Bold",fs=10,x=415,y=55,txt="prochaines heures"})
 --out({c=0x227992,a=1,f="Arial",fs=16,x=400,y=30,txt="Hours"})
-- 1st hour
out({c=0xFF9600,x=425,y=25,fs=15,txt=now["fc_hour1_time_24"]..":00"})
  image({w=60,h=60,x=425,y=30,file=now["fc_hour1_wicon"]})
 --image({w=60,h=60,x=20,y=475,file="/media/5/Conky/images/red+.png"})
out({c=silver,fs=15,x=435,y=105,txt=now["fc_hour1_temp"] .."°"})
-- 2nd hour
--out({c=0xFF9600,x=212,y=470,txt=now["fc_hour2_time_24"]..":00"})
  --image({w=60,h=60,x=200,y=475,file=now["fc_hour2_wicon"]})
-- image({w=60,h=60,x=200,y=475,file="/media/5/Conky/images/red+.png"})
--out({c=0xAFAFAF,x=221,y=550,txt=now["fc_hour2_temp"] .."°"})
-- 3rd hour
out({c=0xFF9600,x=520,y=25,fs=15,txt=now["fc_hour3_time_24"]..":00"})
  image({w=60,h=60,x=510,y=30,file=now["fc_hour3_wicon"]})
-- image({w=60,h=60,x=380,y=475,file="/media/5/Conky/images/red+.png"})
out({c=silver,fs=15,x=525,y=105,txt=now["fc_hour3_temp"] .."°"})

-- ======================================================================
-- FORECAST for the next 9 days
-- Forecast day 2 -- x = l|r  y = u|d
out({c=0x9ACD32,a=1,x=800,y=17,txt=forecast_day_short[2]})
 out({c=0x9ACD32,a=1,x=825,y=17,txt=forecast_date[2]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=800,y=21,file=weather_icon[2]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=805,y=72,txt=sun_rise_24[2]})
 out({c=0xFF8C00,a=1,x=805,y=82,txt=sun_set_24[2]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=805,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=825,y=92,txt=uv_index_num[2]})
--Wind ------------------------------------------------------------------
image({x=805,y=103,w=30,h=30,file=wind_icon[2]})
 out({c=0xffffff,a=1,x=807,y=103,txt=wind_nesw[2]})
 out({c=0xFF8C00,a=1,x=801,y=141,txt=wind_km[2].." Km/h"})

-- ======================================================================

-- Forecast day 3 -- x = l|r  y = u|d
out({c=0x9ACD32,a=1,x=925,y=17,txt=forecast_day_short[3]})
 out({c=0x9ACD32,a=1,x=950,y=17,txt=forecast_date[3]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=925,y=21,file=weather_icon[3]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=930,y=72,txt=sun_rise_24[3]})
 out({c=0xFF8C00,a=1,x=930,y=82,txt=sun_set_24[3]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=930,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=950,y=92,txt=uv_index_num[3]})
--Wind ------------------------------------------------------------------
image({x=930,y=103,w=30,h=30,file=wind_icon[3]})
 out({c=0xffffff,a=1,x=932,y=103,txt=wind_nesw[3]})
 out({c=0xFF8C00,a=1,x=926,y=141,txt=wind_km[3].." Km/h"})

-- ======================================================================
-- Forecast day 4 -- x = l|r  y = u|d
 out({c=0x9ACD32,a=1,x=1050,y=17,txt=forecast_day_short[4]})
 out({c=0x9ACD32,a=1,x=1075,y=17,txt=forecast_date[4]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1050,y=21,file=weather_icon[4]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=1055,y=72,txt=sun_rise_24[4]})
 out({c=0xFF8C00,a=1,x=1055,y=82,txt=sun_set_24[4]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=1055,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=1075,y=92,txt=uv_index_num[4]})
--Wind ------------------------------------------------------------------
image({x=1055,y=103,w=30,h=30,file=wind_icon[4]})
 out({c=0xffffff,a=1,x=1057,y=103,txt=wind_nesw[4]})
 out({c=0xFF8C00,a=1,x=1051,y=141,txt=wind_km[4].." Km/h"})

-- ======================================================================
-- ======================================================================
-- Forecast day 5 -- x = l|r  y = u|d
  out({c=0x9ACD32,a=1,x=1175,y=17,txt=forecast_day_short[5]})
 out({c=0x9ACD32,a=1,x=1200,y=17,txt=forecast_date[5]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1175,y=21,file=weather_icon[5]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=1180,y=72,txt=sun_rise_24[5]})
 out({c=0xFF8C00,a=1,x=1180,y=82,txt=sun_set_24[5]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=1180,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=1200,y=92,txt=uv_index_num[5]})
--Wind ------------------------------------------------------------------
image({x=1180,y=103,w=30,h=30,file=wind_icon[5]})
 out({c=0xffffff,a=1,x=1182,y=103,txt=wind_nesw[5]})
 out({c=0xFF8C00,a=1,x=1176,y=141,txt=wind_km[5].." Km/h"})

-- ======================================================================

-- Forecast day 6 -- x = l|r  y = u|d
 out({c=0x9ACD32,a=1,x=1300,y=17,txt=forecast_day_short[6]})
 out({c=0x9ACD32,a=1,x=1325,y=17,txt=forecast_date[6]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1300,y=21,file=weather_icon[6]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=1305,y=72,txt=sun_rise_24[6]})
 out({c=0xFF8C00,a=1,x=1305,y=82,txt=sun_set_24[6]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=1305,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=1325,y=92,txt=uv_index_num[6]})
--Wind ------------------------------------------------------------------
image({x=1305,y=103,w=30,h=30,file=wind_icon[6]})
 out({c=0xffffff,a=1,x=1307,y=103,txt=wind_nesw[6]})
 out({c=0xFF8C00,a=1,x=1301,y=141,txt=wind_km[6].." Km/h"})

-- ======================================================================

-- Forecast day 7 -- x = l|r  y = u|d
 out({c=0x9ACD32,a=1,x=1425,y=17,txt=forecast_day_short[7]})
 out({c=0x9ACD32,a=1,x=1450,y=17,txt=forecast_date[7]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1425,y=21,file=weather_icon[7]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=1430,y=72,txt=sun_rise_24[7]})
 out({c=0xFF8C00,a=1,x=1430,y=82,txt=sun_set_24[7]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=1430,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=1450,y=92,txt=uv_index_num[7]})
--Wind ------------------------------------------------------------------
image({x=1430,y=103,w=30,h=30,file=wind_icon[7]})
 out({c=0xffffff,a=1,x=1432,y=103,txt=wind_nesw[7]})
 out({c=0xFF8C00,a=1,x=1426,y=141,txt=wind_km[7].." Km/h"})

-- ======================================================================
-- Forecast day 8 -- x = l|r  y = u|d
     out({c=0x9ACD32,a=1,x=1550,y=17,txt=forecast_day_short[8]})
 out({c=0x9ACD32,a=1,x=1575,y=17,txt=forecast_date[8]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1550,y=21,file=weather_icon[8]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=1555,y=72,txt=sun_rise_24[8]})
 out({c=0xFF8C00,a=1,x=1555,y=82,txt=sun_set_24[8]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=1555,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=1575,y=92,txt=uv_index_num[8]})
--Wind ------------------------------------------------------------------
image({x=1555,y=103,w=30,h=30,file=wind_icon[8]})
 out({c=0xffffff,a=1,x=1557,y=103,txt=wind_nesw[8]})
 out({c=0xFF8C00,a=1,x=1551,y=141,txt=wind_km[8].." Km/h"})

-- Forecast day 9 -- x = l|r  y = u|d
    out({c=0x9ACD32,a=1,x=1675,y=17,txt=forecast_day_short[9]})
 out({c=0x9ACD32,a=1,x=1700,y=17,txt=forecast_date[9]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1675,y=21,file=weather_icon[9]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1207,y=35,txt=high_temp[9].."°"})
--out({c=0x00BFFF,a=1,x=1207,y=55,txt=low_temp[9].."°"})
 out({c=0x00BFFF,a=1,x=1680,y=72,txt=sun_rise_24[9]})
 out({c=0xFF8C00,a=1,x=1680,y=82,txt=sun_set_24[9]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=1680,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=1700,y=92,txt=uv_index_num[9]})
--Wind ------------------------------------------------------------------
image({x=1680,y=103,w=30,h=30,file=wind_icon[9]})
 out({c=0xffffff,a=1,x=1682,y=103,txt=wind_nesw[9]})
 out({c=0xFF8C00,a=1,x=1676,y=141,txt=wind_km[9].." Km/h"})
-- Forecast day 10 -- x = l|r  y = u|d
   out({c=0x9ACD32,a=1,x=1800,y=17,txt=forecast_day_short[10]})
 out({c=0x9ACD32,a=1,x=1825,y=17,txt=forecast_date[10]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1800,y=21,file=weather_icon[10]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=1805,y=72,txt=sun_rise_24[10]})
 out({c=0xFF8C00,a=1,x=1805,y=82,txt=sun_set_24[10]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=1805,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=1825,y=92,txt=uv_index_num[10]})
--Wind ------------------------------------------------------------------
image({x=1805,y=103,w=30,h=30,file=wind_icon[10]})
 out({c=0xffffff,a=1,x=1810,y=103,txt=wind_nesw[10]})
 out({c=0xFF8C00,a=1,x=1800,y=141,txt=wind_km[10].." Km/h"})

--]]

--#######################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################
function get_color(ctab)
--by mrpeachy 04/2013
local function color(col)
return {((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, 1}
end
local ncol=#ctab
local val=ctab[1]
local lownum=(ctab[2])[1]
local lowcol=color((ctab[2])[2])
local highnum=(ctab[ncol])[1]
local highcol=color((ctab[ncol])[2])
if val<=lownum then 
color=lowcol
elseif val>=highnum then
color=highcol
else
	for i=2,ncol do
	entry1=ctab[i]
	entry2=ctab[i+1] or ctab[i]
	lower=entry1[1]
	upper=entry2[1]
		if val>=lower and val<=upper then
		nentry=i
		end
	end
ctop=color((ctab[nentry+1] or nentry)[2])
ntop=(ctab[nentry+1] or nentry)[1]
clow=color((ctab[nentry])[2])
nlow=(ctab[nentry])[1]
i1=ntop-nlow
i2=val-nlow
c1=clow[1]+((ctop[1]-clow[1])*i2/i1)
c2=clow[2]+((ctop[2]-clow[2])*i2/i1)
c3=clow[3]+((ctop[3]-clow[3])*i2/i1)
c4=clow[4]+((ctop[4]-clow[4])*i2/i1)
color={c1,c2,c3,c4}
end
ctab=nil
return color
end--function
--#############################################################################################################################################################
--##--##--thermometer##thermometer##thermometer##thermometer##thermometer##thermometer##thermometer##thermometer##thermometer##thermometer
function thermometer(therm)
--by mrpeachy 04/2013
local mx=therm.x or 0
local my=therm.y or 0
local tcol=therm.tcol
local temp=therm.val or 0
local label=therm.label or nil
local scale=therm.scale or 1
local units=therm.units or "F"
local font=therm.f or "Mono"
local fsize=therm.fs or "10"
local lines=therm.lines or 1
local numbers=therm.numbers or 1
therm=nil
--by mrpeachy 2011
if units=="F" then height=150 elseif units=="C" then height=160 end
local mx=mx*(1/scale)
local my=my*(1/scale)
cairo_scale (cr,scale,scale)
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,1,1,1,1)
--graphics outer
--bottom circle
r_outer=25
local lang_outer=335
local rang_outer=0+(360-lang_outer)
local h_outer=height-4--maybe make this a percentage?###########
cairo_arc (cr,mx,my,r_outer,(math.pi/180)*(rang_outer-90),(math.pi/180)*(lang_outer-90))
--coordinates,left line
local arc=(math.pi/180)*lang_outer
local lxo=0+r_outer*(math.sin(arc))
local lyo=0-r_outer*(math.cos(arc))
cairo_line_to (cr,mx+lxo,my+lyo-h_outer)
--coordinates,left line
local arc=(math.pi/180)*rang_outer
local rxo=0+r_outer*(math.sin(arc))
local ryo=0-r_outer*(math.cos(arc))
--top circle
cairo_arc (cr,mx+lxo+((rxo-lxo)/2),my+lyo-h_outer,(rxo-lxo)/2,(math.pi/180)*(270-90),(math.pi/180)*(90-90))
--right line
cairo_line_to (cr,mx+lxo+((rxo-lxo)),my+lyo)
cairo_stroke (cr)
----------------------------------------------
--graphics inner
--####################################################
if units=="F" then
cairo_set_source_rgba (cr,tcol[1],tcol[2],tcol[3],tcol[4])
--bottom circle
r_inner=r_outer-6
local lang_inner=lang_outer+9
local rang_inner=0+(360-lang_inner)
local h_inner=temp+30
cairo_arc (cr,mx,my,r_inner,(math.pi/180)*(rang_inner-90),(math.pi/180)*(lang_inner-90))
--coordinates,left line
local arc=(math.pi/180)*lang_inner
lxi=0+r_inner*(math.sin(arc))
local lyi=0-r_inner*(math.cos(arc))
cairo_line_to (cr,mx+lxi,my+lyi-h_inner)
--coordinates,left line
local arc=(math.pi/180)*rang_inner
rxi=0+r_inner*(math.sin(arc))
local ryi=0-r_inner*(math.cos(arc))
--top circle
cairo_arc (cr,mx+lxi+((rxi-lxi)/2),my+lyi-h_inner,(rxi-lxi)/2,(math.pi/180)*(270-90),(math.pi/180)*(90-90))
--right line
cairo_line_to (cr,mx+lxi+((rxi-lxi)),my+lyi)
cairo_fill (cr)
----------------------------
if lines==1 then
--scale lines
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,1,1,1,0.5)
local grad=10
local lnn=15
local lnx=mx+lxo
local lnw=(rxo-lxo)
	for i=1,lnn do
	lny=my-r_inner-(10+((i-1)*grad))-((rxi-lxi)/2)
		if i==lnn then
		lnx=lnx+2
		lnw=lnw-4
		end
	cairo_move_to (cr,lnx,lny)
	cairo_rel_line_to (cr,lnw,0)
	cairo_stroke (cr)
	end
end--if lines
if numbers==1 then
--numbers
cairo_set_source_rgba (cr,1,1,1,1)
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
local grad=20
local lnn=8
local lnx=mx+lxo+(rxo-lxo)+4
num={-20,"0°"..units,20,40,60,80,100,120}
for i=1,lnn do
lny=my-r_inner-(10+((i-1)*grad))-((rxi-lxi)/2)+(fsize/3)
cairo_move_to (cr,lnx,lny)
cairo_show_text (cr,num[i])
cairo_stroke (cr)
end
end--if label
end--if units=F
--#################################################
if units=="C" then
cairo_set_source_rgba (cr,tcol[1],tcol[2],tcol[3],tcol[4])
--cairo_set_source_rgba (cr,0,1,1,1)
--bottom circle
r_inner=r_outer-6
local lang_inner=lang_outer+9
local rang_inner=0+(360-lang_inner)
local h_inner=(temp*2)+60
cairo_arc (cr,mx,my,r_inner,(math.pi/180)*(rang_inner-90),(math.pi/180)*(lang_inner-90))
--coordinates,left line
local arc=(math.pi/180)*lang_inner
lxi=0+r_inner*(math.sin(arc))
local lyi=0-r_inner*(math.cos(arc))
cairo_line_to (cr,mx+lxi,my+lyi-h_inner)
--coordinates,left line
local arc=(math.pi/180)*rang_inner
rxi=0+r_inner*(math.sin(arc))
local ryi=0-r_inner*(math.cos(arc))
--top circle
cairo_arc (cr,mx+lxi+((rxi-lxi)/2),my+lyi-h_inner,(rxi-lxi)/2,(math.pi/180)*(270-90),(math.pi/180)*(90-90))
--right line
cairo_line_to (cr,mx+lxi+((rxi-lxi)),my+lyi)
cairo_fill (cr)
----------------------------
if lines==1 then
--scale lines
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,1,1,1,0.5)
local grad=10
local lnn=17
local lnx=mx+lxo
local lnw=(rxo-lxo)
	for i=1,lnn do
	lny=my-r_inner-(((i-1)*grad))-((rxi-lxi)/2)
		if i==lnn then
		lnx=lnx+2
		lnw=lnw-4
		end
	cairo_move_to (cr,lnx,lny)
	cairo_rel_line_to (cr,lnw,0)
	cairo_stroke (cr)
	end
end--if lines
if numbers==1 then
--numbers
cairo_set_source_rgba (cr,1,1,1,1)
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
local grad=20
local lnn=9
local lnx=mx+lxo+(rxo-lxo)+4
num={-30,-20,-10,"0°"..units,10,20,30,40,50}
for i=1,lnn do
lny=my-r_inner-(((i-1)*grad))-((rxi-lxi)/2)+(fsize/3)
cairo_move_to (cr,lnx,lny)
cairo_show_text (cr,num[i])
cairo_stroke (cr)
end
end--if label=none
end--if units=C
--#################################################
--label
if label~=nil then
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
local lbx=mx+lxo-5
local lby=my-r_inner-10-((rxi-lxi)/2)
cairo_move_to (cr,lbx,lby)
cairo_rotate (cr,(math.pi/180)*(-90))
cairo_show_text (cr,label)
cairo_stroke (cr)
cairo_rotate (cr,(math.pi/180)*(90))
--temperature readout
cairo_set_source_rgba (cr,0,0,0,1)
local text=temp.."°"..units
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to (cr,mx-(width/2),my+(height/2))
cairo_show_text (cr,text)
cairo_stroke (cr)
end--if label
------------------------------------
cairo_scale (cr,1/scale,1/scale)
end--thermometer function
--#################################################################################################

edit ljere: je me suis permis une correction de ta balise image

Dernière modification par ljere (Le 03/05/2013, à 16:54)

Hors ligne

#477 Le 03/05/2013, à 16:47

milou32

Re : [Conky] Alternative à weather.com (3)

Bonjour tout le monde,
ljere,
Je voulais récupérer le script de ton conky ballon, mais le lien ne marche plus sad

Hors ligne

#478 Le 03/05/2013, à 16:52

ljere

Re : [Conky] Alternative à weather.com (3)

tiens milou32 c'est parce que je les ai mis à jour au fur à mesure
http://dl.free.fr/vR2jhLEGG
est le plus complet


ancien PC Toshiba satellite_c670d-11 / Linux Mint 21 Vanessa
Nouveau PC ASUS TUF GAMING A17 GPU RTX 4070 CPU AMD Ryzen 9 7940HS w/ Radeon 780M Graphics / Linux Mint 21.2 Victoria / Kernel: 6.4.8-1-liquorix / Desktop: Cinnamon

Hors ligne

#479 Le 03/05/2013, à 17:07

ragamatrix

Re : [Conky] Alternative à weather.com (3)

@ljere
Salut,
C'est bête mais je ne sais pas faire cela (image cliquable) :

ljere a écrit :

edit ljere: je me suis permis une correction de ta balise image

Merci
Quelle est la marche à suivre ?

Dernière modification par ragamatrix (Le 03/05/2013, à 17:08)

Hors ligne

#480 Le 03/05/2013, à 17:10

ljere

Re : [Conky] Alternative à weather.com (3)

c'est simple tu englobes ton image dans l'url

[url=http://pix.toile-libre.org/upload/original/1367587410.png][img=thermo_lua]http://pix.toile-libre.org/upload/thumb/1367586542.png[/img][/url]

Dernière modification par ljere (Le 03/05/2013, à 17:12)


ancien PC Toshiba satellite_c670d-11 / Linux Mint 21 Vanessa
Nouveau PC ASUS TUF GAMING A17 GPU RTX 4070 CPU AMD Ryzen 9 7940HS w/ Radeon 780M Graphics / Linux Mint 21.2 Victoria / Kernel: 6.4.8-1-liquorix / Desktop: Cinnamon

Hors ligne

#481 Le 03/05/2013, à 17:13

milou32

Re : [Conky] Alternative à weather.com (3)

Merci ljere, c'est dans la boite.... smile

Hors ligne

#482 Le 03/05/2013, à 17:43

ljere

Re : [Conky] Alternative à weather.com (3)

pas de souci je suis content que ça plaise smile


ancien PC Toshiba satellite_c670d-11 / Linux Mint 21 Vanessa
Nouveau PC ASUS TUF GAMING A17 GPU RTX 4070 CPU AMD Ryzen 9 7940HS w/ Radeon 780M Graphics / Linux Mint 21.2 Victoria / Kernel: 6.4.8-1-liquorix / Desktop: Cinnamon

Hors ligne

#483 Le 03/05/2013, à 17:50

Didier-T

Re : [Conky] Alternative à weather.com (3)

Bonjour a tous,
voici une nouvelle version test pour recmeteo.py
dans cette version je coupe la page en deux de manière a minimiser les risques liés a la gestion de la mémoire.

recmeteo.py

#! /usr/bin/python3
# -*- coding: utf-8 -*-
# Par Didier-T Forum Ubuntu.fr
# Ajout notification par jpdipsy Forum Ubuntu.fr
# Ajout notification via DBus par ti_tux Forum Ubuntu.fr
# Ajout création repsauv si inexistant par jpdipsy Forum Ubuntu.fr

from socket import timeout
from urllib.request import Request, urlopen, URLError
from os import path, makedirs, system
from time import time, sleep, strftime, localtime
from re import search, compile, findall
from sys import argv
from gc import collect, get_objects
from bs4 import BeautifulSoup
from subprocess import Popen

Version='1.25b'

homedir = path.expanduser('~')

#### initialisation des variables
adressWeb="http://www.accuweather.com/fr/fr/belfort/133341/daily-weather-forecast/133341"
repsauv= "~/essais"
huitHeures="non"
nbFoisHuit=1
matin="non"
apresmidi="non"
soiree="non"
nuit="non"
nbJour=1
interval=2
notifi="non"
externe = None
Id = "sans"

for a in argv:
    if search("adressWeb=", a) is not None:
        adressWeb=compile("adressWeb=(.*)").search(a).group(1)
    if search("repsauv=", a) is not None:
        repsauv=compile("repsauv=(.*)").search(a).group(1)
    if search("huitHeures=", a) is not None:
        huitHeures=compile("huitHeures=(.*)").search(a).group(1)
    if search("nbJour=", a) is not None:
        nbJour=compile("nbJour=(.*)").search(a).group(1)
    if search("interval=", a) is not None:
        interval=compile("interval=(.*)").search(a).group(1)
    if search("notify=", a) is not None:
        notifi=compile("notify=(.*)").search(a).group(1)
    if search("matin=", a) is not None:
        matin=compile("matin=(.*)").search(a).group(1)
    if search("apresmidi=", a) is not None:
        apresmidi=compile("apresmidi=(.*)").search(a).group(1)
    if search("soiree=", a) is not None:
        soiree=compile("soiree=(.*)").search(a).group(1)
    if search("nuit=", a) is not None:
        nuit=compile("nuit=(.*)").search(a).group(1)
    if search("externe=", a) is not None:
        externe=compile("externe=(.*)").search(a).group(1)
    if search("nbFoisHuit=", a) is not None:
        nbFoisHuit=compile("nbFoisHuit=(.*)").search(a).group(1)
    if search("id=", a) is not None:
        Id=compile("id=(.*)").search(a).group(1)

nbJour=int(nbJour)
interval=int(interval)
repsauv=repsauv.replace("~", homedir)
notifi=str.lower(notifi)
huitHeures=str.lower(huitHeures)
nbFoisHuit=int(nbFoisHuit)


#### fin initialisation des variables

#### Fonction de traitement des fichiers
def traitement(adress, fichier, repsauv):
#    fiche = open(fichier, "w")
    #pour debug
    current_balise=None
    x=1
    user_agent = 'Mozilla/5.0 (X11; Linux x86_64)'
    headers = { 'User-Agent' : user_agent }
    while current_balise is None:
        response = None
        while response is None:
            try:
                html_page = urlopen(adress, timeout=10)
            except (URLError) as error:
                print("HTML ", error)
            except timeout:
                print("erreur timeout acces HTML")
            else:
                try:
                    currentCond=html_page.read()
                except (URLError) as error:
                    print("Lecture page ", error)
                except timeout:
                    print("erreur timeout lecture page")
                else:
                    fiche = open("/tmp/page.html", "wb")
                    fiche.write(currentCond)
                    fiche.close()
                    response = "ok"
        fiche = open("/tmp/page.html", "r")
        lines = fiche.readlines()
        curr = {}
        curr[0] = ""
        curr[1] = ""
        i=0
        for line in lines:
            curr[i] = curr[i]+line
            if search("!-- /.feed-tabs --", line) is not None:
                i=1
        soup1 = BeautifulSoup(curr[0])
        soup = BeautifulSoup(curr[1])
        #if soup.find(id="tracking-pixels") is not None:
        #    response = "ok"
        #else:
        #    print("soucis traitement mémoire traitement "+fichier)
        #si autres que huit heures
        table=soup.find_all('table')
        current_balise=soup.find(id="details")
#        if current_balise is None:
#            sleep(1)
#            x=x+1
#            print("problème de récupération de donées\n essais n°"+str(x)+"\npage : "+adress)
#    print(current_balise.prettify()+"\n")
    information="\n"
    if search("huitHeures", fichier) is None:
        # recherche vent
        divs=current_balise.select("[class~=wind-box-lg]")
        if len(divs) == 0:
            divs=current_balise.select("[class~=wind-box-sm]")
        i=0
        for div in divs:
            i=i+1
            ventd=compile("var d = '(.*)';").search(str(div)).group(1).replace("W", "O")
            ventf=compile("var s = '(.*)';").search(str(div)).group(1)
            information=information+"direction"+str(i)+": "+ventd+"\n"
            information=information+"vitesse"+str(i)+": "+ventf+"\n"
        #info dans l'image
        inf=current_balise.select("[class~=info]")
        icone=current_balise.select("[class~=icon]")
        i=0
        #recherche icone
        for ic in icone:
            i=i+1
            information=information+"icone"+str(i)+": "+str(ic).replace('<div class="icon i-', '').replace('"></div>', '')+"\n"
        i=0
        #récupération date + historique
        if search("Jour", fichier) is not None or search("CC", fichier) is not None:
            histo=soup.find(id="feature-history")
            #récupération date
            date=histo.find_all('th')
            jour=compile("(.*)/(.*)/(.*)").search(date[4].get_text())
            information=information+"jour: "+jour.group(1)+"\n"
            information=information+"mois: "+jour.group(2)+"\n"
            information=information+"année: "+str(int(jour.group(3))+1)+"\n"
            #récupération historique
            hi=histo.select("[class~=hi]")
            for v in hi:
                hivalue=v.get_text().split("\n")
            information=information+"maxjour: "+hivalue[2]+"\n"
            information=information+"maxnormal: "+hivalue[3]+"\n"
            information=information+"maxrecord: "+hivalue[4]+"\n"
            information=information+"max1ans: "+hivalue[5]+"\n"
            lo=histo.select("[class~=last]")
            for v in lo:
                lovalue=v.get_text().split("\n")
            information=information+"minjour: "+lovalue[2]+"\n"
            information=information+"minnormal: "+lovalue[3]+"\n"
            information=information+"minrecord: "+lovalue[4]+"\n"
            information=information+"min1ans: "+lovalue[5]+"\n"
            #info dans l'image
            if search("Jour", fichier) is not None:
                infs=inf[0].get_text().split("\n")
                information=information+"Tempjour: "+findall('-?\d+', infs[0])[0]+"\n"
                information=information+"RealFeeljour: "+findall('-?\d+', infs[1])[0]+"\n"
                information=information+"Précipitationsjour: "+findall('-?\d+', infs[2])[0]+"\n"
                infs=inf[1].get_text().split("\n")
                information=information+"Tempnuit: "+findall('-?\d+', infs[0])[0]+"\n"
                information=information+"RealFeelnuit: "+findall('-?\d+', infs[1])[0]+"\n"
                information=information+"Précipitationsnuit: "+findall('-?\d+', infs[2])[0]+"\n"
                lever_coucher=soup.select("[class~=time-period]")
                i=0
                for p in lever_coucher:
                    spans=p.find_all('span')
                    i=i+1
                    x=0
                    for span in spans:
                        if i == 1:
                            span_nom="Soleil "
                        else:
                            span_nom="Lune "
                        if search('start', str(span)) is not None:
                            information=information+span_nom+"lever: "+span.get_text()+"\n"
                        if search('time', str(span)) is not None:
                            information=information+span_nom+"durée: "+span.get_text()+"\n"
                        if search('finish', str(span)) is not None:
                            information=information+span_nom+"coucher: "+span.get_text()+"\n"


            p=current_balise.find_all('p')
            i=0
            x=0
            for pv in p:
                i=i+1
                if i==5 or i==10:
                    x=x+1
                    information=information+"cond"+str(x)+": "+pv.get_text()+"\n"


        #localisation si condition courante
        if search("CC", fichier) is not None:
            ville=soup1.select("[class~=current-city]")[0].get_text().split(",")[0]
            longi=compile("lon: '(.*)',").search(str(soup1)).group(1)
            lat=compile("lat: '(.*)',").search(str(soup1)).group(1)
            information=information+"ville: "+ville+"\n"
            information=information+"lat: "+lat+"\n"
            information=information+"long: "+longi+"\n"
            #info alerte
            alerte=soup.select("[class~=forecast-status]")
            if str(alerte) != "[]":
                p=alerte[0].find_all('p')
                a=p[0].find_all('a')
                clic=a[0].get_text()
                information=information+"alerte: "+p[0].get_text().replace(clic, "").replace("\n","").replace("\r", "").replace(chr(160), "").rstrip().lstrip()+"\n"
            else:
                information=information+"alerte: RAS\n"
            #info dans l'image
            inf=inf[0].get_text()
            cond=inf[:inf.find(findall('-?\d+', inf)[0])]
            inf=inf.replace(cond, "")
            infs=inf.split(" ")
            information=information+"cond:"+cond+"\n"
            information=information+"Temp: "+infs[0]+"\n"
            information=information+"RealFeel: "+infs[2]+"\n"

        if search("Matin", fichier) is not None or search("AM", fichier) is not None or search("Soiree", fichier) is not None or search("Nuit", fichier) is not None:
            infs=inf[0].get_text().split("\n")
            i=0
            infsc=["","","",""]
            for inf in infs:
                if inf!="":
                    infsc[i]=inf
                    i=i+1
            information=information+"cond:"+infsc[0]+"\n"
            information=information+"max: "+infsc[1]+"\n"
            information=information+"min: "+infsc[2].replace("Mn ", "")+"\n"
            information=information+"RealFeelmax: "+findall('-?\d+', infsc[3])[0]+"\n"
            information=information+"RealFeelmin: "+findall('-?\d+', infsc[3])[1]+"\n"
            
            #info conditions générales
            cc=current_balise.find_all('li')
            for inf in cc:
                inf=inf.get_text()
                inf=inf.replace(compile('^ *').search(inf).group(0), "").replace("\n", "")
                if search(":", inf) is not None:
                    information=information+inf+"\n"
        elif search("Jour", fichier) is not None:
            i=0
            cc=current_balise.find_all('li')
            for inf in cc:
                inf=inf.get_text()
                inf=inf.lstrip().replace("\n", "").replace(" \r", "")
                if search(": ", inf) is not None:
                    i=i+1
                    if i <= 7:
                        inf=inf.replace(":", " jour:")
                    else:
                        inf=inf.replace(":", " nuit:")
                    information=information+inf+"\n"
        else:
            cc=current_balise.find_all('li')
            for inf in cc:
                inf=inf.get_text()
                inf=inf.replace(compile('^ *').search(inf).group(0), "").replace("\n", "")
                if search(":", inf) is not None:
                    information=information+inf+"\n"
            information=information+str(int(time()))+"\n"
    else:
        #recherche icones huit heures
        rows = table[0].findAll('tr')
        x=0
        for tr in rows:
            cols = tr.findAll('td')
            texte_tr=tr.text.split("\n")[1].replace("\n", "")
            i=0
            for td in cols:
                i=i+1
#                td=td.replace("&nbsp;", "")
                texte_bu = td.text.replace("\n", "").replace(chr(160), "")
                if texte_bu != "" :
                    if texte_tr == " " and x < len(cols):
                        information=information+"Heure"+str(i)+": "+texte_bu+"\n"
                        x=x+1
                    elif texte_tr != " ":
                        information=information+texte_tr+str(i)+": "+texte_bu+"\n"
        icone=table[0].find_all('div')
        i=0
        for ic in icone:
            i=i+1
            ico="icone"+str(i)+": "+str(ic).replace('<div class="icon i-', '')
            fin=compile('">(.*)div>').search(ico).group(1)
            information=information+ico.replace('">'+fin+'div>', '')+"\n"
            if i == 8:
                break
    fiche = open(fichier, "w")
#    fiche.write(current_balise.prettify())
    fiche.write(information)
    fiche.close()
    collect()
#### fin Fonction de traitement des fichiers

#### Mise en tache de fond
def demonise(ent, id1, id2, huitHeures, nbJour, interval, nbFoisHuit, Id):
    dem=time()-(60*60)
    misajour=1
    while 1 :
        heure=time()
        if huitHeures=="oui":
            x=0
            while x<nbFoisHuit:
                h=(x*8)+int(strftime('%H', localtime()))
                x=x+1
                traitement(ent+nb1+'/hourly-weather-forecast/'+nb2+'?hour='+str(h), repsauv+"/huitHeures"+str(x), repsauv)
                print("huitHeures "+str(x)+" Ok")
        if heure-dem >= 60*60:
            x=0
            while x<nbJour:
                x=x+1
                traitement(ent+nb1+'/daily-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Jour"+str(x), repsauv)
                print("Jour "+str(x)+" Ok")
                if matin=="oui":
                    traitement(ent+nb1+'/morning-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Matin"+str(x), repsauv)
                    print("Matin "+str(x)+" Ok")
                if apresmidi=="oui":
                    traitement(ent+nb1+'/afternoon-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/AM"+str(x), repsauv)
                    print("AM "+str(x)+" Ok")
                if soiree=="oui":
                    traitement(ent+nb1+'/evening-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Soiree"+str(x), repsauv)
                    print("Soiree "+str(x)+" Ok")
                if nuit=="oui":
                    traitement(ent+nb1+'/overnight-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Nuit"+str(x), repsauv)
                    print("Nuit "+str(x)+" Ok")
            dem=heure
        traitement(ent+nb1+'/current-weather/'+nb2, repsauv+"/CC", repsauv)
        print("CC Ok")
        if externe is not None:
                 system(externe)
        fin=time()
        duree=fin-heure
        if notifi == "oui":
            if heure-dem == 0:
                mess=notify2.Notification('Recmeteo.py  v'+Version, 'Météo : mise à jour complète terminée\n en '+str(round(duree,2))+' secondes', 'dialog-information')
            else:
                mess=notify2.Notification('Recmeteo.py  v'+Version, 'Météo : mise à jour partielle terminée\n en '+str(round(duree,2))+' secondes', 'dialog-information')
            mess.show()
        start=heure
        pause=60*interval-int(duree)
        if pause < 0:
            pause=interval
        print("mise a jour en : "+str(duree))
        collect()
        sleep(pause)
        if Id != "sans":
            if not path.exists("/proc/"+Id):
                exit()


### Initialiation de DBus pour les notifications
if notifi == "oui":
    import notify2
    notify2.init('Recmeteo.py')
### Vérification répertoire
if not path.exists(repsauv):
    makedirs(repsauv)
#### Lancement du script et initialisation de la tache de fond
nb1=findall('\d+', adressWeb)[0]
nb2=findall('\d+', adressWeb)[1]
ent=adressWeb[:adressWeb.find(nb1)]
fin=adressWeb.replace(ent+nb1, "")
fin=fin.replace(fin[:fin.find(nb2)]+nb2, "")
nb2=nb2+fin
print("Version =", Version)
demonise(ent, nb1, nb2, huitHeures, nbJour, interval, nbFoisHuit, Id)

bien entendu j’attends avec impatience les premiers retours d'expériences sous 13.04

@maan,
en effet j'avais oublié cette annotation au début de meteo2.lua, mais recmeteo_python_2.py est voué a disparaitre (Ubuntu passera à python 3 a partir de 14.04)

pour ton soucis avec les images météo il faut modifier le conky.

	# -- Conky settings -- #
	background yes
	update_interval 1

	cpu_avg_samples 2
	net_avg_samples 2

	override_utf8_locale yes

	double_buffer yes
	no_buffers yes

	text_buffer_size 2048
	# -- Window specifications -- #

	own_window yes
	own_window_type desktop
	own_window_transparent yes
	own_window_hints undecorate,below,sticky,skip_taskbar,skip_pager

	border_inner_margin 0
	border_outer_margin 0

	minimum_size 100 100
	maximum_width 1440
	

	alignment tm
	gap_x -14
	gap_y 20

	# -- Graphics settings -- #
	draw_shades no
	draw_outline no
	draw_borders no
	draw_graph_borders no

	# -- Text settings -- #
	use_xft yes
	xftfont MaiandraGD:size=24
	xftalpha 0.4

	uppercase no

	default_color 8b8b8b
	# -- Déclaration template -- #
	template0 ${lua fDrawImage ~/.conky/conky23/meteo/images/\1 \2 \3 \4 \5} # -- images fond -- #
	template1 ${lua Meteo_\1 \2 \3 \4 \5 \6} # -- gestion météo --#
	template2 ${lua Meteo_\1 \2 \3 \4 \5 \6 \7} # -- icônes météo -- \2=répertoire icônes \3=position \4=taille \5=jour (pour les prévisions) #
	template3 ${lua Lune_\1} 
	template4 ${lua_parse Images_\1 \2 \3 60 \4} # -- Appelle image -- \2=position \3=taille \4=jour (pour les prévisions) #

	
	lua_load ~/.conky/conky23/conky/script/meteo2.lua

	lua_startup_hook init ~/.conky/conky23/conky/script/meteo.cfg
	lua_load ~/.conky/conky23/conky/script/ring_chrono.lua
	lua_draw_hook_post main_rings
	lua_load ~/.conky/conky23/conky/script/chrono.lua
	lua_draw_hook_pre conky_main
	
	
	TEXT
#### Lancement du script récupérant les données météo ####
${template1 Maj}
#### Version recmeteo #####
${color FF6600}${goto 450}${voffset -10}${font Syndrome BRK:size=12}recmeteo
${goto 462.5}${voffset 5}v.1.20
#### Heure #####
${voffset 127}${goto 445}${font Zoidal BRK:size=10}${color 0602FF}${time %H}${goto 497}${time %M}${voffset -08}${goto 487}${font Zoidal BRK:size=05}h
${voffset -45}${goto 472}${font Zoidal BRK:size=10}${time %S}
##### ville #####
${voffset 205}${goto 380}${color FF6600}${font Syndrome BRK:size=25}${template1 Ville}
##### température actuelle #####
${voffset -190}${goto 605}${font URW Chancery L:style=Bold:size=25}${if_match ${template1 TempAct}<4}${color red}${blink ${template1 TempAct}°}${else}${color FF6600}${blink ${template1 TempAct}°}${endif}
${font URW Chancery L:style=Bold:size=10}${color white}${goto 623}Ressentit
${goto 605}${font URW Chancery L:style=Bold:size=25}${if_match ${template1 TempRes 1}<4}${color 0602FF}${blink ${template1 TempRes 1}°}${else}${color 66FFFF}${blink ${template1 TempRes 1}°}${endif}
##### Affichage conditions météo #####
${voffset -128}${font URW Chancery L:style=Bold:size=12}${color white}${template1  CondMeteo}
##### Info soleil ####
${voffset 70}${color red}Levé ${color 0602FF}: ${template1 HLeverSoleil 1}h${template1 MLeverSoleil 1}
Couché : ${color red}${template1 HCoucherSoleil 1}h${template1 MCoucherSoleil 1}
##### Affichage infos vent ${color ffe595}######
${voffset -175}${color ffe595}${font Helvetica LT Std:style=Bold:size=10}${goto 305}${template1 VentDirP}          
${voffset 40}${color ffe595}${font Helvetica LT Std:style=Bold:size=10}${goto 320}${template1 VentForce} km/h
##### Affichage Probabilité de précipitations Jour/Nuit #####
${voffset -63}${color 522BAF}${font Helvetica LT Std:style=Bold:size=10}${goto 213}${template1 Jour_ProbOrage 1}${voffset 101}${goto 362}${template1 Nuit_ProbOrage 1}
##### Affichage temperature #####
${voffset -70}${goto 185}${color 66FFFF}${template1 Jour_Temp 1}°${voffset 98}${goto 330}${template1 Nuit_Temp 1}°
##### Affichage conditions météo #####
${voffset -215}${goto 235}${font URW Chancery L:style=condensed:size=12}${color white} ${template1  AM_CondMeteo1 1}${voffset 160}${goto 410} ${template1  Noct_CondMeteo1 1}
 ${voffset 100}${template1  AM_CondMeteo2 1}${goto 270} ${template1  Noct_CondMeteo2 1}
##### Affichage lunaison #####
${voffset -247}${font URW Chancery L:style=Bold:size=15}${color FEEFEF}${goto 795}${template3 ephemerides1}
${goto 900}${voffset 10}${font URW Chancery L:style=Bold:size=10}Couché: ${template3 HCoucherLune}h${template3 MCoucherLune}
${goto 763}Levé: ${template3 HLeverLune}h${template3 MLeverLune} 
${font URW Chancery L:style=Bold:size=15}${voffset 15}${goto 850}${template3 ephemerides2}
${font URW Chancery L:style=Bold:size=12}${goto 763}${color 0602FF}${template3 Age}
#### données previsionnelles####
${voffset -270}${font Ubuntu :size=10:style=bold}${color 522BAF}${goto 41}${template1 Jour_ProbOrage 2}${goto 219}${template1 Jour_ProbOrage 3}${goto 641}${template1 Jour_ProbOrage 4}${goto 824}${template1 Jour_ProbOrage 5}
##### Affichage temperature des jours à venir #####
${voffset 30}${goto 15}${font Ubuntu :size=07:style=bold}${color FFBDA8}Max: ${voffset -04}${font Ubuntu :size=10:style=bold}${template1 Jour_Temp 2}°${color white}${goto 122}${font Ubuntu :size=07:style=bold}Min:  ${color 66FFFF}${font Ubuntu :size=10:style=bold}${voffset -04}${template1 Nuit_Temp 2}°${goto 197}${color FFBDA8}${font Ubuntu :size=07:style=bold}Max:  ${font Ubuntu :size=10:style=bold}${voffset -04}${template1 Jour_Temp 3}°${goto 307}${color white}${font Ubuntu :size=07:style=bold}Min:  ${color 66FFFF}${voffset -04}${font Ubuntu :size=10:style=bold}${template1 Nuit_Temp 3}°${goto 615}${color FFBDA8}${font Ubuntu :size=07:style=bold}Max:  ${voffset -04}${font Ubuntu :size=10:style=bold}${template1 Jour_Temp 4}°${goto 725}${color white}${font Ubuntu :size=07:style=bold}Min:  ${voffset -04}${color 66FFFF}${font Ubuntu :size=10:style=bold}${template1 Nuit_Temp 4}°${goto 805}${color FFBDA8}${font Ubuntu :size=07:style=bold}Max:  ${voffset -04}${font Ubuntu :size=10:style=bold}${template1 Jour_Temp 5}°${goto 910}${color white}${font Ubuntu :size=07:style=bold}Min:  ${voffset -04}${color 66FFFF}${font Ubuntu :size=10:style=bold}${template1 Nuit_Temp 5}°
##### Affichage vitesse du vent #####
${voffset -85}${font Ubuntu :size=9:style=bold}${color red}${goto 70}${template1 Jour_VentForce 2}${font Ubuntu :size=6:style=bold} km/h${goto 250}${voffset -4}${font Ubuntu :size=9:style=bold}${template1 Jour_VentForce 3}${font Ubuntu :size=6:style=bold} km/h${goto 668}${voffset -4}${font Ubuntu :size=9:style=bold}${template1 Jour_VentForce 4}${font Ubuntu :size=6:style=bold} km/h${goto 855}${voffset -4}${font Ubuntu :size=9:style=bold}${template1 Jour_VentForce 5}${font Ubuntu :size=6:style=bold} km/h
##### Affichage Date #####
${voffset -50}${font Syndrome BRK:size=15}${color 522BAF}${goto 40}${template1 Jour %a_%d 2}${goto 230}${template1 Jour %a_%d 3}${goto 650}${template1 Jour %a_%d 4}${goto 840}${template1 Jour %a_%d 5}
##### Heure mise à jour #####
${voffset 110}${color ffe595}${font Syndrome BRK:size=12}${goto 866} mise a jour  
${voffset 10}${goto 915}${template1 Heure}h${template1 Minute}

${voffset -1630}
#### Affichage des cadres utilisés dans le conky ####
#### premier cadre ####
${image ~/.conky/conky23/conky/script/images/fond1.png -p 0,80 -s 173x91}
#### Second cadre ####
${image ~/.conky/conky23/conky/script/images/fond2.png -p 184,80 -s 179x90}
#### troisième cadre ####
${image ~/.conky/conky23/conky/script/images/fond3.png -p 605,80 -s 179x90}
#### quatrieme cadre ####
${image ~/.conky/conky23/conky/script/images/fond4.png -p 792,80 -s 177x90}
#### icônes premier cadre ####
${template2 AM_IconeM ~/.conky/conky23/conky/icones/icone_meteo 2 95 86 52 2}
${template2 Jour_IconeR ~/.conky/conky23/conky/icones/vent 77 130 25 25 2}
${template2 Noct_IconeM ~/.conky/conky23/conky/icones/icone_meteo 90 95 86 52 2}
#### icônes Second cadre ####
${template2 AM_IconeM ~/.conky/conky23/conky/icones/icone_meteo 180 95 86 52 3}
${template2 Jour_IconeR ~/.conky/conky23/conky/icones/vent 260 130 25 25 3}
${template2 Noct_IconeM ~/.conky/conky23/conky/icones/icone_meteo 270 95 86 52 3}
#### icônes troisième cadre ####
${template2 AM_IconeM ~/.conky/conky23/conky/icones/icone_meteo 602 95 86 52 4}
${template2 Jour_IconeR ~/.conky/conky23/conky/icones/vent 680 130 25 25 4}
${template2 Noct_IconeM ~/.conky/conky23/conky/icones/icone_meteo 700 95 86 52 4}
#### icônes quatrieme cadre ####
${template2 AM_IconeM ~/.conky/conky23/conky/icones/icone_meteo 785 95 86 52 5}
${template2 Jour_IconeR ~/.conky/conky23/conky/icones/vent 865 130 25 25 5}
${template2 Noct_IconeM ~/.conky/conky23/conky/icones/icone_meteo 890 95 8 x52 5}
#### icones du moment ####
${template2 IconeM ~/.conky/conky23/conky/icones/icone_meteo 8 185 132 79 1}
${template2 IconeV ~/.conky/conky23/conky/icones/vent 335 225 44 44}
${template2 AM_IconeM ~/.conky/conky23/conky/icones/icone_meteo 150 205 132 79 1}
${template2 Noct_IconeM ~/.conky/conky23/conky/icones/icone_meteo 300 305 132 79 1}
${image /tmp/lune.png -p 830,260 -s 63x63 -f 60}

Hors ligne

#484 Le 03/05/2013, à 18:28

viper69

Re : [Conky] Alternative à weather.com (3)

Bonjour à tous.
N'aimant pas rester sur un échec je reviens au conky météo.
Je reprends donc du début et j'ai fait ce qui est demandé en page 1 par Didier T

voici le pack meteo2.lua v1.08, recmeteo.py v1.24 et recmeto_python_2.py v1.03.
décompresser l'archive puis dans un terminal

par contre je ne trouve pas le batch qui devrait être lancé....
je sais suis nul

mad

Merci a vous


Viper69
J'ai ouvert les fenêtres - J'ai vu que l'on pouvait être libre
Le manuel disait "Nécessite Windows XP ou mieux". J'ai donc installé Linux.
Ubuntu depuis 7.04 / Laptop: PressarioC60 / Bureau: CQ5335 / Minipc:LDLC Mercure ML1-C1-2-H1

Hors ligne

#485 Le 03/05/2013, à 18:57

Ehcor8

Re : [Conky] Alternative à weather.com (3)

Bjr Didier,   Merci de prendre un peu de vos vacances pour nous.

rg@rg-HP-Pavilion-dv7-Notebook-PC:~$ sh -c "~/Accuweather/start-recmeteo.sh"
rg@rg-HP-Pavilion-dv7-Notebook-PC:~$ Version = 1.25b
huitHeures 1 Ok
Jour 1 Ok
Nuit 1 Ok
Jour 2 Ok
Nuit 2 Ok
Jour 3 Ok
Nuit 3 Ok
Jour 4 Ok
Nuit 4 Ok
Jour 5 Ok
Nuit 5 Ok
erreur timeout acces HTML
Jour 6 Ok
Nuit 6 Ok
CC Ok
/tmp/charleville-mezieres-rg/Barometre_hr.png
/tmp/charleville-mezieres-rg/Rose-CC.png
convert.im6: Image corrompue `/home/rg/Accuweather/sauvegardes/Charleville-Mezieres/fond-base.png' @ error/gif.c/ReadGIFImage/1362.
convert.im6: pas d'images définies `/home/rg/Accuweather/fonds/charleville-mezieres-meteo.png' @ error/convert.c/ConvertImageCommand/3044.
mise a jour en : 38.510812759399414

Retour du lancement. J'attends une 20aine de minutes pour voir la suite.

Hors ligne

#486 Le 03/05/2013, à 19:18

Ehcor8

Re : [Conky] Alternative à weather.com (3)

mise a jour en : 38.510812759399414
huitHeures 1 Ok
CC Ok
/tmp/charleville-mezieres-rg/Barometre_hr.png
/tmp/charleville-mezieres-rg/Rose-CC.png
convert.im6: En-tête d'image incorrect `/home/rg/Accuweather/sauvegardes/Charleville-Mezieres/fond-base.png' @ error/png.c/ReadPNGImage/3675.
convert.im6: pas d'images définies `/home/rg/Accuweather/fonds/charleville-mezieres-meteo.png' @ error/convert.c/ConvertImageCommand/3044.
mise a jour en : 18.400949478149414
huitHeures 1 Ok
CC Ok
/tmp/charleville-mezieres-rg/Barometre_hr.png
/tmp/charleville-mezieres-rg/Rose-CC.png
mise a jour en : 19.13503336906433

Didier : mes respects !!!   Cela a l'air de bien fonctionner.   Merci pour votre aide.   Jp va sûrement essayer aussi.

Hors ligne

#487 Le 03/05/2013, à 20:00

maan

Re : [Conky] Alternative à weather.com (3)

Merci Didier !! !! 
je n'est plus aucun message d’erreurs, tous ça pour des ptites virgules et des x grrrrrrr !!!!
mais par contre mes icones ne s'affiche toujours pas.

et mes icones se trouve bien à
---- "/home/maan/.conky/conky23/conky/icones/icone_meteo"  pour les icones conditions météo
et
--- "/home/maan/.conky/conky23/conky/icones/vent" pour mes ptites rose des vents

edit :  Bon j'ai résolu une partie de mon problème en fait je vient de remarquer que le chemin des icones ne necéssite pas la dernière partie,
/icone_meteo et /vent,
j'ai donc mes icones qui sont revenues, mais certaines doivent s'afficher par dessus des images et là c'est pas le cas elles restent coincé derrière et ne se voit pas.
J'ai essayer des réglages avant text mais sans succès !!!!

Dernière modification par maan (Le 04/05/2013, à 01:25)


Ubuntu_studio 14.04

Hors ligne

#488 Le 04/05/2013, à 05:50

jpdipsy

Re : [Conky] Alternative à weather.com (3)

Champomi au frais depuis un mois ,réveil aux aurores pour les tests de recmeteo.py 1.25b  lol

Résultat première boucle nickel  mais mise à jour :

Traceback (most recent call last):
  File "/home/jp/Accuweather/scripts/recmeteo.py", line 386, in <module>
    demonise(ent, nb1, nb2, huitHeures, nbJour, interval, nbFoisHuit, Id)
  File "/home/jp/Accuweather/scripts/recmeteo.py", line 326, in demonise
    traitement(ent+nb1+'/hourly-weather-forecast/'+nb2+'?hour='+str(h), repsauv+"/huitHeures"+str(x), repsauv)
  File "/home/jp/Accuweather/scripts/recmeteo.py", line 115, in traitement
    soup = BeautifulSoup(curr[1])
  File "/usr/lib/python3/dist-packages/bs4/__init__.py", line 172, in __init__
    self._feed()
  File "/usr/lib/python3/dist-packages/bs4/__init__.py", line 185, in _feed
    self.builder.feed(self.markup)
  File "/usr/lib/python3/dist-packages/bs4/builder/_lxml.py", line 195, in feed
    self.parser.close()
  File "parser.pxi", line 1187, in lxml.etree._FeedParser.close (src/lxml/lxml.etree.c:88786)
  File "parsertarget.pxi", line 136, in lxml.etree._TargetParserContext._handleParseResult (src/lxml/lxml.etree.c:98001)
  File "parsertarget.pxi", line 130, in lxml.etree._TargetParserContext._handleParseResult (src/lxml/lxml.etree.c:97909)
  File "lxml.etree.pyx", line 294, in lxml.etree._ExceptionContext._raise_if_stored (src/lxml/lxml.etree.c:9071)
TypeError: function takes exactly 5 arguments (1 given)

comment dire ? BeautifulSoup est dans le potage !!!!!!

Dernière modification par jpdipsy (Le 04/05/2013, à 05:51)

Hors ligne

#489 Le 04/05/2013, à 06:22

jpdipsy

Re : [Conky] Alternative à weather.com (3)

@Didier

comme au moins la mise à jour totale fonctionne ne serait il pas plus simple que recmeteo.py (python 3) ne fasse que cela (en place des mises à jours) même si cela prend plus de temps ?

Hors ligne

#490 Le 04/05/2013, à 07:57

Didier-T

Re : [Conky] Alternative à weather.com (3)

@jpdipsy,

sa pourrait se faire, mais j'ai bien peur que rien ne soit réellement réglé comme sa (les pages sont chargées et traitées de la même manière au démarrage et a la mise a jour).

si tu n'a pas redémarré le script, j'aurai besoin du contenu du fichier suivant
/tmp/page.html
si tu l'a redémarré, attend que sa rebug wink

Hors ligne

#491 Le 04/05/2013, à 08:22

enebre

Re : [Conky] Alternative à weather.com (3)

@Didier-T,
Salut vacancier, ta correction recmeteo.py est au petits oignons, aucune erreur dans le terminal, installation de python3.bs4 est nécessaire.
Bonne vacance

Hors ligne

#492 Le 04/05/2013, à 09:21

jpdipsy

Re : [Conky] Alternative à weather.com (3)

Didier-T a écrit :

@jpdipsy,

sa pourrait se faire, mais j'ai bien peur que rien ne soit réellement réglé comme sa (les pages sont chargées et traitées de la même manière au démarrage et a la mise a jour).

si tu n'a pas redémarré le script, j'aurai besoin du contenu du fichier suivant
/tmp/page.html
si tu l'a redémarré, attend que sa rebug wink

tiens la voilà page.html

Hors ligne

#493 Le 04/05/2013, à 11:03

Didier-T

Re : [Conky] Alternative à weather.com (3)

@ jpdipsy,
je viens de tester avec ta page.html, tout se déroule bien, je ne vois pas comment éviter ce bug, qui de toute évidence n'est pas reproductible (en tout cas sous Manjaro).

peut être en effet en ne mettant pas recmeteo.py en démon cela règlerais ton soucis, je vais voir pour intégrer une option supplémentaire.

Hors ligne

#494 Le 04/05/2013, à 11:17

Didier-T

Re : [Conky] Alternative à weather.com (3)

voici le code modifié.
ajout de l'option demon (oui, ou non)

recmeto.py

#! /usr/bin/python3
# -*- coding: utf-8 -*-
# Par Didier-T Forum Ubuntu.fr
# Ajout notification par jpdipsy Forum Ubuntu.fr
# Ajout notification via DBus par ti_tux Forum Ubuntu.fr
# Ajout création repsauv si inexistant par jpdipsy Forum Ubuntu.fr

from socket import timeout
from urllib.request import Request, urlopen, URLError
from os import path, makedirs, system
from time import time, sleep, strftime, localtime
from re import search, compile, findall
from sys import argv
from gc import collect
from bs4 import BeautifulSoup

Version='1.25c'

homedir = path.expanduser('~')

#### initialisation des variables
adressWeb="http://www.accuweather.com/fr/fr/belfort/133341/daily-weather-forecast/133341"
repsauv= "~/essais"
huitHeures="oui"
nbFoisHuit=1
matin="oui"
apresmidi="non"
soiree="non"
nuit="non"
nbJour=1
interval=2
notifi="non"
externe = None
Id = "sans"
demon = "non"

for a in argv:
    if search("adressWeb=", a) is not None:
        adressWeb=compile("adressWeb=(.*)").search(a).group(1)
    if search("repsauv=", a) is not None:
        repsauv=compile("repsauv=(.*)").search(a).group(1)
    if search("huitHeures=", a) is not None:
        huitHeures=compile("huitHeures=(.*)").search(a).group(1)
    if search("nbJour=", a) is not None:
        nbJour=compile("nbJour=(.*)").search(a).group(1)
    if search("interval=", a) is not None:
        interval=compile("interval=(.*)").search(a).group(1)
    if search("notify=", a) is not None:
        notifi=compile("notify=(.*)").search(a).group(1)
    if search("matin=", a) is not None:
        matin=compile("matin=(.*)").search(a).group(1)
    if search("apresmidi=", a) is not None:
        apresmidi=compile("apresmidi=(.*)").search(a).group(1)
    if search("soiree=", a) is not None:
        soiree=compile("soiree=(.*)").search(a).group(1)
    if search("nuit=", a) is not None:
        nuit=compile("nuit=(.*)").search(a).group(1)
    if search("externe=", a) is not None:
        externe=compile("externe=(.*)").search(a).group(1)
    if search("nbFoisHuit=", a) is not None:
        nbFoisHuit=compile("nbFoisHuit=(.*)").search(a).group(1)
    if search("id=", a) is not None:
        Id=compile("id=(.*)").search(a).group(1)
    if search("demon=", a) is not None:
        Id=compile("demon=(.*)").search(a).group(1)

nbJour=int(nbJour)
interval=int(interval)
repsauv=repsauv.replace("~", homedir)
notifi=str.lower(notifi)
huitHeures=str.lower(huitHeures)
nbFoisHuit=int(nbFoisHuit)


#### fin initialisation des variables

#### Fonction de traitement des fichiers
def traitement(adress, fichier, repsauv):
    current_balise=None
    x=1
    user_agent = 'Mozilla/5.0 (X11; Linux x86_64)'
    headers = { 'User-Agent' : user_agent }
    while current_balise is None:
        response = None
        while response is None:
            try:
                html_page = urlopen(adress, timeout=10)
            except (URLError) as error:
                print("HTML ", error)
            except timeout:
                print("erreur timeout acces HTML")
            else:
                try:
                    currentCond=html_page.read()
                except (URLError) as error:
                    print("Lecture page ", error)
                except timeout:
                    print("erreur timeout lecture page")
                else:
                    fiche = open("/tmp/page.html", "wb")
                    fiche.write(currentCond)
                    fiche.close()
                    response = "ok"
        fiche = open("/tmp/page.html", "r")
        lines = fiche.readlines()
        curr = {}
        curr[0] = ""
        curr[1] = ""
        i=0
        for line in lines:
            curr[i] = curr[i]+line
            if search("!-- /.feed-tabs --", line) is not None:
                i=1
        soup1 = BeautifulSoup(curr[0])
        soup = BeautifulSoup(curr[1])
        #si autres que huit heures
        table=soup.find_all('table')
        current_balise=soup.find(id="details")
    information="\n"
    if search("huitHeures", fichier) is None:
        # recherche vent
        divs=current_balise.select("[class~=wind-box-lg]")
        if len(divs) == 0:
            divs=current_balise.select("[class~=wind-box-sm]")
        i=0
        for div in divs:
            i=i+1
            ventd=compile("var d = '(.*)';").search(str(div)).group(1).replace("W", "O")
            ventf=compile("var s = '(.*)';").search(str(div)).group(1)
            information=information+"direction"+str(i)+": "+ventd+"\n"
            information=information+"vitesse"+str(i)+": "+ventf+"\n"
        #info dans l'image
        inf=current_balise.select("[class~=info]")
        icone=current_balise.select("[class~=icon]")
        i=0
        #recherche icone
        for ic in icone:
            i=i+1
            information=information+"icone"+str(i)+": "+str(ic).replace('<div class="icon i-', '').replace('"></div>', '')+"\n"
        i=0
        #récupération date + historique
        if search("Jour", fichier) is not None or search("CC", fichier) is not None:
            histo=soup.find(id="feature-history")
            #récupération date
            date=histo.find_all('th')
            jour=compile("(.*)/(.*)/(.*)").search(date[4].get_text())
            information=information+"jour: "+jour.group(1)+"\n"
            information=information+"mois: "+jour.group(2)+"\n"
            information=information+"année: "+str(int(jour.group(3))+1)+"\n"
            #récupération historique
            hi=histo.select("[class~=hi]")
            for v in hi:
                hivalue=v.get_text().split("\n")
            information=information+"maxjour: "+hivalue[2]+"\n"
            information=information+"maxnormal: "+hivalue[3]+"\n"
            information=information+"maxrecord: "+hivalue[4]+"\n"
            information=information+"max1ans: "+hivalue[5]+"\n"
            lo=histo.select("[class~=last]")
            for v in lo:
                lovalue=v.get_text().split("\n")
            information=information+"minjour: "+lovalue[2]+"\n"
            information=information+"minnormal: "+lovalue[3]+"\n"
            information=information+"minrecord: "+lovalue[4]+"\n"
            information=information+"min1ans: "+lovalue[5]+"\n"
            #info dans l'image
            if search("Jour", fichier) is not None:
                infs=inf[0].get_text().split("\n")
                information=information+"Tempjour: "+findall('-?\d+', infs[0])[0]+"\n"
                information=information+"RealFeeljour: "+findall('-?\d+', infs[1])[0]+"\n"
                information=information+"Précipitationsjour: "+findall('-?\d+', infs[2])[0]+"\n"
                infs=inf[1].get_text().split("\n")
                information=information+"Tempnuit: "+findall('-?\d+', infs[0])[0]+"\n"
                information=information+"RealFeelnuit: "+findall('-?\d+', infs[1])[0]+"\n"
                information=information+"Précipitationsnuit: "+findall('-?\d+', infs[2])[0]+"\n"
                lever_coucher=soup.select("[class~=time-period]")
                i=0
                for p in lever_coucher:
                    spans=p.find_all('span')
                    i=i+1
                    x=0
                    for span in spans:
                        if i == 1:
                            span_nom="Soleil "
                        else:
                            span_nom="Lune "
                        if search('start', str(span)) is not None:
                            information=information+span_nom+"lever: "+span.get_text()+"\n"
                        if search('time', str(span)) is not None:
                            information=information+span_nom+"durée: "+span.get_text()+"\n"
                        if search('finish', str(span)) is not None:
                            information=information+span_nom+"coucher: "+span.get_text()+"\n"


            p=current_balise.find_all('p')
            i=0
            x=0
            for pv in p:
                i=i+1
                if i==5 or i==10:
                    x=x+1
                    information=information+"cond"+str(x)+": "+pv.get_text()+"\n"


        #localisation si condition courante
        if search("CC", fichier) is not None:
            ville=soup1.select("[class~=current-city]")[0].get_text().split(",")[0]
            longi=compile("lon: '(.*)',").search(str(soup1)).group(1)
            lat=compile("lat: '(.*)',").search(str(soup1)).group(1)
            information=information+"ville: "+ville+"\n"
            information=information+"lat: "+lat+"\n"
            information=information+"long: "+longi+"\n"
            #info alerte
            alerte=soup.select("[class~=forecast-status]")
            if str(alerte) != "[]":
                p=alerte[0].find_all('p')
                a=p[0].find_all('a')
                clic=a[0].get_text()
                information=information+"alerte: "+p[0].get_text().replace(clic, "").replace("\n","").replace("\r", "").replace(chr(160), "").rstrip().lstrip()+"\n"
            else:
                information=information+"alerte: RAS\n"
            #info dans l'image
            inf=inf[0].get_text()
            cond=inf[:inf.find(findall('-?\d+', inf)[0])]
            inf=inf.replace(cond, "")
            infs=inf.split(" ")
            information=information+"cond:"+cond+"\n"
            information=information+"Temp: "+infs[0]+"\n"
            information=information+"RealFeel: "+infs[2]+"\n"

        if search("Matin", fichier) is not None or search("AM", fichier) is not None or search("Soiree", fichier) is not None or search("Nuit", fichier) is not None:
            infs=inf[0].get_text().split("\n")
            i=0
            infsc=["","","",""]
            for inf in infs:
                if inf!="":
                    infsc[i]=inf
                    i=i+1
            information=information+"cond:"+infsc[0]+"\n"
            information=information+"max: "+infsc[1]+"\n"
            information=information+"min: "+infsc[2].replace("Mn ", "")+"\n"
            information=information+"RealFeelmax: "+findall('-?\d+', infsc[3])[0]+"\n"
            information=information+"RealFeelmin: "+findall('-?\d+', infsc[3])[1]+"\n"
            
            #info conditions générales
            cc=current_balise.find_all('li')
            for inf in cc:
                inf=inf.get_text()
                inf=inf.replace(compile('^ *').search(inf).group(0), "").replace("\n", "")
                if search(":", inf) is not None:
                    information=information+inf+"\n"
        elif search("Jour", fichier) is not None:
            i=0
            cc=current_balise.find_all('li')
            for inf in cc:
                inf=inf.get_text()
                inf=inf.lstrip().replace("\n", "").replace(" \r", "")
                if search(": ", inf) is not None:
                    i=i+1
                    if i <= 7:
                        inf=inf.replace(":", " jour:")
                    else:
                        inf=inf.replace(":", " nuit:")
                    information=information+inf+"\n"
        else:
            cc=current_balise.find_all('li')
            for inf in cc:
                inf=inf.get_text()
                inf=inf.replace(compile('^ *').search(inf).group(0), "").replace("\n", "")
                if search(":", inf) is not None:
                    information=information+inf+"\n"
            information=information+str(int(time()))+"\n"
    else:
        #recherche icones huit heures
        rows = table[0].findAll('tr')
        x=0
        for tr in rows:
            cols = tr.findAll('td')
            texte_tr=tr.text.split("\n")[1].replace("\n", "")
            i=0
            for td in cols:
                i=i+1
                texte_bu = td.text.replace("\n", "").replace(chr(160), "")
                if texte_bu != "" :
                    if texte_tr == " " and x < len(cols):
                        information=information+"Heure"+str(i)+": "+texte_bu+"\n"
                        x=x+1
                    elif texte_tr != " ":
                        information=information+texte_tr+str(i)+": "+texte_bu+"\n"
        icone=table[0].find_all('div')
        i=0
        for ic in icone:
            i=i+1
            ico="icone"+str(i)+": "+str(ic).replace('<div class="icon i-', '')
            fin=compile('">(.*)div>').search(ico).group(1)
            information=information+ico.replace('">'+fin+'div>', '')+"\n"
            if i == 8:
                break
    fiche = open(fichier, "w")
#    fiche.write(current_balise.prettify())
    fiche.write(information)
    fiche.close()
    collect()
#### fin Fonction de traitement des fichiers

#### Mise en tache de fond
def demonise(ent, id1, id2, huitHeures, nbJour, interval, nbFoisHuit, Id, demon):
    dem=time()-(60*60)
    misajour=1
    while 1 :
        heure=time()
        if huitHeures=="oui":
            x=0
            while x<nbFoisHuit:
                h=(x*8)+int(strftime('%H', localtime()))
                x=x+1
                traitement(ent+nb1+'/hourly-weather-forecast/'+nb2+'?hour='+str(h), repsauv+"/huitHeures"+str(x), repsauv)
                print("huitHeures "+str(x)+" Ok")
        if heure-dem >= 60*60:
            x=0
            while x<nbJour:
                x=x+1
                traitement(ent+nb1+'/daily-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Jour"+str(x), repsauv)
                print("Jour "+str(x)+" Ok")
                if matin=="oui":
                    traitement(ent+nb1+'/morning-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Matin"+str(x), repsauv)
                    print("Matin "+str(x)+" Ok")
                if apresmidi=="oui":
                    traitement(ent+nb1+'/afternoon-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/AM"+str(x), repsauv)
                    print("AM "+str(x)+" Ok")
                if soiree=="oui":
                    traitement(ent+nb1+'/evening-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Soiree"+str(x), repsauv)
                    print("Soiree "+str(x)+" Ok")
                if nuit=="oui":
                    traitement(ent+nb1+'/overnight-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Nuit"+str(x), repsauv)
                    print("Nuit "+str(x)+" Ok")
            dem=heure
        traitement(ent+nb1+'/current-weather/'+nb2, repsauv+"/CC", repsauv)
        print("CC Ok")
        if externe is not None:
                 system(externe)
        fin=time()
        duree=fin-heure
        if notifi == "oui":
            if heure-dem == 0:
                mess=notify2.Notification('Recmeteo.py  v'+Version, 'Météo : mise à jour complète terminée\n en '+str(round(duree,2))+' secondes', 'dialog-information')
            else:
                mess=notify2.Notification('Recmeteo.py  v'+Version, 'Météo : mise à jour partielle terminée\n en '+str(round(duree,2))+' secondes', 'dialog-information')
            mess.show()
        start=heure
        pause=60*interval-int(duree)
        if pause < 0:
            pause=interval
        print("mise a jour en : "+str(duree))
        if demon == "non":
            print("Mode démon non utilisé\nfin de recmeteo.py")
            exit()
        collect()
        sleep(pause)
        if Id != "sans":
            if not path.exists("/proc/"+Id):
                exit()


### Initialiation de DBus pour les notifications
if notifi == "oui":
    import notify2
    notify2.init('Recmeteo.py')
### Vérification répertoire
if not path.exists(repsauv):
    makedirs(repsauv)
#### Lancement du script et initialisation de la tache de fond
nb1=findall('\d+', adressWeb)[0]
nb2=findall('\d+', adressWeb)[1]
ent=adressWeb[:adressWeb.find(nb1)]
fin=adressWeb.replace(ent+nb1, "")
fin=fin.replace(fin[:fin.find(nb2)]+nb2, "")
nb2=nb2+fin
print("Version =", Version)
demonise(ent, nb1, nb2, huitHeures, nbJour, interval, nbFoisHuit, Id, demon)

Hors ligne

#495 Le 04/05/2013, à 13:57

jpdipsy

Re : [Conky] Alternative à weather.com (3)

Didier

corrige

if search("demon=", a) is not None:
        Id=compile("demon=(.*)").search(a).group(1)

par
        demon=compile("demon=(.*)").search(a).group(1)

et met la variable demon= par défaut à oui et ce sera bon j'inclus cette version dans mon pack en mode démon par défaut avec les explications pour ceux qui peuvent avoir des soucis avec 13.04

De mon côté je vais essayer Manjaro pour voir si c'est lié à la distrib ou autre chose

Thank you bon W.E

PS tu pris quelle version de Manjaro ?

Dernière modification par jpdipsy (Le 04/05/2013, à 14:15)

Hors ligne

#496 Le 04/05/2013, à 17:05

Didier-T

Re : [Conky] Alternative à weather.com (3)

Bien vue.
J'utilise la version xfce

Hors ligne

#497 Le 05/05/2013, à 10:23

franz256

Re : [Conky] Alternative à weather.com (3)

Bonjour à vous tous,
Pourriez-vous m'indiquer pourquoi j'ai ce message d'erreur en lançant recmeteo1.25c :

Nuit 1 Ok
Prévision 2 Ok
Matin 2 Ok
Apres Midi 2 Ok
Soiree 2 Ok
Nuit 2 Ok
Prévision 3 Ok
Matin 3 Ok
Apres Midi 3 Ok
Soiree 3 Ok
Nuit 3 Ok
Prévision 4 Ok
Matin 4 Ok
Apres Midi 4 Ok
Soiree 4 Ok
Nuit 4 Ok
Traceback (most recent call last):
  File "/home/francois/.conky/conky-meteo/meteo_lua_2/scripts/recmeteo.py", line 9, in <module>
    from urllib.request import Request, urlopen, URLError
ImportError: No module named request
lunaison Ok

C'est le même message depuis le passage en 13.04. Sauf avec recmeteo1.24 comme indiqué dans mon post 437, avec urlib2. Je dois préciser que c'est une mise à jour de 12.10 vers 13.04 et non pas une installation complète. Ceci explique peut-être cela. Merci de votre aide.

Dernière modification par franz256 (Le 05/05/2013, à 10:28)


Ubuntu 13.04-64 gnome-shell 3.6.1.3

Hors ligne

#498 Le 05/05/2013, à 10:54

ljere

Re : [Conky] Alternative à weather.com (3)

je dirais qu'il te manque le paquet python-urllib3
donc un petit

sudo apt-get install python-urllib3

devrait régler ton souci


ancien PC Toshiba satellite_c670d-11 / Linux Mint 21 Vanessa
Nouveau PC ASUS TUF GAMING A17 GPU RTX 4070 CPU AMD Ryzen 9 7940HS w/ Radeon 780M Graphics / Linux Mint 21.2 Victoria / Kernel: 6.4.8-1-liquorix / Desktop: Cinnamon

Hors ligne

#499 Le 05/05/2013, à 11:02

franz256

Re : [Conky] Alternative à weather.com (3)

Merci pour ta réponse Ijere mais j'ai déjà python-urllib3 et python3-urllib3. Un de trop ?


Ubuntu 13.04-64 gnome-shell 3.6.1.3

Hors ligne

#500 Le 05/05/2013, à 11:17

ragamatrix

Re : [Conky] Alternative à weather.com (3)

Salut,

@jpdipsy Comment as tu crée le thermomètre (classique chrome) pour écrire les graduations ?
Si c'est avec convert as tu gardé ce code ?
En fait j'aimerais le modifier afin d'avoir uniquement le tube et les graduations (sans socle) ?

jpdipsy a écrit :

De mon côté je vais essayer Manjaro pour voir si c'est lié à la distrib ou autre chose

Thank you bon W.E

PS tu pris quelle version de Manjaro ?

Toujours aucun problème avec le script 1.24 depuis quelques jours, sous crunchbang waldorf.

Dernière modification par ragamatrix (Le 05/05/2013, à 11:20)

Hors ligne