merge V00.80
authorSamuel Huron <samuel.huron@centrepompidou.fr>
Thu, 15 Sep 2011 23:37:53 +0200
changeset 277 f6ea88117c5c
parent 276 f7669b499d41 (current diff)
parent 274 5b95aa665776 (diff)
child 278 702c51147196
merge
--- a/script/stream/recorder_tweetstream.py	Thu Sep 15 23:35:31 2011 +0200
+++ b/script/stream/recorder_tweetstream.py	Thu Sep 15 23:37:53 2011 +0200
@@ -38,13 +38,16 @@
 
 
 def set_logging(options):
-    utils.set_logging(options, logging.getLogger('iri.tweet'))
-    utils.set_logging(options, logging.getLogger('multiprocessing'))
+    loggers = []
+    
+    loggers.append(utils.set_logging(options, logging.getLogger('iri.tweet')))
+    loggers.append(utils.set_logging(options, logging.getLogger('multiprocessing')))
     if options.debug >= 2:
-        utils.set_logging(options, logging.getLogger('sqlalchemy.engine'))
+        loggers.append(utils.set_logging(options, logging.getLogger('sqlalchemy.engine')))
     #utils.set_logging(options, logging.getLogger('sqlalchemy.dialects'))
     #utils.set_logging(options, logging.getLogger('sqlalchemy.pool'))
     #utils.set_logging(options, logging.getLogger('sqlalchemy.orm'))
+    return loggers
 
 def set_logging_process(options, queue):
     qlogger = utils.set_logging(options, logging.getLogger('iri.tweet.p'), queue)
@@ -331,6 +334,8 @@
                       help="Twitter track", metavar="TRACK")
     parser.add_option("-n", "--new", dest="new", action="store_true",
                       help="new database", default=False)
