[Libreoffice-commits] .: 2 commits - filter/source

Tor Lillqvist tml at kemper.freedesktop.org
Sun Feb 13 16:42:14 PST 2011


 filter/source/config/fragments/makefile.mk      |    2 
 filter/source/config/tools/merge/pyAltFCFGMerge |  342 ++++++++++++------------
 2 files changed, 172 insertions(+), 172 deletions(-)

New commits:
commit 6be83c9a3a5aafdcaf8982ea6a9c25bbd9e07276
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Mon Feb 14 02:39:34 2011 +0200

    Set PYTHONPATH when running own Python on pyAltFCFGMerge

diff --git a/filter/source/config/fragments/makefile.mk b/filter/source/config/fragments/makefile.mk
index c97818b..2acc8fc 100644
--- a/filter/source/config/fragments/makefile.mk
+++ b/filter/source/config/fragments/makefile.mk
@@ -184,7 +184,7 @@ $(ALL_FLAGS) : $(INCLUDE_FRAGMENTS)
 .IF "$(SYSTEM_PYTHON)" == "YES"
 MERGE:=$(PYTHON) ../tools/merge/pyAltFCFGMerge
 .ELSE
-MERGE:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/python ../tools/merge/pyAltFCFGMerge
+MERGE:=$(AUGMENT_LIBRARY_PATH) PYTHONPATH=$(SOLARLIBDIR)/python $(SOLARBINDIR)/python ../tools/merge/pyAltFCFGMerge
 .ENDIF
 .ELSE
 MERGE    := $(JAVAI) $(JAVAIFLAGS) -jar $(SOLARBINDIR)$/FCFGMerge.jar
commit 930d4c3fe686338a5ffb36509f8440174495042b
Author: Tor Lillqvist <tlillqvist at novell.com>
Date:   Mon Feb 14 02:29:21 2011 +0200

    Correct inconsistent use of tabs and spaces

diff --git a/filter/source/config/tools/merge/pyAltFCFGMerge b/filter/source/config/tools/merge/pyAltFCFGMerge
index a44a4bb..0d7666a 100755
--- a/filter/source/config/tools/merge/pyAltFCFGMerge
+++ b/filter/source/config/tools/merge/pyAltFCFGMerge
@@ -51,7 +51,7 @@ Copyright (C) 2002,2004 - Ollie Rutherfurd <oliver at rutherfurd.net>
 
 Based on:
 
-	http://java.sun.com/j2se/1.3/docs/api/java/util/Properties.html
+    http://java.sun.com/j2se/1.3/docs/api/java/util/Properties.html
 
 Missing:
 
@@ -89,190 +89,190 @@ __all__ = ['Properties']
 
 def dec2hex(n):
 
-	h = hex(n)[2:].upper()
-	return '\\u' + '0' * (4 - len(h)) + h
+    h = hex(n)[2:].upper()
+    return '\\u' + '0' * (4 - len(h)) + h
 
 
 def escapestr(s):
 
-	buff = []
-	# QUESTION: escape leading or trailing spaces?
-	for c in s:
-		if c == '\\':
-			buff.append('\\\\')
-		elif c == '\t':
-			buff.append('\\t')
-		elif c == '\n':
-			buff.append('\\n')
-		elif c == '\r':
-			buff.append('\\r')
-		elif c == ' ':
-			buff.append('\\ ')
-		elif c == "'":
-			buff.append("\\'")
-		elif c == '"':
-			buff.append('\\"')
-		elif c == '#':
-			buff.append('\\#')
-		elif c == '!':
-			buff.append('\\!')
-		elif c == '=':
-			buff.append('\\=')
-		elif 32 <= ord(c) <= 126:
-			buff.append(c)
-		else:
-			buff.append(dec2hex(c))
-
-	return ''.join(buff)
+    buff = []
+    # QUESTION: escape leading or trailing spaces?
+    for c in s:
+        if c == '\\':
+            buff.append('\\\\')
+        elif c == '\t':
+            buff.append('\\t')
+        elif c == '\n':
+            buff.append('\\n')
+        elif c == '\r':
+            buff.append('\\r')
+        elif c == ' ':
+            buff.append('\\ ')
+        elif c == "'":
+            buff.append("\\'")
+        elif c == '"':
+            buff.append('\\"')
+        elif c == '#':
+            buff.append('\\#')
+        elif c == '!':
+            buff.append('\\!')
+        elif c == '=':
+            buff.append('\\=')
+        elif 32 <= ord(c) <= 126:
+            buff.append(c)
+        else:
+            buff.append(dec2hex(c))
+
+    return ''.join(buff)
 
 
 # TODO: add support for \uXXXX?
 def unescapestr(line):
 
