# HG changeset patch # User ymh # Date 1276189019 -7200 # Node ID b3692a42ac798d6752d8efeb5eeb7ded0f4de295 # Parent 346e5edf867511dc1b7df6f9c701148aa01f3feb version + add indent and callback diff -r 346e5edf8675 -r b3692a42ac79 web/eulalie/__init__.py --- a/web/eulalie/__init__.py Thu Jun 10 12:17:51 2010 +0200 +++ b/web/eulalie/__init__.py Thu Jun 10 18:56:59 2010 +0200 @@ -1,4 +1,4 @@ -VERSION = (0,1) +VERSION = (0,2) VERSION_STR = unicode(".".join(map(lambda i:"%02d" % (i,), VERSION))) diff -r 346e5edf8675 -r b3692a42ac79 web/eulalie/config.py.tmpl --- a/web/eulalie/config.py.tmpl Thu Jun 10 12:17:51 2010 +0200 +++ b/web/eulalie/config.py.tmpl Thu Jun 10 18:56:59 2010 +0200 @@ -61,3 +61,4 @@ REGISTRATION_OPEN = False LDT_MAX_SEARCH_NUMBER = 50 +LDT_JSON_DEFAULT_INDENT = 2 diff -r 346e5edf8675 -r b3692a42ac79 web/eulalie/settings.py --- a/web/eulalie/settings.py Thu Jun 10 12:17:51 2010 +0200 +++ b/web/eulalie/settings.py Thu Jun 10 18:56:59 2010 +0200 @@ -126,12 +126,16 @@ "__MACOSX", ) +LDT_JSON_DEFAULT_INDENT +ACCOUNT_ACTIVATION_DAYS = 7 + +LDT_MAX_SEARCH_NUMBER = 50 +LDT_JSON_DEFAULT_INDENT = 2 + + from config import * LOGIN_URL = BASE_URL + 'eulalie/accounts/login/' LOGOUT_URL = BASE_URL + 'eulalie' -ACCOUNT_ACTIVATION_DAYS = 7 - -LDT_MAX_SEARCH_NUMBER = 50 diff -r 346e5edf8675 -r b3692a42ac79 web/ldt/ldt_utils/models.py --- a/web/ldt/ldt_utils/models.py Thu Jun 10 12:17:51 2010 +0200 +++ b/web/ldt/ldt_utils/models.py Thu Jun 10 18:56:59 2010 +0200 @@ -2,7 +2,7 @@ from django.conf import settings from ldt.core.models import Document, Owner from django.utils.translation import ugettext_lazy as _ -from utils import create_ldt, copy_ldt, create_iri +from utils import create_ldt, copy_ldt, create_empty_iri import os import os.path import uuid @@ -50,13 +50,18 @@ def save(self): # create iri file if needed - iri_file_path = self.iri_file_path() - if not os.path.exists(iri_file_path): - dir = os.path.dirname(iri_file_path) - if not os.path.exists(dir): - os.makedirs(dir) - file = open(iri_file_path,"w") - create_iri(file, self, "IRI") + try: + iri_file_path = self.iri_file_path() + if not os.path.exists(iri_file_path): + dir = os.path.dirname(iri_file_path) + if not os.path.exists(dir): + os.makedirs(dir) + file = open(iri_file_path,"w") + create_empty_iri(file, self, "IRI") + except Exception, e: + if os.path.exists(iri_file_path): + os.remove(iri_file_path) + raise e # update it super(Content, self).save() diff -r 346e5edf8675 -r b3692a42ac79 web/ldt/ldt_utils/templates/ldt/ldt_utils/ldt_list.html --- a/web/ldt/ldt_utils/templates/ldt/ldt_utils/ldt_list.html Thu Jun 10 12:17:51 2010 +0200 +++ b/web/ldt/ldt_utils/templates/ldt/ldt_utils/ldt_list.html Thu Jun 10 18:56:59 2010 +0200 @@ -2,8 +2,6 @@ {# list of projects ldt #} {%load i18n %} {% block js_import %}{{ block.super }} -