← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2249: fixes for recent SCons

 

------------------------------------------------------------
revno: 2249
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-09-30 17:56:52 +0200
message:
  fixes for recent SCons
removed:
  help/util.py
modified:
  build_util.py
  help/SConscript
  help/gen_cshelp.py
  help/gen_toc.py


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'build_util.py'
--- build_util.py	2010-09-21 20:28:03 +0000
+++ build_util.py	2010-09-30 15:56:52 +0000
@@ -75,7 +75,7 @@
 
 	def prepare_build(self, source_path, name, source_glob = '*.cpp', in_bin = True, precompiled_header = None):
 		env = self.env.Clone()
-		env.BuildDir(self.get_build_path(source_path), '.', duplicate = 0)
+		env.VariantDir(self.get_build_path(source_path), '.', duplicate = 0)
 
 		sources = self.get_sources(source_path, source_glob)
 
@@ -187,3 +187,48 @@
 		self.cmd = cmd
 	def __del__(self):
 		self.cmd()
+
+def get_lcid(lang):
+	from locale import windows_locale
+
+	lang = lang.replace('-', '_')
+
+	# look for an exact match
+	for (id, name) in windows_locale.iteritems():
+		if name == lang:
+			return id
+
+	# ignore the "sub-language" part
+	lang = lang.split('_')[0]
+	for (id, name) in windows_locale.iteritems():
+		if name.split('_')[0] == lang:
+			return id
+
+	return 0x409 # default: en-US
+
+def get_win_cp(lcid):
+	import ctypes
+
+	LOCALE_IDEFAULTANSICODEPAGE = 0x1004
+	LOCALE_RETURN_NUMBER = 0x20000000
+
+	buf = ctypes.c_int()
+	ctypes.windll.kernel32.GetLocaleInfoA(lcid, LOCALE_RETURN_NUMBER | LOCALE_IDEFAULTANSICODEPAGE, ctypes.byref(buf), 6)
+
+	if buf.value != 0:
+		return 'cp' + str(buf.value)
+	return 'cp1252'
+
+def html_to_rtf(string):
+	# escape chars: \, {, }
+	# <br/> -> \line + remove surrounding spaces + append a space
+	# remove double new lines + remove new lines at beginning and at end
+	# <b>...</b> -> {\b ...}
+	# <i>...</i> -> {\i ...}
+	# <u>...</u> -> {\ul ...}
+	import re
+	line = r'\\line '
+	return re.sub('<([bi])>', r'{\\\1 ', re.sub('</[biu]>', '}',
+		re.sub('^(' + line + ')', '', re.sub('(' + line + ')$', '',
+		re.sub('(' + line + ')+', line, re.sub('\s*<br ?/?>\s*', line,
+		string.replace('\\', '\\\\').replace('{', '\\{').replace('}', '\\}'))))))).replace('<u>', '{\\ul ')

=== modified file 'help/SConscript'
--- help/SConscript	2010-09-21 20:28:03 +0000
+++ help/SConscript	2010-09-30 15:56:52 +0000
@@ -90,11 +90,10 @@
 # additional dependencies (that have to be built before the help file)
 CHM_dependencies = ['addendum.txt', 'cshelp.h']
 
-from build_util import nixify, gen_po_name, scoped_cmd
+from build_util import gen_po_name, get_lcid, nixify, scoped_cmd
 import filecmp
 from gen_toc import gen_toc
 from set_hhp_locale import set_hhp_locale
-from util import get_lcid
 
 po4a_path = Dir('#/po4a').abspath + '/'
 env['po4a_cmd'] = lambda prog, options: 'perl -I"' + po4a_path + 'lib" "' + po4a_path + prog + '" -f xhtml -o "translated=p<placeholder> p<placeholder><a>" -o "untranslated=<untranslated> <untranslated><a> <untranslated><li>" -o foldattributes -o "includessi=' + nixify(Dir('#/help').abspath) + '/" -M utf-8 -L utf-8 ' + options

=== modified file 'help/gen_cshelp.py'
--- help/gen_cshelp.py	2010-03-11 19:01:52 +0000
+++ help/gen_cshelp.py	2010-09-30 15:56:52 +0000
@@ -6,7 +6,7 @@
 	from HTMLParser import HTMLParser, HTMLParseError
 	from htmlentitydefs import entitydefs
 	import re
-	from util import html_to_rtf
+	from build_util import html_to_rtf
 
 	spaces = re.compile('\s+')
 
@@ -95,7 +95,7 @@
 ''')
 	number = 11000
 	if len(target) >= 2:
-		from util import get_win_cp
+		from build_util import get_win_cp
 		f_rtf = codecs.open(str(target[1]), 'w', 'utf_8')
 	for entry in output:
 		f_h.write('#define ' + entry[0] + ' ' + str(number) + '\r\n')

=== modified file 'help/gen_toc.py'
--- help/gen_toc.py	2009-07-19 22:07:55 +0000
+++ help/gen_toc.py	2010-09-30 15:56:52 +0000
@@ -5,7 +5,7 @@
 	from HTMLParser import HTMLParser
 	from htmlentitydefs import entitydefs
 	import re
-	from util import get_win_cp
+	from build_util import get_win_cp
 
 	spaces = re.compile("\s+")
 

=== removed file 'help/util.py'
--- help/util.py	2010-09-21 20:28:03 +0000
+++ help/util.py	1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
-def get_lcid(lang):
-	from locale import windows_locale
-
-	lang = lang.replace('-', '_')
-
-	# look for an exact match
-	for (id, name) in windows_locale.iteritems():
-		if name == lang:
-			return id
-
-	# ignore the "sub-language" part
-	lang = lang.split('_')[0]
-	for (id, name) in windows_locale.iteritems():
-		if name.split('_')[0] == lang:
-			return id
-
-	return 0x409 # default: en-US
-
-def get_win_cp(lcid):
-	import ctypes
-
-	LOCALE_IDEFAULTANSICODEPAGE = 0x1004
-	LOCALE_RETURN_NUMBER = 0x20000000
-
-	buf = ctypes.c_int()
-	ctypes.windll.kernel32.GetLocaleInfoA(lcid, LOCALE_RETURN_NUMBER | LOCALE_IDEFAULTANSICODEPAGE, ctypes.byref(buf), 6)
-
-	if buf.value != 0:
-		return 'cp' + str(buf.value)
-	return 'cp1252'
-
-def html_to_rtf(string):
-	# escape chars: \, {, }
-	# <br/> -> \line + remove surrounding spaces + append a space
-	# remove double new lines + remove new lines at beginning and at end
-	# <b>...</b> -> {\b ...}
-	# <i>...</i> -> {\i ...}
-	# <u>...</u> -> {\ul ...}
-	import re
-	line = r'\\line '
-	return re.sub('<([bi])>', r'{\\\1 ', re.sub('</[biu]>', '}',
-		re.sub('^(' + line + ')', '', re.sub('(' + line + ')$', '',
-		re.sub('(' + line + ')+', line, re.sub('\s*<br ?/?>\s*', line,
-		string.replace('\\', '\\\\').replace('{', '\\{').replace('}', '\\}'))))))).replace('<u>', '{\\ul ')