# HG changeset patch # User ymh # Date 1443796391 -7200 # Node ID 9b146d9a7f788c399d8cfa8456f855d0dcc871d4 # Parent 03c0a308ccda314f148c6abc63b97d281605b8a7 small script correction + correction on mutable default args diff -r 03c0a308ccda -r 9b146d9a7f78 .hgignore --- a/.hgignore Fri Oct 02 15:52:53 2015 +0200 +++ b/.hgignore Fri Oct 02 16:33:11 2015 +0200 @@ -14,3 +14,4 @@ ^\.pydevproject$ ^\.settings/org\.eclipse\.core\.resources\.prefs$ \.DS_Store$ +^sbin/build/mdplayer_path$ diff -r 03c0a308ccda -r 9b146d9a7f78 sbin/build/compil-mdp-from-sources.sh --- a/sbin/build/compil-mdp-from-sources.sh Fri Oct 02 15:52:53 2015 +0200 +++ b/sbin/build/compil-mdp-from-sources.sh Fri Oct 02 16:33:11 2015 +0200 @@ -1,15 +1,15 @@ +#!/usr/bin/env bash -if [ $# -eq 0 ] - then +set -e + +if [ $# -eq 0 ]; then echo "No argument was provided, looking for mdplayer_path" - if [ ! -f "mdplayer_path" ] - then + if [ ! -f "mdplayer_path" ]; then echo "Error: mdplayer_path file does not exist and no argument was provided" exit 1 fi MDPLAYER_PATH=$(cat mdplayer_path) - if [ -z MDPLAYER_PATH ] - then + if [ -z "$MDPLAYER_PATH" ]; then echo "File is empty" exit 1 fi diff -r 03c0a308ccda -r 9b146d9a7f78 src/ldt/ldt/api/ldt/resources/annotation.py --- a/src/ldt/ldt/api/ldt/resources/annotation.py Fri Oct 02 15:52:53 2015 +0200 +++ b/src/ldt/ldt/api/ldt/resources/annotation.py Fri Oct 02 16:33:11 2015 +0200 @@ -12,7 +12,7 @@ class AnnotationObject(object): - def __init__(self, id="", project="", type="", type_title="", ensemble="", media="", begin=0, end=0, content={"title":"", "description":""}, tags=[], meta={"creator":"", "created":""}): # @ReservedAssignment + def __init__(self, id="", project="", type="", type_title="", ensemble="", media="", begin=0, end=0, content=None, tags=None, meta=None): # @ReservedAssignment self.id = id self.project = project self.type = type @@ -21,9 +21,9 @@ self.media = media self.begin = begin self.end = end - self.content = content - self.tags = tags - self.meta = meta + self.content = content if content is None else {"title":"", "description":""} + self.tags = tags if tags is None else [] + self.meta = meta if meta is None else {"creator":"", "created":""} class AnnotationResource(Resource): # For the moment, these attributes are useless. We just prepare relations to AnnotationObject @@ -315,4 +315,3 @@ def get_resource_uri(self, bundle_or_obj=None, url_name='api_dispatch_list'): return '' -