2616528
diff -u b/src/python/journalling.py b/src/python/journalling.py
2616528
--- b/src/python/journalling.py
2616528
+++ b/src/python/journalling.py
2616528
@@ -27,7 +27,6 @@
2616528
 import re
2616528
 from optparse import OptionParser
2616528
 from lxml import etree
2616528
-import shlex
2616528
 import base64
2616528
 
2616528
 # TODO fix xml pretty print
2616528
@@ -100,8 +99,8 @@
2616528
     # Count number of leading spaces
2616528
     indent = len(line) - len(line.lstrip())
2616528
 
2616528
-    # using shlex to get rid of the quotes
2616528
-    splitted = shlex.split(line)
2616528
+    # splitting the line into list
2616528
+    splitted = line.split()
2616528
 
2616528
     # if the line is not empty
2616528
     if splitted:
2616528
@@ -118,7 +117,9 @@
2616528
     for part in splitted:
2616528
         # if flag is set, string is an elements content
2616528
         if CONTENT_FLAG == 1:
2616528
-            content = base64.b64decode(part)
2616528
+            # First and last characters(quotes) stripped and
2616528
+            # string is decoded from base64
2616528
+            content = base64.b64decode(part[1:-1])
2616528
             # end parsing after content is stored
2616528
             break
2616528
         # test if string is an elements content indicator
2616528
@@ -128,13 +129,15 @@
2616528
         # test if string is an elements time attribute
2616528
         if re.match(r'^--timestamp=', part):
2616528
             attribute_name = "timestamp"
2616528
-            attribute_value = part.split('=', 1)[1]
2616528
+            # Value is string after '=' sign and without first abd last char(quotes)
2616528
+            attribute_value = part.split('=', 1)[1][1:-1]
2616528
             attributes[attribute_name] = time.strftime(TIME_FORMAT, time.localtime(int(attribute_value)))
2616528
             continue
2616528
         # test if string is an elements regular attribute
2616528
         if re.match(r'^--[a-zA-Z0-9]+=', part):
2616528
             attribute_name = part.split('=', 1)[0][2:]
2616528
-            attribute_value = part.split('=', 1)[1]
2616528
+            # Value is string after '=' sign and without first abd last char(quotes)
2616528
+            attribute_value = part.split('=', 1)[1][1:-1]
2616528
             attributes[attribute_name] = base64.b64decode(attribute_value)
2616528
             continue
2616528
 
2616528
@@ -145,7 +148,11 @@
2616528
 # information given as parameters
2616528
 def createElement(element, attributes, content):
2616528
     element = unicode(element, 'utf-8', errors='replace').translate(xmlTrans)
2616528
-    new_el = etree.Element(element)
2616528
+    try:
2616528
+        new_el = etree.Element(element)
2616528
+    except ValueError, e:
2616528
+        sys.stderr.write('Failed to create element with name %s\nError: %s\nExiting unsuccessfully.\n' % (element, e))
2616528
+        exit(1)
2616528
 
2616528
     content = unicode(content, 'utf-8', errors='replace').translate(xmlTrans)
2616528
     new_el.text = content