changeset 31:0190f49bce88

added change flag
author dwinter
date Thu, 06 Jun 2013 05:55:09 +0200
parents bcd8076ff7ec
children ea7017439ab9
files addDriToIndexMeta.py
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/addDriToIndexMeta.py	Wed Jun 05 17:37:09 2013 +0200
+++ b/addDriToIndexMeta.py	Thu Jun 06 05:55:09 2013 +0200
@@ -21,15 +21,19 @@
     
     
     authors = tree.xpath("/resource/meta/bib/author")
+    
+    changed = False
     for author in authors:
 
         if author.text is not None:
             splitted =author.text.split("\n")
             txt = "; ".join(splitted)
     
-            author.text=txt
+            if txt!=author.text:
+                author.text=txt
+                changed=True
     
-       
+    return changed
     
 def addPURL(fl,purl,test=False):
     try:
@@ -41,7 +45,7 @@
     dris = tree.xpath("/resource/meta/dri[@type='mpiwg']")
     
     
-    correctAuthor(tree)
+    changed = correctAuthor(tree)
     
     
     
@@ -57,7 +61,8 @@
     else:
         dris[0].text=purl
         alreadyExistsFile.write("%s \n"%fl)
-        #return True
+        if not changed: #nothing has to be done
+            return True
 
     print etree.tostring(tree, pretty_print=True)