Accéder au contenu.
Menu Sympa

devel - [Devel] r491 - scripts

Objet : devel-adl

Archives de la liste

[Devel] r491 - scripts


Chronologique Discussions 
  • From: svn AT agendadulibre.org
  • To: devel AT agendadulibre.org
  • Subject: [Devel] r491 - scripts
  • Date: Sun, 20 Feb 2011 15:06:38 +0100 (CET)
  • List-archive: <http://agendadulibre.org/pipermail/devel>
  • List-id: Developpement de l'Agenda du Libre <devel.agendadulibre.org>

Author: thomas
Date: Sun Feb 20 15:06:37 2011
New Revision: 491

Log:
Mise à jour du script d'extraction des GULLs

Modified:
scripts/extract-gulls.py

Modified: scripts/extract-gulls.py
==============================================================================
--- scripts/extract-gulls.py Tue Nov 9 20:17:06 2010 (r490)
+++ scripts/extract-gulls.py Sun Feb 20 15:06:37 2011 (r491)
@@ -149,6 +149,27 @@
u'Manchix': u'Cherbourg',
u'LUG d\'Agneaux et de ses environs': u'Agneaux',
u'Bethunelibre': u'Bethune',
+ u'Les Linuxiens Laragnais': u'Laragne-Montéglin',
+ u'Salamandrix': u'Villers-Cotterêts',
+ u'LAILA': u'Troyes',
+ u'ULLM': u'Martigues',
+ u'Linux-Angoulême': u'Angoulême',
+ u'Pullco': u'Brive-la-Gaillarde',
+ u'DR2M': u'Bastia',
+ u'Infothema': u'Bégard',
+ u'Mammoutux': u'Roufignac',
+ u'Abistodegnux': u'Condom',
+ u'ALL': u'Montpellier',
+ u'GULLL': u'Châteaubriant',
+ u'Alternative 46': u'Cahors',
+ u"Lug d'\Agneaux": u"Agneaux",
+ u"Gebull": u"Bressuire",
+ u"LUG-Adeti.org": u"Tours",
+ u"Ubuntu-Lyon": u"Lyon",
+ u"PostPro": u"Toulon",
+ u"APP3L": u"Poitiers",
+ u"LUG Veternat": u"Ventron",
+ u"Le Libre Vanvéen": u"Vanves",
}

class GULLParser(HTMLParser.HTMLParser):
@@ -215,12 +236,25 @@
else:
city = ""

- print "insert into lugs (region, department, city, name,
url) values ('%s', '%s', '%s', '%s', '%s');" \
- % (str(depts2region[str(self.currentDepartement)]),
- self.currentDepartement,
- city.replace("'", r"\'").encode('utf-8'),
- self.currentLugName.replace("'",
r"\'").encode('utf-8'),
- self.currentLugLink)
+ if self.currentLugName == "LinAC" or \
+ self.currentLugName == "ACDILL" or \
+ self.currentLugName == "Perinux" or \
+ self.currentLugName == "Club ENSIMAG" or \
+ self.currentLugName == "Masclat LUG" or \
+ self.currentLugName == "SL@M" or \
+ self.currentLugName == "M@IL" or \
+ self.currentLugName == "Bourguinux" or \
+ self.currentLugName == "Tarentux":
+ self.currentLugLink = None
+ self.currentLugName = None
+ return
+
+ query = "insert into lugs (region, department, city, name,
url) values ('%s', '%s', '%s', '%s', '%s');" \
+ % (str(depts2region[str(self.currentDepartement)]),
+ self.currentDepartement, city.replace("'", r"\'"),
+ self.currentLugName.replace("'", r"\'"),
+ self.currentLugLink)
+ print query.encode("utf-8")

self.currentLugLink = None
self.currentLugName = None
@@ -235,7 +269,7 @@

if self.inLug and self.inLugLink and self.currentLugName is None:
# Hack a little ;-)
- data = unicode(data, "iso-8859-15")
+ # data = unicode(data, "utf-8")
data = data.replace("\n", " ")
data = re.sub(" +", " ", data)
data = data.strip()
@@ -255,5 +289,6 @@
donnees = f.read(8192)
if not donnees:
break
+ donnees = unicode(donnees, "utf-8")
p.feed(donnees)
p.close()




  • [Devel] r491 - scripts, svn, 20/02/2011

Archives gérées par MHonArc 2.6.16.

Haut de le page