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.

#626 Le 04/05/2008, à 20:27

mydoom666

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

froli a écrit :

cest quoi ton horloge en haut de ton conky?

http://gnome-look.org/content/show.php/ … tent=77159

smile

Hors ligne

#627 Le 04/05/2008, à 21:45

froli

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

hells_dark a écrit :

Où puis-je trouver ton screenlet pour Sonata?

Je vien de découvrir mpd, c'est tout simplement GÉNIAL smile j'adore


Pour voir mon desktop cliquez ici

Hors ligne

#628 Le 04/05/2008, à 22:02

yanightmare

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

hells_dark a écrit :

C'est quoi le truc zarbi qui fait des vagues en haut à droite ? tongue

Classe l'horloge ! yikes

C'est quoi ? tongue

Hors ligne

#629 Le 04/05/2008, à 22:04

mydoom666

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

yanightmare a écrit :

Classe l'horloge ! yikes
C'est quoi ? tongue

Cf. 2 posts plus haut. tongue
Screenlets

Hors ligne

#630 Le 04/05/2008, à 23:06

Panic

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

Voici le mien

bureaurt1.th.jpg

J'ai compiz fusion maintenant tongue

Dernière modification par Panic (Le 04/05/2008, à 23:07)

Hors ligne

#631 Le 04/05/2008, à 23:14

hells_dark

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

froli a écrit :

(détails du thème)
Où puis-je trouver ton screenlet pour Sonata?

Je vien de découvrir mpd, c'est tout simplement GÉNIAL smile j'adore

Ben c'est le nowPlaying Screenlet, qui est disponible par défaut avec screenlets si ton paquet  est à jour. Mais il marche pas au top en ce moment (les covers se rafraichissent pas toujours et les préférences ne sont pas gardées)..

C'est quoi le truc zarbi qui fait des vagues en haut à droite ? tongue

C'est le plugin "montrer le pointeur" de compiz. Il est sympa. Après les vagues, c'est juste le plugin water..

Dernière modification par hells_dark (Le 04/05/2008, à 23:15)


"You caught me at a strange time in my life."
devianArt - site perso

Hors ligne

#632 Le 04/05/2008, à 23:16

kornwall

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

le mien ... sous windows lol

768294c40b7aa2219c20f53ac4f31t.jpg

triste à dire mais j'passe plus de temps sous windows que sous ubuntu
me convient de moins en moins maintenant ubuntu hmm
/hs


Golom golom

Hors ligne

#633 Le 04/05/2008, à 23:33

hells_dark

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

kornwall a écrit :

le mien ... sous windows lol

http://pix.nofrag.com/4/d/e/768294c40b7 … c4f31t.jpg

triste à dire mais j'passe plus de temps sous windows que sous ubuntu
me convient de moins en moins maintenant ubuntu hmm
/hs

Bah tant mieux si ça te convient.


"You caught me at a strange time in my life."
devianArt - site perso

Hors ligne

#634 Le 05/05/2008, à 01:12

Vincent89

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

kornwall a écrit :

le mien ... sous windows lol

http://pix.nofrag.com/4/d/e/768294c40b7 … c4f31t.jpg

triste à dire mais j'passe plus de temps sous windows que sous ubuntu
me convient de moins en moins maintenant ubuntu hmm
/hs

Bon je m'empeche de troller ...mais bon c'est un forum ubuntu quoi...

yikes j'ai fait un troll la? yikes

Hors ligne

#635 Le 05/05/2008, à 03:30

sweetthdevil

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

Pour mettre un peu a jour...

capture1bb6.th.png

capture2nc4.th.png

Dernière modification par sweetthdevil (Le 05/05/2008, à 03:31)

Hors ligne

#636 Le 05/05/2008, à 06:45

Di@bl@l

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

Vincent89 a écrit :
kornwall a écrit :

le mien ... sous windows lol

http://pix.nofrag.com/4/d/e/768294c40b7 … c4f31t.jpg

triste à dire mais j'passe plus de temps sous windows que sous ubuntu
me convient de moins en moins maintenant ubuntu hmm
/hs

Bon je m'empeche de troller ...mais bon c'est un forum ubuntu quoi...

yikes j'ai fait un troll la? yikes

+1

c'est pas le topic mais va sur des topics comme http://forum.ubuntu-fr.org/viewtopic.php?id=78027&p=30 pour expliquer ton cas.

Hors ligne

#637 Le 05/05/2008, à 08:04

MarcAura

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

Je crois pas que c'est du 16/9 c'est plutot 16/6.

Hors ligne

#638 Le 05/05/2008, à 08:49

Di@bl@l

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

MarcAura a écrit :

Je crois pas que c'est du 16/9 c'est plutot 16/6.

Alors : 4/3*2=8/3
Or :    8/3*2=16/6

Donc t'as raison. sinon c'est juste un dualscreen.

Hors ligne

#639 Le 05/05/2008, à 09:08

Bismut

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

Di@bl@l a écrit :

Alors : 4/3*2=8/3
Or :    8/3*2=16/6

Donc t'as raison. sinon c'est juste un dualscreen.

Mon Dieu... qu'est-ce que c'est que ces calculs ? XD
C'est juste un DualScreen avec 2 écrans au format 4/3 : 2 x (4/3) = 8 / 3 = 16 / 6 si tu préfères ;)

sweetthdevil > Y a moyen que tu refasses ces screenshots en un peu plus grand car même en pleine taille on voit pas grand chose et il me semble qu'il y a des choses qui m'intéressent dessus :)

Dernière modification par Bismut (Le 05/05/2008, à 09:15)


Mac Mini 2009 avec Archlinux
Asus EeePC S101 avec Archlinux
HTC Magic avec Android

Hors ligne

#640 Le 05/05/2008, à 09:20

kornwall

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

Di@bl@l a écrit :
Vincent89 a écrit :
kornwall a écrit :

le mien ... sous windows lol

http://pix.nofrag.com/4/d/e/768294c40b7 … c4f31t.jpg

triste à dire mais j'passe plus de temps sous windows que sous ubuntu
me convient de moins en moins maintenant ubuntu hmm
/hs

Bon je m'empeche de troller ...mais bon c'est un forum ubuntu quoi...

yikes j'ai fait un troll la? yikes

+1

c'est pas le topic mais va sur des topics comme http://forum.ubuntu-fr.org/viewtopic.php?id=78027&p=30 pour expliquer ton cas.

ouah, 2 lignes c'est déjà de trop, eh ben roll
surtout que je poste mon bureau, rien d'autre, ds un topic situé ds la rubrique Etre ou ne pas être...
rubrique dédiée spécialement à ubuntu/linux ? je ne crois pas mais bon j'ai pas brossé ds le sens du poil aussi.
je vais le mettre en gras cette fois-ci : /hs

Dernière modification par kornwall (Le 05/05/2008, à 09:24)


Golom golom

Hors ligne

#641 Le 05/05/2008, à 12:00

sweetthdevil

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

Bismut a écrit :
Di@bl@l a écrit :

Alors : 4/3*2=8/3
Or :    8/3*2=16/6

