remove import_rs + update libxml
authorymh <ymh.work@gmail.com>
Sun, 16 Oct 2011 00:02:21 +0200
changeset 204 df7b98820ce1
parent 203 541690472987
child 206 8098939f93c2
remove import_rs + update libxml
src/ldt/ldt/ldt_utils/urls.py
src/ldt/ldt/ldt_utils/views.py
virtualenv/res/lib/lib_create_env.py
virtualenv/res/src/lxml-2.3.1.tar.bz2
virtualenv/res/src/lxml-2.3.tar.bz2
--- a/src/ldt/ldt/ldt_utils/urls.py	Fri Oct 14 15:03:41 2011 +0200
+++ b/src/ldt/ldt/ldt_utils/urls.py	Sun Oct 16 00:02:21 2011 +0200
@@ -8,7 +8,6 @@
 urlpatterns = patterns('ldt.ldt_utils',
     url(r'^searchInit/(?P<field>.*)/(?P<query>.*)$', 'views.search_init'),
     url(r'^searchForm/$', 'views.search_form'),
-    url(r'^import_rs/$', 'views.import_rs'),
     url(r'^published/$', 'views.published_project'),
     url(r'^groups/$', 'views.groups'),
     url(r'^get_group_projects/$', 'views.get_group_projects'),
--- a/src/ldt/ldt/ldt_utils/views.py	Fri Oct 14 15:03:41 2011 +0200
+++ b/src/ldt/ldt/ldt_utils/views.py	Sun Oct 16 00:02:21 2011 +0200
@@ -38,45 +38,7 @@
 import subprocess
 import re
 import datetime
-
-from django.db.backends.postgresql_psycopg2.base import psycopg2
-
     
-def import_rs(request):
-    # Connexion
-    conn = psycopg2.connect(database="test_import_rs", user="admin", password="admin")
-    cur = conn.cursor()
-    # Get all "regarssignes" contents
-    cur.execute("SELECT * from ldt_content")
-    rows = cur.fetchall()
-    s = "Show me the databases:\n"
-    for row in rows:
-        s += "\n   " + str(row)
-        # (id-0, u'iri_id'-1, u'iri_url'-2, u'videopath'-3, datetime creation_date-4, datetime update_date-5, u'title'-6, description-7, eternal_id-8)
-        # (1, u'laurentcantet_entrelesmurs', u'laurentcantet_entrelesmurs/laurentcantet_entrelesmurs.iri', u'rtmp://media.iri.centrepompidou.fr/ddc_player/video/regardssignes/', datetime.datetime(2010, 2, 17, 5, 24, 13, 69794, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=60, name=None)), datetime.datetime(2010, 2, 17, 5, 24, 13, 91656, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=60, name=None)), u'Entre Les Murs', None, None)
-        # Get duration from the iri file
-        prePath = u"/Users/tc/dev/eclipse_workspace/regardssignes_svn/web/static/media/ldt/"
-        doc = lxml.etree.parse(prePath + row[2])
-        res = doc.xpath("/iri/body/medias/media[@id='video']/video")
-        if len(res) > 0:
-            try:
-                dur = int(res[0].get(u'dur', 0) or 0)
-            except:
-                dur = 3600000
-        else:
-            dur = 3600000
-        # Build platform media and platform content from "regarssignes" contents
-        media = Media.objects.create(external_id=row[8], creation_date=row[4], update_date=row[5], videopath=row[3], duration=dur,
-                                     description=row[7], title=row[6], src=(row[1] + u".flv"), mimetype_field="('video/x-flv', None)")
-        media.save()
-        
-        content = Content.objects.create(iri_id=row[1], iriurl=row[2], creation_date=row[4], update_date=row[5], title=row[6], description=row[7],
-                                     content_creation_date=row[4], duration=dur, media_obj=media)
-        content.save()
-    
-    return HttpResponse(s, mimetype="text/plain")
-    
-
 
 @login_required
 def workspace(request):
--- a/virtualenv/res/lib/lib_create_env.py	Fri Oct 14 15:03:41 2011 +0200
+++ b/virtualenv/res/lib/lib_create_env.py	Sun Oct 16 00:02:21 2011 +0200
@@ -45,7 +45,7 @@
         'PSYCOPG2': {'setup': 'psycopg2','url': 'http://www.psycopg.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.tar.gz', 'local':"psycopg2-2.4.tar.gz"},
         'PYLUCENE': {'setup': 'pylucene', 'url': 'http://apache.crihan.fr/dist//lucene/pylucene/pylucene-3.1.0-1-src.tar.gz', 'local':"pylucene-3.1.0-1-src.tar.gz"},
         'PIL': {'setup': 'pil', 'url': 'http://effbot.org/downloads/Imaging-1.1.7.tar.gz', 'local':"Imaging-1.1.7.tar.gz"},
-        'LXML': {'setup': 'lxml', 'url':"lxml-2.3.tar.bz2", 'local':"lxml-2.3.tar.bz2"}
+        'LXML': {'setup': 'lxml', 'url':"lxml-2.3.1.tar.bz2", 'local':"lxml-2.3.1.tar.bz2"}
     })
 
 
Binary file virtualenv/res/src/lxml-2.3.1.tar.bz2 has changed
Binary file virtualenv/res/src/lxml-2.3.tar.bz2 has changed