--- a/.hgtags Wed Jun 13 18:33:28 2012 +0200
+++ b/.hgtags Wed Jun 13 18:34:23 2012 +0200
@@ -1,1 +1,7 @@
3249b8cd0028e14717c95bada3dbe1d4f55c7d28 V00.01
+3249b8cd0028e14717c95bada3dbe1d4f55c7d28 V00.01
+8a0df65c065cb2c72f59d5520485733e1909f28d V00.01
+8a0df65c065cb2c72f59d5520485733e1909f28d V00.01
+74554fcc9cf87c7a24857bc9915e8c3ce836374c V00.01
+357b09ec44ef871e98cc50aa66f2997523671249 V00.02
+d562de7b376fc71032b7ce6bcedb785877f9533c V00.03
--- a/sbin/sync/config.py.tmpl Wed Jun 13 18:33:28 2012 +0200
+++ b/sbin/sync/config.py.tmpl Wed Jun 13 18:34:23 2012 +0200
@@ -27,3 +27,30 @@
"+ core",
]
env.web_relaunch_cmd = "supervisorctl restart platform"
+
+# env variables for config file
+
+env.base_url = "/tralalere/"
+env.web_url = "http://exp.iri.centrepompidou.fr"
+env.stream_url = "rtmp://media.iri.centrepompidou.fr/ddc_player/"
+
+env.stream_src_prefix = ""
+env.ffmpeg_path = ""
+
+env.db_engine = 'django.db.backends.postgresql_psycopg2'
+env.db_name = 'tralalere'
+env.db_user = 'iri'
+env.db_password = ''
+env.db_host = 'sql.iri.centrepompidou.fr'
+env.db_port = 5432
+
+env.log_file = env.remote_web_path + '/log/log.txt'
+env.index_path = env.remote_web_path + '/index/'
+
+env.google_analytics_code = ""
+
+env.email_use_tls = True
+env.email_host = ""
+env.email_host_user = ""
+env.email_host_user = ""
+env.email_port = ""
\ No newline at end of file
--- a/sbin/sync/fabfile.py Wed Jun 13 18:33:28 2012 +0200
+++ b/sbin/sync/fabfile.py Wed Jun 13 18:34:23 2012 +0200
@@ -1,6 +1,7 @@
from fabric.api import task, run, local, env, cd, put, prefix, sudo
from fabric.colors import green
from fabric.contrib.project import rsync_project
+from fabric.contrib.files import exists, upload_template
from mercurial import commands, ui, hg, cmdutil
import imp
import os, os.path
@@ -102,7 +103,37 @@
with prefix("source \"%s\"" % activate_path), prefix("export PYTHONPATH=\"%s\"" % remotepath), cd(remotepath):
run("python manage.py collectstatic --noinput")
-
+def create_config(export_path):
+ print("Create config from %s" % (export_path,))
+ remotepath = env.remote_web_path
+ remote_config_path = os.path.join(remotepath, env.platform_web_module, "config.py")
+ template_path = os.path.join(export_path, "web", env.platform_web_module, "config.py.tmpl")
+
+ context = {
+ 'base_dir': os.path.join(remotepath, env.platform_web_module).rstrip("/")+"/",
+ 'base_url': env.base_url,
+ 'web_url': env.web_url,
+ 'stream_url': env.stream_url,
+ 'stream_src_prefix': env.stream_src_prefix,
+ 'ffmpeg_path': env.ffmpeg_path,
+ 'db_engine': env.db_engine,
+ 'db_name': env.db_name,
+ 'db_user': env.db_user,
+ 'db_password': env.db_password,
+ 'db_host': env.db_host,
+ 'db_port': env.db_port,
+ 'log_file': env.log_file,
+ 'index_path': env.index_path,
+ 'google_analytics_code': env.google_analytics_code,
+ 'email_use_tls': env.email_use_tls,
+ 'email_host': env.email_host,
+ 'email_host_user': env.email_host_user,
+ 'email_host_user': env.email_host_user,
+ 'email_port': env.email_port,
+ }
+
+ if not exists(remote_config_path, verbose=True):
+ upload_template(template_path, remote_config_path, context=context)
def export_version(version):
print("export version %s" % str(version))
@@ -134,6 +165,10 @@
build_src(src_path)
(_,version_str) = get_src_version(src_path)
build_path = os.path.join(src_path,"dist","ldt-%s.tar.gz" % version_str)
+ sync_install_build(build_path)
+
+
+def sync_install_build(build_path):
res_trans = None
try:
res_trans = sync_build(build_path)
@@ -142,6 +177,7 @@
if res_trans:
remove_build(res_trans[0])
+
def do_sync_web(version, export_path):
print("do_sync_web with version %s and path %s" % (version,export_path))
web_path = os.path.join(export_path,"web/")
@@ -156,7 +192,8 @@
def sync_web(version):
print(green("sync web with version %s" % version))
export_path = export_version(version)
- do_sync_web(version, export_path)
+ do_sync_web(version, export_path)
+ create_config(export_path)
clean_export_folder(export_path)
relaunch_server()
@@ -166,8 +203,25 @@
export_path = export_version(version)
do_sync_ldt(version, export_path)
clean_export_folder(export_path)
- relaunch_server()
-
+ relaunch_server()
+
+@task
+def update_ldt(version):
+ print(green("update ldt with version %s" % version))
+ export_path = export_version(version)
+ lib_path = os.path.join(export_path, "virtualenv", "res", "lib")
+
+ f, pathname, description = imp.find_module("patch", [lib_path])
+ patch = imp.load_module("patch", f, pathname, description)
+ f, pathname, description = imp.find_module("lib_create_env", [lib_path])
+ lib_create_env = imp.load_module("lib_create_env", f, pathname, description)
+
+ ldt_path = os.path.join(export_path, "virtualenv", "res", "src", lib_create_env.URLS['LDT']['local'])
+
+ sync_install_build(ldt_path)
+ clean_export_folder(export_path)
+ relaunch_server()
+
@task
def sync_platform(version):
print(green("sync platform with version %s" % version))
--- a/virtualenv/res/lib/lib_create_env.py Wed Jun 13 18:33:28 2012 +0200
+++ b/virtualenv/res/lib/lib_create_env.py Wed Jun 13 18:34:23 2012 +0200
@@ -36,8 +36,7 @@
'SSH': {'setup': 'ssh', 'url':'http://pypi.python.org/packages/source/s/ssh/ssh-1.7.14.tar.gz#md5=4cdd0549ef4699bd67b96264d3b21427', 'local':'ssh-1.7.14.tar.gz'},
'FABRIC': {'setup': 'fabric', 'url':'https://github.com/fabric/fabric/tarball/1.4.2', 'local':'fabric-1.4.2.tar.gz'},
'MERCURIAL': {'setup': 'mercurial', 'url':'http://mercurial.selenic.com/release/mercurial-2.2.2.tar.gz', 'local':'mercurial-2.2.2.tar.gz'},
- 'PYTZ': {'setup':'pytz', 'url':'http://pypi.python.org/packages/source/p/pytz/pytz-2012c.tar.bz2', 'local':'pytz.tar.bz2'},
- 'LDT': {'setup':None, 'url':'ldt-1.10.tar.gz', 'local':'ldt-1.10.tar.gz'},
+ 'LDT': {'setup':None, 'url':'ldt-1.11.tar.gz', 'local':'ldt-1.11.tar.gz'},
}
if system_str == 'Windows':
Binary file virtualenv/res/src/ldt-1.10.tar.gz has changed
Binary file virtualenv/res/src/ldt-1.11.tar.gz has changed
Binary file virtualenv/res/src/pytz.tar.bz2 has changed
--- a/virtualenv/web/res/res_create_env.py Wed Jun 13 18:33:28 2012 +0200
+++ b/virtualenv/web/res/res_create_env.py Wed Jun 13 18:34:23 2012 +0200
@@ -22,7 +22,6 @@
])
INSTALLS.extend([ #(key,method, option_str, dict_extra_env)
- ('PYTZ', 'pip', None, None),
('SOUTH', 'pip', None, None),
('PIL', 'easy_install', None, None),
('DJANGO','pip', None, None),
--- a/web/tralalere/__init__.py Wed Jun 13 18:33:28 2012 +0200
+++ b/web/tralalere/__init__.py Wed Jun 13 18:34:23 2012 +0200
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-VERSION = (0, 1, 0, "final", 0)
+VERSION = (0, 3, 0, "final", 0)
def get_version():
--- a/web/tralalere/config.py.tmpl Wed Jun 13 18:33:28 2012 +0200
+++ b/web/tralalere/config.py.tmpl Wed Jun 13 18:34:23 2012 +0200
@@ -4,17 +4,19 @@
SITE_ID = 1
-BASE_DIR = os.path.dirname(os.path.abspath(__file__)).rstrip("/")+"/"
-BASE_URL = '/~ymh/tralalere/'
-WEB_URL = 'http://localhost'
+#BASE_DIR = os.path.dirname(os.path.abspath(__file__)).rstrip("/")+"/"
+BASE_DIR = '%(base_dir)s'
+BASE_URL = '%(base_url)s'
+WEB_URL = '%(web_url)s'
-STREAM_SRC_PREFIX = ""
+STREAM_SRC_PREFIX = "%(stream_src_prefix)s"
BASE_STATIC_URL = BASE_URL + 'static/'
BASE_STATIC_ROOT = os.path.abspath(BASE_DIR + "../static/").rstrip("/")+"/"
-STREAM_URL = "rtmp://media.iri.centrepompidou.fr/ddc_player/"
+#STREAM_URL = "rtmp://media.iri.centrepompidou.fr/ddc_player/"
+STREAM_URL = '%(stream_url)s'
# Absolute path to the directory that holds media.
@@ -28,7 +30,7 @@
STATIC_ROOT = BASE_STATIC_ROOT + "site/"
# PATH to the ffmpeg executable, used to know automatically the media file duration
-FFMPEG_PATH = ""
+FFMPEG_PATH = "%(ffmpeg_path)s"
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
@@ -45,25 +47,38 @@
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
LDT_MEDIA_PREFIX = STATIC_URL + 'ldt/'
+#DATABASES = {
+# 'default': {
+# 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+# 'NAME': 'tralalere', # Or path to database file if using sqlite3.
+# 'USER': 'iri', # Not used with sqlite3.
+# 'PASSWORD': 'iri', # Not used with sqlite3.
+# 'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3.
+# 'PORT': '5432', # Set to empty string for default. Not used with sqlite3.
+# }
+#}
+
DATABASES = {
'default': {
- 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
- 'NAME': 'tralalere', # Or path to database file if using sqlite3.
- 'USER': 'iri', # Not used with sqlite3.
- 'PASSWORD': 'iri', # Not used with sqlite3.
- 'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3.
- 'PORT': '5432', # Set to empty string for default. Not used with sqlite3.
+ 'ENGINE': '%(db_engine)s', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
+ 'NAME': '%(db_name)s', # Or path to database file if using sqlite3.
+ 'USER': '%(db_user)s', # Not used with sqlite3.
+ 'PASSWORD': '%(db_password)s', # Not used with sqlite3.
+ 'HOST': '%(db_host)s', # Set to empty string for localhost. Not used with sqlite3.
+ 'PORT': '%(db_port)d', # Set to empty string for default. Not used with sqlite3.
}
}
+
DEBUG = True
TEMPLATE_DEBUG = DEBUG
-LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../log/log.txt"))
+#LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../log/log.txt"))
+LOG_FILE = '%(log_file)s'
LOG_LEVEL = logging.DEBUG
-INDEX_PATH = os.path.abspath(BASE_DIR + "../index/")
-
+#INDEX_PATH = os.path.abspath(BASE_DIR + "../index/")
+INDEX_PATH = '%(index_path)s'
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
@@ -71,13 +86,20 @@
MANAGERS = ADMINS
-GOOGLE_ANALYTICS_CODE = 'test'
+GOOGLE_ANALYTICS_CODE = '%(google_analytics_code)s'
-EMAIL_USE_TLS = True
-EMAIL_HOST = 'smtp.gmail.com'
-EMAIL_HOST_USER = 'iri.ddc@gmail.com'
-EMAIL_HOST_PASSWORD = 'ddciripompidou'
-EMAIL_PORT = 587
+#EMAIL_USE_TLS = True
+#EMAIL_HOST = 'smtp.gmail.com'
+#EMAIL_HOST_USER = 'iri.ddc@gmail.com'
+#EMAIL_HOST_PASSWORD = ''
+#EMAIL_PORT = 587
+
+EMAIL_USE_TLS = %(email_use_tls)s
+EMAIL_HOST = '%(email_host)s'
+EMAIL_HOST_USER = '%(email_host_user)s'
+EMAIL_HOST_PASSWORD = '%(email_host_user)s'
+EMAIL_PORT = %(email_port)d
+
ACCOUNT_ACTIVATION_DAYS = 7
REGISTRATION_OPEN = False
--- a/web/tralalere/settings.py Wed Jun 13 18:33:28 2012 +0200
+++ b/web/tralalere/settings.py Wed Jun 13 18:34:23 2012 +0200
@@ -107,9 +107,9 @@
MIDDLEWARE_CLASSES = (
'tralalere.utils.ForceDefaultLanguageMiddleware',
- 'django.middleware.cache.UpdateCacheMiddleware',
+# 'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
- 'django.middleware.cache.FetchFromCacheMiddleware',
+# 'django.middleware.cache.FetchFromCacheMiddleware',
'ldt.ldt_utils.middleware.swfupload.SWFUploadMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',