+    parser.add_option("-D", "--daemon", dest="daemon", action="store_true",
+                      help="launch daemon", default=False)
     parser.add_option("-r", "--reconnects", dest="reconnects",
                       help="Reconnects", metavar="RECONNECTS", default=10, type='int')
     parser.add_option("-t", dest="token_filename", metavar="TOKEN_FILENAME", default=".oauth_token",
@@ -478,13 +483,9 @@
     return stop_args
 
 
-if __name__ == '__main__':
-
-    (options, args) = get_options()
+def main(options, args):
     
-    set_logging(options)
-    
-    utils.get_logger().debug("OPTIONS : " + repr(options))    
+    global conn_str
     
     conn_str = options.conn_str.strip()
     if not re.match("^\w+://.+", conn_str):
@@ -531,4 +532,28 @@
         add_process_event(type="shutdown", args=stop_args, session_maker=Session)
 
     utils.get_logger().debug("Done. Exiting.")
+
+
+
+if __name__ == '__main__':
+
+    (options, args) = get_options()
+    
+    loggers = set_logging(options)
+    
+    utils.get_logger().debug("OPTIONS : " + repr(options))
+    
+    if options.daemon:
+        import daemon
+        import lockfile
         
+        hdlr_preserve = []
+        for logger in loggers:
+            hdlr_preserve.extend([h.stream for h in logger.handlers])
+            
+        context = daemon.DaemonContext(working_directory=os.getcwd(), files_preserve=hdlr_preserve) 
+        with context:
+            main(options, args)
+    else:
+        main(options, args)
+
Binary file script/virtualenv/res/lockfile-0.9.1.tar.gz has changed
Binary file script/virtualenv/res/python-daemon-1.5.5.tar.gz has changed
--- a/web/.htaccess.tmpl	Thu Sep 15 23:35:31 2011 +0200
+++ b/web/.htaccess.tmpl	Thu Sep 15 23:37:53 2011 +0200
@@ -3,6 +3,6 @@
 RewriteEngine on
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-f 
-RewriteCond %{REQUEST_FILENAME} !-d 
+RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule (.+)/([\w-]+)\.php$ ~ymh/tweet_live/$2.php?rep=$1 [QSA,L]
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/rwd-meetup-patrimoine/config.php	Thu Sep 15 23:37:53 2011 +0200
@@ -0,0 +1,47 @@
+<?php
+
+$config = array(
+    'hashtag'    => '#LRWD',
+    'date'   	 => '08.09.2011',
+    'heure'   	 => '17h00',
+    'place'   	 => 'Salle Piazza - Centre Pompidou',
+    
+    'title' 	 => "Patrimoine et Web de données",
+	'abstract'   => '',    
+    'description'=> "Le monde du patrimoine - bibliothèques, archives, musées… - s’engage sur la voie du web de données, et les initiatives se développent : début juin s’est tenu le <a href='http://lod-lam.net/summit/' target='_blank'>LOD-LAM Summit</a> - Linked Open Data in Libraries, Archives, and Museums   - et durant l’été le groupe d’incubation « <a href='http://www.w3.org/2005/Incubator/lld/' target='_blank'>Library Linked Data</a> » - Bibliothèques et Web de données - du W3C va rendre son rapport de préconisations dont le <a href='http://www.w3.org/2005/Incubator/lld/wiki/DraftReportWithTransclusion' target='_blank'>brouillon est disponible actuellement pour commentaires</a>.
+Une table ronde réunira
+<ul>
+<li><a href='http://www.viadeo.com/profile/0022brh4qewlf17o' target='_blank'>Claire Sibille</a>, responsable du bureau du traitement des archives et de l'informatisation au <a href='http://www.archivesdefrance.culture.gouv.fr/archives-publiques/organisation-du-reseau-des-archives-en-france/direction-des-archives-de-france/' target='_blank'>Service interministériel des Archives de France</a> du Ministère de la Culture et de la communication qui présentera le projet du <a href='http://www.archivesdefrance.culture.gouv.fr/thesaurus/'>thésaurus pour l'indexation des archives locales publié par les Archives de France</a></li>
+<li><a href='http://www.figoblog.org/about' target='_blank'>Emmanuelle Bermès</a>, responsable du projet <a href='http://cblog.culture.fr/2011/06/07/le-centre-pompidou-virtuel-une-nouvelle-strategie-numerique' target='_blank'>Centre Pompidou Virtuel</a>, également chair du  groupe d’incubation « Library Linked Data » au W3C.</li>
+<li><a href='http://www.enssib.fr/bibliotheque-numerique/document-21205' target='_blank'>Romain Wenz</a>, responsable du projet « <a href='http://www.bnf.fr/fr/professionnels/web_semantique_donnees/s.web_semantique_bnf.html' target='_blank'>data.bnf.fr</a> » au sein du Département de l'Information Bibliographique et Numérique à la BnF.</li>
+</ul>
+pour imaginer jusqu'où les technologies du web de données vont permettre la production de métadonnées riches, favorisant la valorisation, la mise en relation et la réutilisation des catalogues patrimoniaux.						",
+					
+    'link'       => 'http://www.meetup.com/paris-web-of-data/events/24074911/',
+    'keywords'   => 'meetup, patrimoine, données, linked data, web sémantique',
+    'rep' 		 => 'rwd-meetup-patrimoine',
+    'islive'	 => true,
+    'partenaires'=> "",
+		 
+	// After the event 
+#	'metadata'	 => "http://www.iri.centrepompidou.fr/dev/ldt/ldtplatform/ldt/cljson/id/13b0aa52-336b-11e0-b233-00145ea49a02",
+    'player'     => "res/metadataplayer/src/js/LdtPlayer.js",  
+	'duration'   => '4299820',
+	'client_visual' => 'images/bgd_player.png', // optional - relative path
+   	'head_logo' => 'images/sw-horz-w3c_head.png', // optional - relative path
+	'slide_background' => 'images/slide_background.png',
+	'archive_img' => "images/tail_patrimoine.png",	
+	'archive_title' => "Patrimoine et Web de données",
+	'archive_description' => "à l'IRI, salle Piazza, Centre Pompidou <br/>le jeudi 08 septembre 2011 | 17:00 - 20:00",
+	
+	'div_height' => 680,
+	'player_width' => 650,
+	'player_height' => 480,
+);
+
+?>
+    
+    
+    
+
+
Binary file web/rwd-meetup-patrimoine/images/bgd_player.png has changed
Binary file web/rwd-meetup-patrimoine/images/slide_background.png has changed
Binary file web/rwd-meetup-patrimoine/images/sw-horz-w3c_head.png has changed
Binary file web/rwd-meetup-patrimoine/images/tail_patrimoine.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/web/rwd-meetup-patrimoine/index.php	Thu Sep 15 23:37:53 2011 +0200
@@ -0,0 +1,6 @@
+<?php
+// Permanent redirection
+header("HTTP/1.1 301 Moved Permanently");
+header("Location: polemicaltimeline.php");
+exit();
+?>
\ No newline at end of file