Donc t'as raison. sinon c'est juste un dualscreen.

Mon Dieu... qu'est-ce que c'est que ces calculs ? XD
C'est juste un DualScreen avec 2 écrans au format 4/3 : 2 x (4/3) = 8 / 3 = 16 / 6 si tu préfères wink

sweetthdevil > Y a moyen que tu refasses ces screenshots en un peu plus grand car même en pleine taille on voit pas grand chose et il me semble qu'il y a des choses qui m'intéressent dessus smile

Hey bien, c'est des calcules bien complique les gars, c'est effectivement un Dual-Screen, avec un Widescreen a gauche de 19 pouces et un normale a droite de 19 pouces.

Pour les screens shot plus grands regarde la;

http://maxftp.spiralezone.com/files/Capture-1.png
http://maxftp.spiralezone.com/files/Capture-2.png

Voila

Hors ligne

#642 Le 05/05/2008, à 14:16

Bismut

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

Merci, 2 petites choses :

- Pourrais-tu filer ton Conkyrc, notamment comment faire pour la météo...

- Firefox : Je vois que ton thème gnome applique un barre noire sur la barre de menu normalement, moi aussi... Sur Firefox, j'ai l'habitude de fusionner la toolbar (précédent/suivant,url, search) avec la menubar avec TinyMenu pour compacter un peu et avoir un look à la "Safari". Seulement je ne peux pas descendre la barre de menu, donc je dois monter la toolbar... Ce qui fait que pour des thèmes GTK comme le tien, j'ai ma Toolbar un peu déformé avec un fond noir, comme une menubar, forcément...
Et je vois que toi non... je ne vois que 2 explications :
* tu utilises l'extension qui applique un thème spéciale seulement au fond des barres du haut, car tes icônes suivent ton thème GTK, donc ce n'est pas un vrai thème Firefox.
* tu as trouvé un moyen pour descendre la barre de menu sur la toolbar, et là ça m'intéresse smile

Voili voilou, merci d'avance.


Mac Mini 2009 avec Archlinux
Asus EeePC S101 avec Archlinux
HTC Magic avec Android

Hors ligne

#643 Le 05/05/2008, à 15:37

sweetthdevil

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

Alors pour le Conky:

use_xft yes
xftfont verdana:size=8
xftalpha 0.8
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

## Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right

# Update interval in seconds
update_interval 2.0

# set to yes if you want tormo to be forked in the background
background yes

# Create own window instead of using desktop (required in nautilus)
own_window no

 TEXT

   ${font StyleBats:size=18}F${font}${alignc} ${time %H:%M:%S} 
   ${font StyleBats:size=18}4${font}${alignc}   ${time %A %d %B}
   ${font StyleBats:size=18}P${font}${alignc}   Work:  ${uptime_short}  
 
   

   ${font StyleBats:size=18}A${font}${alignc}   CPU:  ${cpu}
   ${font PizzaDude Bullets:size=16}J${font}${alignc}   $mem / $memmax

   ${font xspiralmental:size=17}E${font}${alignc}   ${kernel}