-	buff = []
-	escape = 0
-	for i in range(len(line)):
-		c = line[i]
-		if c == '\\':
-			if escape:
-				escape = 0
-				buff.append('\\')
-				continue
-			else:
-				# this is to deal with '\'
-				# acting as a line continuation
-				# character
-				if i == len(line) - 1:
-					buff.append('\\')
-					break
-				else:
-					escape = 1
-					continue
-		elif c == 'n':
-			if escape:
-				escape = 0
-				buff.append('\n')
-				continue
-		elif c == 'r':
-			if escape:
-				escape = 0
-				buff.append('\r')
-				continue
-		elif c == 't':
-			if escape:
-				escape = 0
-				buff.append('\t')
-				continue
-
-		buff.append(c)
-
-		# make sure escape doesn't stay one
-		# all expected escape sequences either break
-		# or continue, so this should be safe
-		if escape:
-			escape = 0
-
-	return ''.join(buff)
+    buff = []
+    escape = 0
+    for i in range(len(line)):
+        c = line[i]
+        if c == '\\':
+            if escape:
+                escape = 0
+                buff.append('\\')
+                continue
+            else:
+                # this is to deal with '\'
+                # acting as a line continuation
+                # character
+                if i == len(line) - 1:
+                    buff.append('\\')
+                    break
+                else:
+                    escape = 1
+                    continue
+        elif c == 'n':
+            if escape:
+                escape = 0
+                buff.append('\n')
+                continue
+        elif c == 'r':
+            if escape:
+                escape = 0
+                buff.append('\r')
+                continue
+        elif c == 't':
+            if escape:
+                escape = 0
+                buff.append('\t')
+                continue
+
+        buff.append(c)
+
+        # make sure escape doesn't stay one
+        # all expected escape sequences either break
+        # or continue, so this should be safe
+        if escape:
+            escape = 0
+
+    return ''.join(buff)
 
 
 
 class Properties(dict):
 
-	def __init__(self, defaults={}):
-		dict.__init__(self)
-		for n,v in defaults.items():
-			self[n] = v
-
-	def __getittem__(self,key):
-		try:
-			return dict.__getittem__(self,key)
-		except KeyError:
-			return None
-
-	def read(self,filename):
-		"""
-		Reads properties from a file (java Property class 
-		reads from an input stream -- see load()).
-		"""
-		f = None
-		try:
-			f = open(filename)
-			self.load(f)
-		finally:
-			if f:
-				f.close()
-
-	def load(self, buff):
-		"""
-		Reads properties from a stream (StringIO, file, etc...)
-		"""
-		props = readprops(buff)
-		for n,v in props.iteritems():
-			self[n] = v
+    def __init__(self, defaults={}):
+        dict.__init__(self)
+        for n,v in defaults.items():
+            self[n] = v
+
+    def __getittem__(self,key):
+        try:
+            return dict.__getittem__(self,key)
+        except KeyError:
+            return None
+
+    def read(self,filename):
+        """
+        Reads properties from a file (java Property class 
+        reads from an input stream -- see load()).
+        """
+        f = None
+        try:
+            f = open(filename)
+            self.load(f)
+        finally:
+            if f:
+                f.close()
+
+    def load(self, buff):
+        """
+        Reads properties from a stream (StringIO, file, etc...)
+        """
+        props = readprops(buff)
+        for n,v in props.iteritems():
+            self[n] = v
 
 def readprops(buff):
 
