# HG changeset patch # User Samuel Huron # Date 1316122673 -7200 # Node ID f6ea88117c5cf57b9e5e784af6412a8d01efc125 # Parent f7669b499d41aeea92c6059a7d922b105a9eabd3# Parent 5b95aa66577654fef805155b07e93647b93780a5 merge diff -r f7669b499d41 -r f6ea88117c5c script/stream/recorder_tweetstream.py --- 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) + diff -r f7669b499d41 -r f6ea88117c5c script/virtualenv/res/lockfile-0.9.1.tar.gz Binary file script/virtualenv/res/lockfile-0.9.1.tar.gz has changed diff -r f7669b499d41 -r f6ea88117c5c script/virtualenv/res/python-daemon-1.5.5.tar.gz Binary file script/virtualenv/res/python-daemon-1.5.5.tar.gz has changed diff -r f7669b499d41 -r f6ea88117c5c web/.htaccess.tmpl --- 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] diff -r f7669b499d41 -r f6ea88117c5c web/rwd-meetup-patrimoine/config.php --- /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 @@ + '#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 LOD-LAM Summit - Linked Open Data in Libraries, Archives, and Museums - et durant l’été le groupe d’incubation « Library Linked Data » - Bibliothèques et Web de données - du W3C va rendre son rapport de préconisations dont le brouillon est disponible actuellement pour commentaires. +Une table ronde réunira + +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
le jeudi 08 septembre 2011 | 17:00 - 20:00", + + 'div_height' => 680, + 'player_width' => 650, + 'player_height' => 480, +); + +?> + + + + + diff -r f7669b499d41 -r f6ea88117c5c web/rwd-meetup-patrimoine/images/bgd_player.png Binary file web/rwd-meetup-patrimoine/images/bgd_player.png has changed diff -r f7669b499d41 -r f6ea88117c5c web/rwd-meetup-patrimoine/images/slide_background.png Binary file web/rwd-meetup-patrimoine/images/slide_background.png has changed diff -r f7669b499d41 -r f6ea88117c5c web/rwd-meetup-patrimoine/images/sw-horz-w3c_head.png Binary file web/rwd-meetup-patrimoine/images/sw-horz-w3c_head.png has changed diff -r f7669b499d41 -r f6ea88117c5c web/rwd-meetup-patrimoine/images/tail_patrimoine.png Binary file web/rwd-meetup-patrimoine/images/tail_patrimoine.png has changed diff -r f7669b499d41 -r f6ea88117c5c web/rwd-meetup-patrimoine/index.php --- /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 @@ + \ No newline at end of file