Ville: ${alignc}${execi 3600 python ~/.scripts/conkyForecast.py --location=FRXX0137 --datatype=CN --refetch}
Conditions: ${alignc}${execi 3600 python ~/.scripts/conkyForecast.py --location=FRXX0137 --datatype=CC}
${alignc}${font Weather:size=36}${execi 3600 python ~/.scripts/conkyForecast.py --location=FRXX0137 --datatype=WF}${font}
Temp: ${alignc}${execi 3600 python ~/.scripts/conkyForecast.py --location=FRXX0137 --datatype=HT}
Wind: ${alignc}${execi 3600 python ~/.scripts/conkyForecast.py --location=FRXX0137 --datatype=WS}
Wind Direction: ${alignc}${execi 3600 python ~/.scripts/conkyForecast.py --location=FRXX0137 --datatype=WD}
Humidity: ${alignc}${execi 3600 python ~/.scripts/conkyForecast.py --location=FRXX0137 --datatype=HM}

   
   ${if_running amarokapp}
   ${font Superstar DJ:size=18}(${font}${alignc}AmaroK${color white}
   ${alignc}${execi 10 ~/.conky/amarok artist}
   ${alignc}${execi 10 ~/.conky/amarok title}
   ${execibar 1 ~/.conky/amarok progress}
   ${alignc}"${execi 10 ~/.conky/amarok album}"

Ensuite place ~/scripts/conkyForecast.py

#!/usr/bin/python
# -*- coding: utf-8 -*-
###############################################################################
# conkyForecast.py is a (not so) simple (anymore) python script to gather 
# details of the current weather for use in conky.
#
#  Author: Kaivalagi
# Created: 13/04/2008
# Modifications:
#	14/04/2008	Allow day ranges for forecast data
#	14/04/2008	Check for connectivity to xoap service
#	18/04/2008	Allow the setting of spaces for ranged output
#	18/04/2008	Allow Night and Day forecast output
#	18/04/2008	Support locale for condition code text "CC" option, awaiting spanish language translation
#	18/04/2008	Use pickling for class data rather than opening xml, this bypasses the need to interrogate cached data
#	19/04/2008	Added spanish condition text - Thanks Bruce M
#	19/04/2008	Added isnumeric check on all numeric output with units suffix
#	19/04/2008	Altered pickle file naming to include location code
#	19/04/2008	Added spanish week days conversion via locale
#	20/04/2008	Added decent command argument parser
#	20/04/2008	Added --shortweekday option, if given the day of week data type is shortened to 3 characters
#	21/04/2008	Fixed locale options for forecast output
#	21/04/2008	Added --template option to allow custom output using a single exec call :)
#	21/04/2008	Added --hideunits option to remove, for example, mph and C from output
#	23/04/2008	Removed --imperial option from template, this MUST be set as a standard option on the script call and not used in the template file. 
#	23/04/2008	Readded --imperial option to template, enabling metric or imperial values per datatype. Note when using templates command line option will not work.
#	23/04/2008	Added output notifying user if the location given is bad
#	24/04/2008	Added handling for no connectivity, will revert to cached data now (erroring if no cache exists). Tests by trying to open xoap.weather.com
#	24/04/2008	Fixed Celsius to fahrenheit conversion
# TODO:
# ??? Any more requirements out there?

import sys, os, socket, urllib2, datetime, time
from xml.dom import minidom
from stat import *
from optparse import OptionParser
import locale
import gettext
import pickle
from math import *

APP="conkyForecast.py"
DIR=os.path.dirname (__file__) + '/locale'
gettext.bindtextdomain(APP, DIR)
gettext.textdomain(APP)
_ = gettext.gettext

class CommandLineParser:

	parser = None

	def __init__(self):

		self.parser = OptionParser()
		self.parser.add_option("-l","--location", dest="location", default="UKXX0103", type="string", metavar="CODE", help=u"location code for weather data [default: %default],Use the following url to determine your location code by city name: http://xoap.weather.com/search/search?where=Norwich")
		self.parser.add_option("-d","--datatype",dest="datatype", default="HT", type="string", metavar="DATATYPE", help=u"[default: %default] The data type options are: DW (Day Of Week), WF (Weather Font Output), LT (Low Temp), HT (High Temp), CC (Current Conditions), CT (Conditions Text), PC (Precipitation Chance), HM (Humidity), WD (Wind Direction), WS (Wind Speed), WG (Wind Gusts), CN (City Name). Not applicable at command line when using templates.")
		self.parser.add_option("-s","--startday",dest="startday", type="int", metavar="NUMBER", help=u"define the starting day number, if omitted current conditions are output. Not applicable at command line when using templates.")
		self.parser.add_option("-e","--endday",dest="endday", type="int", metavar="NUMBER", help=u"define the ending day number, if omitted only starting day data is output. Not applicable at command line when using templates.")
		self.parser.add_option("-S","--spaces",dest="spaces", type="int", default=1, metavar="NUMBER", help=u"[default: %default] Define the number of spaces between ranged output. Not applicable at command line when using templates.")
		self.parser.add_option("-t","--template",dest="template", type="string", metavar="FILE", help=u"define a template file to generate output in one call. A displayable item in the file is in the form {--datatype=HT --startday=1}. The following are possible options within each item: --datatype,--startday,--endday,--night,--shortweekday,--imperial,--hideunits,--spaces . Note that the short forms of the options are not currently supported! None of these options are applicable at command line when using templates.")
		self.parser.add_option("-L","--locale",dest="locale", type="string", help=u"override the system locale for language output (en=english, es=spanish, more to come)")
		self.parser.add_option("-i","--imperial",dest="imperial", default=False, action="store_true", help=u"request imperial units, if omitted output is in metric. Not applicable at command line when using templates.")
		self.parser.add_option("-n","--night",dest="night", default=False, action="store_true", help=u"switch output to night data, if omitted day output will be output. Not applicable at command line when using templates.")
		self.parser.add_option("-w","--shortweekday",dest="shortweekday", default=False, action="store_true", help=u"Shorten the day of week data type to 3 characters. Not applicable at command line when using templates.")
		self.parser.add_option("-u","--hideunits",dest="hideunits", default=False, action="store_true", help=u"Hide units such as mph or C, degree symbols (°) are still shown. Not applicable at command line when using templates.")
		self.parser.add_option("-v","--verbose",dest="verbose", default=False, action="store_true", help=u"request verbose output, no a good idea when running through conky!")
		self.parser.add_option("-r","--refetch",dest="refetch", default=False, action="store_true", help=u"fetch data regardless of data expiry")

	def parse_args(self):
		(options, args) = self.parser.parse_args()
		return (options, args)

	def print_help(self):
		return self.parser.print_help()

class WeatherData:
	def __init__(self, day_of_week, low, high, condition_code, condition_text, precip, humidity, wind_dir, wind_speed, wind_gusts, city):
		self.day_of_week = u""+day_of_week
		self.low = u""+low
		self.high = u""+high
		self.condition_code = u""+condition_code
		self.condition_text = u""+condition_text
		self.precip = u""+precip
		self.humidity = u""+humidity
		self.wind_dir = u""+wind_dir
		self.wind_speed = u""+wind_speed
		self.wind_gusts = u""+wind_gusts
		self.city = u""+city

class WeatherText:

	conditions_text = {
		"0": _(u"Tornado"),
		"1": _(u"Tropical Storm"),
		"2": _(u"Hurricane"),
		"3": _(u"Severe Thunderstorms"),
		"4": _(u"Thunderstorms"),
		"5": _(u"Mixed Rain and Snow"),
		"6": _(u"Mixed Rain and Sleet"),
		"7": _(u"Mixed Precipitation"),
		"8": _(u"Freezing Drizzle"),
		"9": _(u"Drizzle"),
		"10": _(u"Freezing Rain"),
		"11": _(u"Showers"),
		"12": _(u"Showers"),
		"13": _(u"Snow Flurries"),
		"14": _(u"Light Snow Showers"),
		"15": _(u"Blowing Snow"),
		"16": _(u"Snow"),
		"17": _(u"Hail"),
		"18": _(u"Sleet"),
		"19": _(u"Dust"),
		"20": _(u"Fog"),
		"21": _(u"Haze"),
		"22": _(u"Smoke"),
		"23": _(u"Blustery"), 
		"24": _(u"Windy"),
		"25": _(u"Cold"),
		"26": _(u"Cloudy"),
		"27": _(u"Mostly Cloudy"),
		"28": _(u"Mostly Cloudy"),
		"29": _(u"Partly Cloudy"),
		"30": _(u"Partly Cloudy"),
		"31": _(u"Clear"),
		"32": _(u"Clear"),
		"33": _(u"Fair"),
		"34": _(u"Fair"),
		"35": _(u"Mixed Rain and Hail"),
		"36": _(u"Hot"),
		"37": _(u"Isolated Thunderstorms"),
		"38": _(u"Scattered Thunderstorms"),
		"39": _(u"Scattered Thunderstorms"),
		"40": _(u"Scattered Showers"),
		"41": _(u"Heavy Snow"),
		"42": _(u"Scattered Snow Showers"),
		"43": _(u"Heavy Snow"),
		"44": _(u"Partly Cloudy"),
		"45": _(u"Thunder Showers"),
		"46": _(u"Snow Showers"),
		"47": _(u"Isolated Thunderstorms"),
		"na": _(u"N/A"),
		"-": _(u"N/A")
	}

	conditions_text_es = {
		"0": _(u"Tornado"),
		"1": _(u"Tormenta Tropical"),
		"2": _(u"Huracán"),
		"3": _(u"Tormentas Severas"),
		"4": _(u"Tormentas"),
		"5": _(u"Mixed Rain and Snow"),
		"6": _(u"Mixed Rain and Sleet"),
		"7": _(u"Mixed Precipitation"),
		"8": _(u"Freezing Drizzle"),
		"9": _(u"Llovizna"),
		"10": _(u"Freezing Rain"),
		"11": _(u"Chaparrones"),
		"12": _(u"Chaparrones"),
		"13": _(u"Snow Flurries"),
		"14": _(u"Light Snow Showers"),
		"15": _(u"Blowing Snow"),
		"16": _(u"Nieve"),
		"17": _(u"Granizo"),
		"18": _(u"Aguanieve"),
		"19": _(u"Polvo"),
		"20": _(u"Niebla"),
		"21": _(u"Haze"),
		"22": _(u"Humo"),
		"23": _(u"Blustery"), 
		"24": _(u"Windy"),
		"25": _(u"Frío"),
		"26": _(u"Nublado"),
		"27": _(u"Mayormente Nublado"),
		"28": _(u"Mayormente Nublado"),
		"29": _(u"Parcialmente Nublado"),
		"30": _(u"Parcialmente Nublado"),
		"31": _(u"Despejado"),
		"32": _(u"Despejado"),
		"33": _(u"Algo Nublado"),
		"34": _(u"Algo Nublado"),
		"35": _(u"Mixed Rain and Hail"),
		"36": _(u"Calor"),
		"37": _(u"Tormentas Aisladas"),
		"38": _(u"Tormentas Dispersadas"),
		"39": _(u"Tormentas Dispersadas"),
		"40": _(u"Chubascos Dispersos"),
		"41": _(u"Heavy Snow"),
		"42": _(u"Scattered Snow Showers"),
		"43": _(u"Nieve Pesada"),
		"44": _(u"Nubes Dispersas"),
		"45": _(u"Thunder Showers"),
		"46": _(u"Snow Showers"),
		"47": _(u"Tormentas Aisladas"),
		"na": _(u"N/A"),
		"-": _(u"N/A")
	}

	conditions_weather_font = {
		"0": _(u"W"),
		"1": _(u"V"),
		"2": _(u"W"),
		"3": _(u"s"),
		"4": _(u"p"),
		"5": _(u"k"),
		"6": _(u"k"),
		"7": _(u"g"),
		"8": _(u"g"),
		"9": _(u"g"),
		"10": _(u"h"),
		"11": _(u"g"),
		"12": _(u"g"),
		"13": _(u"k"),
		"14": _(u"k"),
		"15": _(u"k"),
		"16": _(u"k"),
		"17": _(u"k"),
		"18": _(u"k"),
		"19": _(u"e"),
		"20": _(u"e"),
		"21": _(u"a"),
		"22": _(u"d"),
		"23": _(u"d"), 
		"24": _(u"d"),
		"25": _(u"d"),
		"26": _(u"e"),
		"27": _(u"e"),
		"28": _(u"e"),
		"29": _(u"c"),
		"30": _(u"c"),
		"31": _(u"a"),
		"32": _(u"a"),
		"33": _(u"b"),
		"34": _(u"b"),
		"35": _(u"k"),
		"36": _(u"a"),
		"37": _(u"f"),
		"38": _(u"f"),
		"39": _(u"f"),
		"40": _(u"g"),
		"41": _(u"k"),
		"42": _(u"k"),
		"43": _(u"k"),
		"44": _(u"b"),
		"45": _(u"g"),
		"46": _(u"k"),
		"47": _(u"f"),
		"na": _(u"N/A"),
		"-": _(u"N/A")
	}
	
	day_of_week = {
		"Today": _(u"Today"),
		"Monday": _(u"Monday"),
		"Tuesday": _(u"Tuesday"),
		"Wednesday": _(u"Wednesday"),
		"Thursday": _(u"Thursday"),
		"Friday": _(u"Friday"),
		"Saturday": _(u"Saturday"),
		"Sunday": _(u"Sunday")
	}

	day_of_week_short = {
		"Today": _(u"Now"),
		"Monday": _(u"Mon"),
		"Tuesday": _(u"Tue"),
		"Wednesday": _(u"Wed"),
		"Thursday": _(u"Thu"),
		"Friday": _(u"Fri"),
		"Saturday": _(u"Sat"),
		"Sunday": _(u"Sun")
	}

	day_of_week_es = {
		"Today": _(u"hoy"),
		"Monday": _(u"lunes"),
		"Tuesday": _(u"martes"),
		"Wednesday": _(u"miércoles"),
		"Thursday": _(u"jueves"),
		"Friday": _(u"viernes"),
		"Saturday": _(u"sábado"),
		"Sunday": _(u"domingo")
	}

	day_of_week_short_es = {
		"Today": _(u"hoy"),
		"Monday": _(u"lun"),
		"Tuesday": _(u"mar"),
		"Wednesday": _(u"mié"),
		"Thursday": _(u"jue"),
		"Friday": _(u"vie"),
		"Saturday": _(u"sáb"),
		"Sunday": _(u"dom")
	}
  
class GlobalWeather:

	current_conditions = []
	day_forecast = []
	night_forecast = []

	locale = "en"

	options = None
	currentxmldoc = ""
	forecastxmldoc = ""

 	TEMP_FILEPATH_CURRENT = "/tmp/conkyForecast-c-LOCATION.pkl"
	TEMP_FILEPATH_DAYFORECAST = "/tmp/conkyForecast-df-LOCATION.pkl"
	TEMP_FILEPATH_NIGHTFORECAST = "/tmp/conkyForecast-nf-LOCATION.pkl"
 	EXPIRY_MINUTES_CURRENT = 240
	EXPIRY_MINUTES_FORECAST = 240
	DEFAULT_SPACING = u" "
		

	def __init__(self,options):

		self.options = options
		
		if self.options.locale == None:
			try:
				self.locale = locale.getdefaultlocale()[0][0:2]
			except:
				print "locale not set"
		else:
			self.locale = self.options.locale

		if self.options.verbose == True:
			print >> sys.stdout, "locale set to ",self.locale

	def getText(self,nodelist):
		rc = ""
		for node in nodelist:
			if node.nodeType == node.TEXT_NODE:
				rc = rc + node.data
		return rc


	def getSpaces(self,spaces):
		string = u""
		if spaces == None:
			string = self.DEFAULT_SPACING
		else:
			for i in range(0, spaces+1):
				string = string + u" "
		return string


	def isNumeric(self,string):
		try:
			dummy = int(string)
			return True
		except:
			return False

	def isConnectionAvailable(self):
		# ensure we can access weather.com's server by opening the url
		try:
			usock = urllib2.urlopen('http://xoap.weather.com')
			usock.close()
			return True
		except:
			return False

	def getBearingText(self,bearing):
		bearing = float(bearing)
		if bearing < 11.25:
			return u"N"
		if bearing < 33.75:
			return u"NNE"
		if bearing < 56.25:
			return u"NE"
		if bearing < 78.75:
			return u"ENE"
		if bearing < 101.25:
			return u"E"
		if bearing < 123.75:
			return u"ESE"
		if bearing < 146.25:
			return u"SE"
		if bearing < 168.75:
			return u"SSE"
		if bearing < 191.25:
			return u"S"
		if bearing < 213.75:
			return u"SSW"
		if bearing < 236.25:
			return u"SW"
		if bearing < 258.75:
			return u"WSW"
		if bearing < 281.25:
			return u"W"
		if bearing < 303.75:
			return u"WNW"
		if bearing < 326.25:
			return u"NW"
		if bearing < 348.75:
			return u"NNW"

	def CelsiusToFahrenheit(self,temp):
		return str(int(floor(((float(temp)*9.0)/5.0)+32)))

	def KilometresToMiles(self,dist):
		return str(int(floor(int(dist)*0.621371192)))

	def getTemplateList(self,template):

		templatelist = []
	
		for template_part in template.split("{"):
			if template_part != "":
				for template_part in template_part.split("}"):
					if template_part != "":
						templatelist.append(u""+template_part)

		return templatelist


	def getOutputText(self,datatype,startday,endday,night,shortweekday,imperial,hideunits,spaces):
		#try:
			output = u""
		
			# define current units for output
			if hideunits == False:
				if imperial == False:
					tempunit = u"°C"
					speedunit = u"kph"
				else:
					tempunit = u"°F"
					speedunit = u"mph"
			else:
				tempunit = u"°"
				speedunit = u""

			if startday == None: # current conditions

				if datatype == "DW":
					if self.locale == "es":
						if shortweekday == True:
							output = WeatherText.day_of_week_short_es[self.current_conditions[0].day_of_week]
						else:
							output = WeatherText.day_of_week_es[self.current_conditions[0].day_of_week]
					else:
						if shortweekday == True:
							output = WeatherText.day_of_week_short[self.current_conditions[0].day_of_week]
						else:
							output = WeatherText.day_of_week[self.current_conditions[0].day_of_week]
				elif datatype == "WF": # weather font
					output = WeatherText.conditions_weather_font[self.current_conditions[0].condition_code]
				elif datatype == "LT":
					string = self.current_conditions[0].low
					if self.isNumeric(string) == True:
						if imperial == True:
							string = self.CelsiusToFahrenheit(string)
						string = string + tempunit
					output = string
				elif datatype == "HT":
					string = self.current_conditions[0].high
					if self.isNumeric(string) == True:
						if imperial == True:
							string = self.CelsiusToFahrenheit(string)
						string = string + tempunit
					output = string
				elif datatype == "CC":
					if self.locale == "es":
						output = WeatherText.conditions_text_es[self.current_conditions[0].condition_code]
					else:
						output = WeatherText.conditions_text[self.current_conditions[0].condition_code] 
				elif datatype == "CT":
					output = self.current_conditions[0].condition_text
				elif datatype == "PC":
					string = self.current_conditions[0].precip
					if self.isNumeric(string) == True:
						string = string + u"%"
					output = string
				elif datatype == "HM":
					string = self.current_conditions[0].humidity
					if self.isNumeric(string) == True:
						string = string + u"%"
					output = string
				elif datatype == "WD":
					string = self.current_conditions[0].wind_dir
					if self.isNumeric(string) == True:
						string = self.getBearingText(string)
					output = string
				elif datatype == "WS":
					string = self.current_conditions[0].wind_speed
					if self.isNumeric(string) == True:
						if imperial == True:
							string = self.KilometresToMiles(string)
						string = string + speedunit
					output = string
				elif datatype == "WG":
					string = self.current_conditions[0].wind_gusts
					if self.isNumeric(string) == True:
						if imperial == True:
							string = self.KilometresToMiles(string)
						string = string + speedunit
					output = string
				elif datatype == "CN":
					output = self.current_conditions[0].city
				else:
					output = "\nERROR:Unknown data type requested"

			else: # forecast data

				if endday == None: # if no endday was set use startday
					endday = startday

				if night == True: # night forecast required

					for day_number in range(startday, endday+1):

						if datatype == "DW":
							if self.locale == "es":
								if shortweekday == True:
									output = output + self.getSpaces(spaces) + WeatherText.day_of_week_short_es[self.night_forecast[day_number].day_of_week]
								else:
									output = output + self.getSpaces(spaces) + WeatherText.day_of_week_es[self.night_forecast[day_number].day_of_week]
							else:
								if shortweekday == True:
									output = output + self.getSpaces(spaces) + WeatherText.day_of_week_short[self.night_forecast[day_number].day_of_week]
								else:
									output = output + self.getSpaces(spaces) + WeatherText.day_of_week[self.night_forecast[day_number].day_of_week]
						elif datatype == "WF": # weather font
							output = output + self.getSpaces(spaces) + WeatherText.conditions_weather_font[self.night_forecast[day_number].condition_code]
						elif datatype == "LT":
							string = self.night_forecast[day_number].low
							if self.isNumeric(string) == True:
								if imperial == True:
									string = self.CelsiusToFahrenheit(string)
								string = string + tempunit
							output = output + self.getSpaces(spaces) + string

						elif datatype == "HT":
							string = self.night_forecast[day_number].high
							if self.isNumeric(string) == True:
								if imperial == True:
									string = self.CelsiusToFahrenheit(string)
								string = string + tempunit
							output = output + self.getSpaces(spaces) + string
						elif datatype == "CC":
							if self.locale == "es":
								output = output + self.getSpaces(spaces) + WeatherText.conditions_text_es[self.night_forecast[day_number].condition_code]
							else:
								output = output + self.getSpaces(spaces) + WeatherText.conditions_text[self.night_forecast[day_number].condition_code]
						elif datatype == "CT":
							output = output + self.getSpaces(spaces) + self.night_forecast[day_number].condition_text
						elif datatype == "PC":
							string = self.night_forecast[day_number].precip
							if self.isNumeric(string) == True:
								string = string + u"%"
							output = output + self.getSpaces(spaces) + string
						elif datatype == "HM":
							string = self.night_forecast[day_number].humidity
							if self.isNumeric(string) == True:
								string = string + u"%"
							output = output + self.getSpaces(spaces) + string
						elif datatype == "WD":
							output = output + self.getSpaces(spaces) + self.night_forecast[day_number].wind_dir
						elif datatype == "WS":
							string = self.night_forecast[day_number].wind_speed
							if self.isNumeric(string) == True:
								if imperial == True:
									string = self.KilometresToMiles(string)
								string = string + speedunit
							output = output + self.getSpaces(spaces) + string
						elif datatype == "WG":
							string = self.night_forecast[day_number].wind_gusts
							if self.isNumeric(string) == True:
								if imperial == True:
									string = self.KilometresToMiles(string)
								string = string + speedunit
							output = output + self.getSpaces(spaces) + string
						elif datatype == "CN":
							output = output + self.getSpaces(spaces) + self.night_forecast[day_number].city
						else:
							output = "\nERROR:Unknown data type requested"
							break

				else: # day forecast wanted

					for day_number in range(startday, endday+1):

						if datatype == "DW":
							if self.locale == "es":
								if shortweekday == True:
									output = output + self.getSpaces(spaces) + WeatherText.day_of_week_short_es[self.day_forecast[day_number].day_of_week]
								else:
									output = output + self.getSpaces(spaces) + WeatherText.day_of_week_es[self.day_forecast[day_number].day_of_week]
							else:
								if shortweekday == True:
									output = output + self.getSpaces(spaces) + WeatherText.day_of_week_short[self.day_forecast[day_number].day_of_week]
								else:
									output = output + self.getSpaces(spaces) + WeatherText.day_of_week[self.day_forecast[day_number].day_of_week]
						elif datatype == "WF": # weather font
							output = output + self.getSpaces(spaces) + WeatherText.conditions_weather_font[self.day_forecast[day_number].condition_code]
						elif datatype == "LT":
							string = self.day_forecast[day_number].low
							if self.isNumeric(string) == True:
								if imperial == True:
									string = self.CelsiusToFahrenheit(string)
								string = string + tempunit
							output = output + self.getSpaces(spaces) + string
						elif datatype == "HT":
							string = self.day_forecast[day_number].high
							if self.isNumeric(string) == True:
								if imperial == True:
									string = self.CelsiusToFahrenheit(string)
								string = string + tempunit
							output = output + self.getSpaces(spaces) + string
						elif datatype == "CC":
							if self.locale == "es":
								output = output + self.getSpaces(spaces) + WeatherText.conditions_text_es[self.day_forecast[day_number].condition_code]
							else:
								output = output + self.getSpaces(spaces) + WeatherText.conditions_text[self.day_forecast[day_number].condition_code]
						elif datatype == "CT":
							output = output + self.getSpaces(spaces) + self.day_forecast[day_number].condition_text
						elif datatype == "PC":
							string = self.day_forecast[day_number].precip
							if self.isNumeric(string) == True:
								string = string + u"%"
							output = output + self.getSpaces(spaces) + string
						elif datatype == "HM":
							string = self.day_forecast[day_number].humidity
							if self.isNumeric(string) == True:
								string = string + u"%"
							output = output + self.getSpaces(spaces) + string
						elif datatype == "WD":
							output = output + self.getSpaces(spaces) + self.day_forecast[day_number].wind_dir
						elif datatype == "WS":
							string = self.day_forecast[day_number].wind_speed
							if self.isNumeric(string) == True:
								if imperial == True:
									string = self.KilometresToMiles(string)
								string = string + speedunit
							output = output + self.getSpaces(spaces) + string
						elif datatype == "WG":
							string = self.day_forecast[day_number].wind_gusts
							if self.isNumeric(string) == True:
								if imperial == True:
									string = self.KilometresToMiles(string)
								string = string + speedunit
							output = output + self.getSpaces(spaces) + string
						elif datatype == "CN":
							output = output + self.getSpaces(spaces) + self.day_forecast[day_number].city
						else:
							output = u"\nERROR:Unknown data type requested"
							break

			output = u""+output.strip(u" ") # lose leading/trailing spaces
			return output

		#except:
			#print "getOutputText:Unexpected error: ", sys.exc_info()[0]


	def getOutputTextFromTemplate(self,template):
		#try:

			# keys to template data
			DATATYPE_KEY = "--datatype="
			STARTDAY_KEY = "--startday="
			ENDDAY_KEY = "--endday="
			NIGHT_KEY = "--night"
			SHORTWEEKDAY_KEY = "--shortweekday"
			IMPERIAL_KEY = "--imperial"
			HIDEUNITS_KEY = "--hideunits"
			SPACES_KEY = "--spaces="

			output = u""

			optionfound = False

			#load the file
			try:
				fileinput = open(self.options.template)
				template = fileinput.read()
				fileinput.close()
			except:
				output = u"Template file no found!"

			templatelist = self.getTemplateList(template)

			# lets walk through the template list and determine the output for each item found
			for i in range(0,len(templatelist)-1):

				pos = templatelist[i].find(DATATYPE_KEY)
				if pos != -1:
					optionfound = True
					pos = pos + len(DATATYPE_KEY)
					datatype = templatelist[i][pos:pos+4].strip("}").strip("{").strip("-").strip(" ")
				else:
					datatype = None

				pos = templatelist[i].find(STARTDAY_KEY)
				if pos != -1:
					optionfound = True
					pos = pos + len(STARTDAY_KEY)
					startday = int(templatelist[i][pos:pos+4].strip("}").strip("{").strip("-").strip(" "))
				else:
					startday = None

				pos = templatelist[i].find(ENDDAY_KEY)
				if pos != -1:
					optionfound = True
					pos = pos + len(ENDDAY_KEY)
					endday = int(templatelist[i][pos:pos+4].strip("}").strip("{").strip("-").strip(" "))
				else:
					endday = None

				pos = templatelist[i].find(NIGHT_KEY)
				if pos != -1:
					optionfound = True
					night = True
				else:
					night = False

				pos = templatelist[i].find(SHORTWEEKDAY_KEY)
				if pos != -1:
					optionfound = True
					shortweekday = True
				else:
					shortweekday = False

				pos = templatelist[i].find(IMPERIAL_KEY)
				if pos != -1:
					optionfound = True
					imperial = True
				else:
					imperial = False

				pos = templatelist[i].find(HIDEUNITS_KEY)
				if pos != -1:
					optionfound = True
					hideunits = True
				else:
					hideunits = False

				pos = templatelist[i].find(SPACES_KEY)
				if pos != -1:
					optionfound = True
					pos = pos + len(SPACES_KEY)
					spaces = int(templatelist[i][pos:pos+4].strip("}").strip("{").strip("-").strip(" "))
				else:
					spaces = 1

				if optionfound == True:
					templatelist[i] = self.getOutputText(datatype,startday,endday,night,shortweekday,imperial,hideunits,spaces)
					optionfound = False

			# go through the list concatenating the output now that it's been populated
			for item in templatelist:
				output = output + item

			return output

		#except:
			#print "getOutputTextFromTemplate:Unexpected error: ", sys.exc_info()[0]


	def fetchData(self):

		# always fetch metric data, use conversation functions on this data
		file_path_current = self.TEMP_FILEPATH_CURRENT.replace("LOCATION",self.options.location)
		file_path_dayforecast = self.TEMP_FILEPATH_DAYFORECAST.replace("LOCATION",self.options.location)
		file_path_nightforecast = self.TEMP_FILEPATH_NIGHTFORECAST.replace("LOCATION",self.options.location)

		if self.isConnectionAvailable() == False:
			if os.path.exists(file_path_current):
				RefetchCurrentData = False
				RefetchForecastData = False
			else: # no connection, no cache, bang!
				print "No internet connection is available and no cached weather data exists."
		elif self.options.refetch == True:
			RefetchCurrentData = True
			RefetchForecastData = True
		else:
	 		# does the current data need retrieving again?
	 		if os.path.exists(file_path_current):
	 			lastmodDate = time.localtime(os.stat(file_path_current)[ST_MTIME])
				expiryDate = (datetime.datetime.today() - datetime.timedelta(minutes=self.EXPIRY_MINUTES_CURRENT)).timetuple()

				if expiryDate > lastmodDate:
					RefetchCurrentData = True
				else:
					RefetchCurrentData = False
			else:
				RefetchCurrentData = True

	 		# does the forecast data need retrieving again? Just check day file as both day and night are retrieved as one
	 		if os.path.exists(file_path_dayforecast):
	 			lastmodDate = time.localtime(os.stat(file_path_dayforecast)[ST_MTIME])
				expiryDate = (datetime.datetime.today() - datetime.timedelta(minutes=self.EXPIRY_MINUTES_FORECAST)).timetuple()

				if expiryDate > lastmodDate:
					RefetchForecastData = True
				else:
					RefetchForecastData = False
			else:
				RefetchForecastData = True

                # fetch the current conditions data, either from the website or by 'unpickling'
 		if RefetchCurrentData == True:

			# obtain current conditions data from xoap service
			try:

				url = 'http://xoap.weather.com/weather/local/' + self.options.location + '?cc=*&prod=xoap&par=1048871467&key=12daac2f3a67cb39&unit=m'
				if self.options.verbose == True:
					print >> sys.stdout, "fetching current conditions data from ",url

				usock = urllib2.urlopen(url)
				xml = usock.read()
				usock.close()
				self.currentxmldoc = minidom.parseString(xml)
			except:
				print "fetchData:Unexpected error: ", sys.exc_info()[0]
				print "Unable to contact weather source for current conditions"

			# tell the user if the location is bad...
			found = xml.find("Invalid location provided")
			if found != -1:
				print "Invalid location provided"

			# interrogate current conditions, load into class structure and pickle it
			try:

				# interrogate the xml and load class data
				self.current_conditions = []

				day_of_week = "Today"
				weather_n = self.currentxmldoc.documentElement
				location_n = weather_n.getElementsByTagName('loc')[0]
				city_n = location_n.getElementsByTagName('dnam')[0]
				city = self.getText(city_n.childNodes)
				sunrise_n = location_n.getElementsByTagName('sunr')[0]
				sunrise = self.getText(sunrise_n.childNodes)
				sunset_n = location_n.getElementsByTagName('suns')[0]
				sunset = self.getText(sunset_n.childNodes)
				current_condition_n = weather_n.getElementsByTagName('cc')[0]
				current_desc_n = current_condition_n.getElementsByTagName('t')[0]
				current_desc = self.getText(current_desc_n.childNodes)
				current_code_n = current_condition_n.getElementsByTagName('icon')[0]
				current_code = self.getText(current_code_n.childNodes)
				current_temp_n = current_condition_n.getElementsByTagName('tmp')[0]
				current_temp = self.getText(current_temp_n.childNodes)
				current_temp_feels_n = current_condition_n.getElementsByTagName('flik')[0]
				current_temp_feels = self.getText(current_temp_feels_n.childNodes)
				bar_n = current_condition_n.getElementsByTagName('bar')[0]
				bar_read_n = bar_n.getElementsByTagName('r')[0]
				bar_read = self.getText(bar_read_n.childNodes)
				bar_desc_n = bar_n.getElementsByTagName('d')[0]
				bar_desc = self.getText(bar_desc_n.childNodes)
				wind_n = current_condition_n.getElementsByTagName('wind')[0]
				wind_speed_n = wind_n.getElementsByTagName('s')[0]
				wind_speed = self.getText(wind_speed_n.childNodes)
				wind_gust_n = wind_n.getElementsByTagName('gust')[0]
				wind_gusts = self.getText(wind_gust_n.childNodes)
				wind_dir_n = wind_n.getElementsByTagName('d')[0]
				wind_direction = self.getText(wind_dir_n.childNodes)
				humidity_n = current_condition_n.getElementsByTagName('hmid')[0]
				humidity = self.getText(humidity_n.childNodes)
				moon_n = current_condition_n.getElementsByTagName('moon')[0]
				moon_phase_n = moon_n.getElementsByTagName('t')[0]
				moon_phase = self.getText(moon_phase_n.childNodes)
				current_conditions_data = WeatherData(day_of_week, current_temp, current_temp, current_code, current_desc, "N/A", humidity, wind_direction, wind_speed, wind_gusts, city)
				self.current_conditions.append(current_conditions_data)

				# pickle the data for next time!
				fileoutput = open(file_path_current, 'w')
 				pickle.dump(self.current_conditions,fileoutput)
		 		fileoutput.close()

			except:
				print "fetchData:Unexpected error: ", sys.exc_info()[0]
				print "Unable to interrogate the current conditions data"

		else:
			if self.options.verbose == True:
				print >> sys.stdout, "fetching current conditions data from file: ",file_path_current

 			fileinput = open(file_path_current, 'r')
			self.current_conditions = pickle.load(fileinput)
			fileinput.close()

                # fetch the forecast data, either from the website or by 'unpickling'
 		if RefetchForecastData == True:

			# obtain forecast data from xoap service
			try:
				url = 'http://xoap.weather.com/weather/local/' + self.options.location + '?dayf=8&prod=xoap&par=1048871467&key=12daac2f3a67cb39&unit=m'
				if self.options.verbose == True:
					print >> sys.stdout, "fetching forecast data from ",url

				usock = urllib2.urlopen(url)
				xml = usock.read()
				usock.close()
				self.forecastxmldoc = minidom.parseString(xml)

			except:
				print "fetchData:Unexpected error: ", sys.exc_info()[0]
				print "Unable to contact weather source for forecast"

			# tell the user if the location is bad...
			found = xml.find("Invalid location provided")
			if found != -1:
				print "Invalid location provided"

			# interrogate forecast, load into class structure and pickle it
			try:

				# forecast data
				self.day_forecast = []
				self.night_forecast = []

				weather_n = self.forecastxmldoc.documentElement
				location_n = weather_n.getElementsByTagName('loc')[0]
				city_n = location_n.getElementsByTagName('dnam')[0]
				city = self.getText(city_n.childNodes)
				forecast_n = weather_n.getElementsByTagName('dayf')[0]
				day_nodes = forecast_n.getElementsByTagName('day')
	
				for day in day_nodes:
					day_of_week = day.getAttribute('t')
					day_of_year = day.getAttribute('dt')
					high_temp_n = day.getElementsByTagName('hi')[0]
					high_temp = self.getText(high_temp_n.childNodes)
					low_temp_n = day.getElementsByTagName('low')[0]
					low_temp = self.getText(low_temp_n.childNodes)

					# day forecast specific data
					daytime_n = day.getElementsByTagName('part')[0] # day
					condition_code_n = daytime_n.getElementsByTagName('icon')[0]
					condition_code = self.getText(condition_code_n.childNodes)
					condition_n = daytime_n.getElementsByTagName('t')[0]
					condition = self.getText(condition_n.childNodes)
					precip_n = daytime_n.getElementsByTagName('ppcp')[0]
					precip = self.getText(precip_n.childNodes)
					humidity_n = daytime_n.getElementsByTagName('hmid')[0]
					humidity = self.getText(humidity_n.childNodes)
					wind_n = daytime_n.getElementsByTagName('wind')[0]
					wind_speed_n = wind_n.getElementsByTagName('s')[0]
					wind_speed = self.getText(wind_speed_n.childNodes)
					wind_direction_n = wind_n.getElementsByTagName('t')[0]
					wind_direction = self.getText(wind_direction_n.childNodes)
					wind_gusts_n = wind_n.getElementsByTagName('gust')[0]
					wind_gusts = self.getText(wind_gusts_n.childNodes)
					day_forecast_data = WeatherData(day_of_week, low_temp, high_temp, condition_code, condition, precip, humidity, wind_direction, wind_speed, wind_gusts, city)
					self.day_forecast.append(day_forecast_data) 	

					# night forecast specific data
					daytime_n = day.getElementsByTagName('part')[1] # night
					condition_code_n = daytime_n.getElementsByTagName('icon')[0]
					condition_code = self.getText(condition_code_n.childNodes)
					condition_n = daytime_n.getElementsByTagName('t')[0]
					condition = self.getText(condition_n.childNodes)
					precip_n = daytime_n.getElementsByTagName('ppcp')[0]
					precip = self.getText(precip_n.childNodes)
					humidity_n = daytime_n.getElementsByTagName('hmid')[0]
					humidity = self.getText(humidity_n.childNodes)
					wind_n = daytime_n.getElementsByTagName('wind')[0]
					wind_speed_n = wind_n.getElementsByTagName('s')[0]
					wind_speed = self.getText(wind_speed_n.childNodes)
					wind_direction_n = wind_n.getElementsByTagName('t')[0]
					wind_direction = self.getText(wind_direction_n.childNodes)
					wind_gusts_n = wind_n.getElementsByTagName('gust')[0]
					wind_gusts = self.getText(wind_gusts_n.childNodes)
					night_forecast_data = WeatherData(day_of_week, low_temp, high_temp, condition_code, condition, precip, humidity, wind_direction, wind_speed, wind_gusts, city)
					self.night_forecast.append(night_forecast_data) 


				# pickle the data for next time!
				fileoutput = open(file_path_dayforecast, 'w')
 				pickle.dump(self.day_forecast,fileoutput)
		 		fileoutput.close()

				fileoutput = open(file_path_nightforecast, 'w')
 				pickle.dump(self.night_forecast,fileoutput)
		 		fileoutput.close()

			except:
				print "fetchData:Unexpected error: ", sys.exc_info()[0]
				print "Unable to interrogate the forecast data"


		else: # no fetch required, load the class

			if self.options.verbose == True:
				print >> sys.stdout, "fetching forecast data from files: ",file_path_dayforecast, file_path_nightforecast

 			fileinput = open(file_path_dayforecast, 'r')
			self.day_forecast = pickle.load(fileinput)
			fileinput.close()

 			fileinput = open(file_path_nightforecast, 'r')
			self.night_forecast = pickle.load(fileinput)
			fileinput.close()


	def outputData(self):
		#try:

			if self.options.template != None:

				output = self.getOutputTextFromTemplate(self.options.template)

			else:

				output = self.getOutputText(self.options.datatype,self.options.startday,self.options.endday,self.options.night,self.options.shortweekday,self.options.imperial,self.options.hideunits,self.options.spaces)


			print output.encode("utf-8")

		#except:
			#print "outputData:Unexpected error: ", sys.exc_info()[0]

if __name__ == "__main__":

	parser = CommandLineParser()
	(options, args) = parser.parse_args()

	if options.verbose == True:
		print >> sys.stdout, "location:",options.location
		print >> sys.stdout, "imperial:",options.imperial
		print >> sys.stdout, "datatype:",options.datatype
		print >> sys.stdout, "night:",options.night
		print >> sys.stdout, "start day:",options.startday
		print >> sys.stdout, "end day:",options.endday
		print >> sys.stdout, "spaces:",options.spaces
		print >> sys.stdout, "verbose:",options.verbose
		print >> sys.stdout, "refetch:",options.refetch

	# create new global weather object
	weather = GlobalWeather(options)
	weather.fetchData()
	weather.outputData()

Y'a aussi moyen d'afficher les prévisions meteo, demande moi si tu veux, le script amarok est disponible partout. ( enfin je peut te le filer si nécessaire)

Pour Firefox, je n'utilise pas d'extension je déplace simplement les choses;
-Les icônes de navigations sont places dans la barre des Menus (fichier, éditions etc) devant dans mon cas.
-La barre de navigation est place dans la barre des menus,  derriere dans mon cas.
-Les bookmarks sont place dans la barre, ou ce trouvais la barre de navigations.

Ensuite clic droit et décoche la barre personnelle, qui est vide. Voila.

Le theme GTK est Freshness, base sur Vitality avec le code moteur de Dark Ice pour obtenir la barre des Menus Gnome transparent.

Voila si tu as besoin d'autre chose, n'hésite pas ^^

Hors ligne

#644 Le 05/05/2008, à 16:50

Bismut

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

Merci smile

- Pour Conky, je n'ai pas les images devant, mais de grosses lettres... est-ce normal ? Je vais googler un peu.

- Pour Firefox, faut vraiment que tu m'expliques comment tu fais ça hmm
Je veux dire, le fond de ma barre de menu (Fichier, Edition...) est du couleur de mon thème GTK, donc noir... Donc si j'y colle ma Toolbar du dessous, le fond reste noir, et c'est pas ce que je veux... Je voudrais plutôt descendre ma barre de menu (et la réduire avec TinyMenu) afin de l'avoir dans ma Toolbar et ainsi de virer ce fond noir de barre de menu quand je mets un thème GTK de ce genre.


Mac Mini 2009 avec Archlinux
Asus EeePC S101 avec Archlinux
HTC Magic avec Android

Hors ligne

#645 Le 05/05/2008, à 16:59

ayoli

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

Bismut a écrit :

Merci smile

- Pour Conky, je n'ai pas les images devant, mais de grosses lettres... est-ce normal ? Je vais googler un peu.

- Pour Firefox, faut vraiment que tu m'expliques comment tu fais ça hmm
Je veux dire, le fond de ma barre de menu (Fichier, Edition...) est du couleur de mon thème GTK, donc noir... Donc si j'y colle ma Toolbar du dessous, le fond reste noir, et c'est pas ce que je veux... Je voudrais plutôt descendre ma barre de menu (et la réduire avec TinyMenu) afin de l'avoir dans ma Toolbar et ainsi de virer ce fond noir de barre de menu quand je mets un thème GTK de ce genre.

Ce que tu appelles des "images" dans le conky c'est plutot une police de caracteres (des symboles), dont la plus part doivent venir de celle ci
http://www.dafont.com/fr/style-bats.font

Hors ligne

#646 Le 05/05/2008, à 17:15

sweetthdevil

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

Pour le conky il te faut ces fonts:
-Stylebats
-PizzaDude
-Weather
-xspiralmental

Et pour avoir la meteo de ta ville, faut changer le code (dispo sur weather.com) dans le conkyrc (pour le moment FRXX0137)

Pour Firefox j'utilise le theme par default, vu qu'il se sert du theme GTK maintenant, mais ma barre de menu non noir viens de Personas

Dernière modification par sweetthdevil (Le 05/05/2008, à 17:21)

Hors ligne

#647 Le 05/05/2008, à 17:53

Bismut

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

Ah... Captage... thanks a lot. smile

PS : A tout hasard, quelqu'un aurait-il les scripts de hellsdark sous la main ? (pour afficher les infos et créer la miniature) Son Blog est actuellement HS...


Mac Mini 2009 avec Archlinux
Asus EeePC S101 avec Archlinux
HTC Magic avec Android

Hors ligne

#648 Le 05/05/2008, à 18:33

ayoli

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

ah , son site fonctionne chez moi

Hors ligne

#649 Le 05/05/2008, à 19:25

Bismut

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

ayoli a écrit :

ah , son site fonctionne chez moi

Décidemment, il me fait mentir... Mais tu peux voir dans les News qu'il avait perdu sa BDD et qu'il était en train de la restaurer wink

Bon, j'en profite pour vous laisser mon 1er jet depuis quelques temps :

ad0c6977352b9c12818b5e47037fft.jpg


Mac Mini 2009 avec Archlinux
Asus EeePC S101 avec Archlinux
HTC Magic avec Android

Hors ligne

#650 Le 05/05/2008, à 20:28

ayoli

Re : POSTEZ DES MINIATURES - A quoi ressemble votre environnement (2)?

en passant :
thumbs_05052008.png

Hors ligne