mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-16 02:42:23 +08:00
Fix for issue #491 - added import for print_function, changed all occurences of print to a function
This commit is contained in:
parent
569fd05954
commit
ded17c6cd6
@ -19,12 +19,12 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if len(sys.argv) != 2:
|
if len(sys.argv) != 2:
|
||||||
print """Usage:
|
print( """Usage:
|
||||||
%s [input]""" % sys.argv[0]
|
%s [input]""" % sys.argv[0] )
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
csproj = sys.argv[1]
|
csproj = sys.argv[1]
|
||||||
@ -34,20 +34,20 @@ from xml.dom.minidom import parse
|
|||||||
try:
|
try:
|
||||||
dom = parse(csproj)
|
dom = parse(csproj)
|
||||||
except:
|
except:
|
||||||
print "ERROR: Unable to open CSProj file %s" % csproj
|
print( "ERROR: Unable to open CSProj file %s" % csproj )
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
outputType = dom.getElementsByTagName("OutputType")[0].childNodes[0].data
|
outputType = dom.getElementsByTagName("OutputType")[0].childNodes[0].data
|
||||||
assemblyName = dom.getElementsByTagName("AssemblyName")[0].childNodes[0].data
|
assemblyName = dom.getElementsByTagName("AssemblyName")[0].childNodes[0].data
|
||||||
|
|
||||||
if outputType == "Exe":
|
if outputType == "Exe":
|
||||||
print "define(`GENTARGET', `bin/%s.exe')dnl" % assemblyName
|
print( "define(`GENTARGET', `bin/%s.exe')dnl" % assemblyName )
|
||||||
print "define(`GENOUTPUTTYPE', `exe')dnl"
|
print( "define(`GENOUTPUTTYPE', `exe')dnl" )
|
||||||
elif outputType == "Library":
|
elif outputType == "Library":
|
||||||
print "define(`GENTARGET', `bin/%s.dll')dnl" % assemblyName
|
print( "define(`GENTARGET', `bin/%s.dll')dnl" % assemblyName )
|
||||||
print "define(`GENOUTPUTTYPE', `library')dnl"
|
print( "define(`GENOUTPUTTYPE', `library')dnl" )
|
||||||
else:
|
else:
|
||||||
print "ERROR: Unable to determine output type"
|
print( "ERROR: Unable to determine output type" )
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
sources = [node.getAttribute("Include").replace('\\', '/') for node in
|
sources = [node.getAttribute("Include").replace('\\', '/') for node in
|
||||||
@ -55,5 +55,5 @@ sources = [node.getAttribute("Include").replace('\\', '/') for node in
|
|||||||
assemblies = [node.getAttribute("Include") for node in
|
assemblies = [node.getAttribute("Include") for node in
|
||||||
dom.getElementsByTagName("Reference")]
|
dom.getElementsByTagName("Reference")]
|
||||||
|
|
||||||
print "define(`GENSOURCES', `%s')dnl" % ' '.join(sources)
|
print( "define(`GENSOURCES', `%s')dnl" % ' '.join(sources) )
|
||||||
print "define(`GENREFERENCES', `%s')dnl" % ','.join(assemblies)
|
print( "define(`GENREFERENCES', `%s')dnl" % ','.join(assemblies) )
|
||||||
|
@ -19,12 +19,12 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if len(sys.argv) != 2:
|
if len(sys.argv) != 2:
|
||||||
print """Usage:
|
print( """Usage:
|
||||||
%s [input]""" % sys.argv[0]
|
%s [input]""" % sys.argv[0] )
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
vcxproj = sys.argv[1]
|
vcxproj = sys.argv[1]
|
||||||
@ -34,7 +34,7 @@ from xml.dom.minidom import parse
|
|||||||
try:
|
try:
|
||||||
dom = parse(vcxproj)
|
dom = parse(vcxproj)
|
||||||
except:
|
except:
|
||||||
print "ERROR: Unable to open VCXProj file %s" % vcxproj
|
print( "ERROR: Unable to open VCXProj file %s" % vcxproj )
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
# We need to find out what kind of project/configuration we're going
|
# We need to find out what kind of project/configuration we're going
|
||||||
@ -49,19 +49,19 @@ for group in groups:
|
|||||||
configType = ctnodes[0].childNodes[0].data
|
configType = ctnodes[0].childNodes[0].data
|
||||||
break
|
break
|
||||||
|
|
||||||
print "define(`GENCONFIGTYPE', `%s')dnl" % configType
|
print( "define(`GENCONFIGTYPE', `%s')dnl" % configType )
|
||||||
|
|
||||||
if configType == "StaticLibrary":
|
if configType == "StaticLibrary":
|
||||||
print "define(`GENTARGET', `lib/lib`'GENNAME.a')dnl"
|
print( "define(`GENTARGET', `lib/lib`'GENNAME.a')dnl" )
|
||||||
print "define(`GENOUTDIR', `lib')dnl"
|
print( "define(`GENOUTDIR', `lib')dnl" )
|
||||||
elif configType == "DynamicLibrary":
|
elif configType == "DynamicLibrary":
|
||||||
print "define(`GENTARGET', `lib/lib`'GENNAME.$(DLEXT)')dnl"
|
print( "define(`GENTARGET', `lib/lib`'GENNAME.$(DLEXT)')dnl" )
|
||||||
print "define(`GENOUTDIR', `lib')dnl"
|
print( "define(`GENOUTDIR', `lib')dnl" )
|
||||||
elif configType == "Application":
|
elif configType == "Application":
|
||||||
print "define(`GENTARGET', `bin/'`GENNAME')dnl"
|
print( "define(`GENTARGET', `bin/'`GENNAME')dnl" )
|
||||||
print "define(`GENOUTDIR', `bin')dnl"
|
print( "define(`GENOUTDIR', `bin')dnl" )
|
||||||
else:
|
else:
|
||||||
print "ERROR: Unable to determine configuration type"
|
print( "ERROR: Unable to determine configuration type" )
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
sources = [node.getAttribute("Include").replace('\\', '/') for node in
|
sources = [node.getAttribute("Include").replace('\\', '/') for node in
|
||||||
@ -70,4 +70,4 @@ sources = [node.getAttribute("Include").replace('\\', '/') for node in
|
|||||||
dom.getElementsByTagName("ClInclude")
|
dom.getElementsByTagName("ClInclude")
|
||||||
if not node.getElementsByTagName("ExcludedFromBuild") and node.hasAttribute("Include")]
|
if not node.getElementsByTagName("ExcludedFromBuild") and node.hasAttribute("Include")]
|
||||||
|
|
||||||
print "define(`GENSOURCES', `%s')dnl" % ' '.join(sorted(sources))
|
print( "define(`GENSOURCES', `%s')dnl" % ' '.join(sorted(sources)) )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user