-	name,value = None,''
-	props = {}
-	continued = 0
-
-	while 1:
-		line = buff.readline()
-		if not line:
-			break
-		line = line.strip()
-
-		# empty line
-		if not line:
-			continue
-
-		# comment
-		if line[0] in ('#','!'):
-			continue
-
-		# find name
-		i,escaped = 0,0
-		while i < len(line):
-			c = line[i]
-
-			if c == '\\':
-				if escaped:
-					escaped = 0
-				else:
-					escaped = 1
-				i += 1
-				continue
-
-			elif c in (' ', '\t', ':', '=') and not escaped:
-				name = unescapestr(line[:i])
-				break
-
-			# make sure escaped doesn't stay on
-			if escaped:
-				escaped = 0
-
-			i += 1
-
-		# no dlimiter was found, name is entire line, there is no value
-		if name == None:
-			name = unescapestr(line.lstrip())
-
-		# skip delimiter
-		while line[i:i+1] in ('\t', ' ', ':', '='):
-			i += 1
-
-		value = unescapestr(line[i:].strip())
-		while value[-1:] == '\\':
-			value = value[:-1]	# remove \
-			line = buff.readline()
-			if not line:
-				break
-			value += unescapestr(line.strip())
-
-		#print 'value:',value	##
-		props[name] = value
-
-	return props
+    name,value = None,''
+    props = {}
+    continued = 0
+
+    while 1:
+        line = buff.readline()
+        if not line:
+            break
+        line = line.strip()
+
+        # empty line
+        if not line:
+            continue
+
+        # comment
+        if line[0] in ('#','!'):
+            continue
+
+        # find name
+        i,escaped = 0,0
+        while i < len(line):
+            c = line[i]
+
+            if c == '\\':
+                if escaped:
+                    escaped = 0
+                else:
+                    escaped = 1
+                i += 1
+                continue
+
+            elif c in (' ', '\t', ':', '=') and not escaped:
+                name = unescapestr(line[:i])
+                break
+
+            # make sure escaped doesn't stay on
+            if escaped:
+                escaped = 0
+
+            i += 1
+
+        # no dlimiter was found, name is entire line, there is no value
+        if name == None:
+            name = unescapestr(line.lstrip())
+
+        # skip delimiter
+        while line[i:i+1] in ('\t', ' ', ':', '='):
+            i += 1
+
+        value = unescapestr(line[i:].strip())
+        while value[-1:] == '\\':
+            value = value[:-1]    # remove \
+            line = buff.readline()
+            if not line:
+                break
+            value += unescapestr(line.strip())
+
+        #print 'value:',value    ##
+        props[name] = value
+
+    return props
 #---end java.util.Properties copy---#
 
 #   Its a simple command line tool, which can merge different XML fragments
@@ -341,7 +341,7 @@ def StringTokenizer(mstring, separators, isSepIncluded=0):
 # @author Andreas Schluens
 class ConfigHelper:
     def __init__(self, sPropFile, lCommandLineArgs):
-    	self.m_bEmpty = 1
+        self.m_bEmpty = 1
         # first load prop file, so its values can be overwritten
         # by command line args later
         # Do it only, if a valid file name was given.
@@ -399,7 +399,7 @@ class ConfigHelper:
 
     def getValueWithDefault(self, sProp, default):
         if not self.props.has_key(sProp):
-		return default;
+            return default;
         return self.props[sProp];
 
     def getStringList(self, sProp, sDelimiter, bTrim, bDecode):
@@ -543,7 +543,7 @@ class Merger:
         sBuffer = sBuffer + generateFooter()
 
         # Attention!
-	# If the package seem to be empty, it make no sense to generate a
+        # If the package seem to be empty, it make no sense to generate a
         # corresponding xml file. We should suppress writing of this file on 
         # disk completly ...
         if nItemCount < 1:


More information about the Libreoffice-commits mailing list