Commit 1b58a7cc authored by Tom Henderson's avatar Tom Henderson

build: Upgrade scripts to Python3

parent ebd8c9ef
#! /usr/bin/env python
#! /usr/bin/env python3
import sys
import os.path
......@@ -110,7 +110,7 @@ class PreScanHook:
## classes
if isinstance(pygccxml_definition, class_t):
print >> sys.stderr, pygccxml_definition
print(pygccxml_definition, file=sys.stderr)
# no need for helper classes to allow subclassing in Python, I think...
#if pygccxml_definition.name.endswith('Helper'):
# global_annotations['allow_subclassing'] = 'false'
......@@ -199,7 +199,7 @@ class PreScanHook:
except KeyError:
pass
else:
for key,value in annotations.items():
for key,value in list(annotations.items()):
if key == 'params':
parameter_annotations.update (value)
del annotations['params']
......@@ -273,12 +273,12 @@ def ns3_module_scan(top_builddir, module_name, headers_map, output_file_name, cf
module_parser.parse_finalize()
output_file.close()
os.chmod(output_file_name, 0400)
os.chmod(output_file_name, 0o400)
if __name__ == '__main__':
if len(sys.argv) != 6:
print "ns3modulescan-modular.py top_builddir module_path module_headers output_file_name cflags"
print("ns3modulescan-modular.py top_builddir module_path module_headers output_file_name cflags")
sys.exit(1)
ns3_module_scan(sys.argv[1], sys.argv[2], eval(sys.argv[3]), sys.argv[4], sys.argv[5])
sys.exit(0)
#! /usr/bin/env python
#! /usr/bin/env python3
import sys
import os.path
......
......@@ -377,7 +377,7 @@ class apiscan_task(Task.Task):
up = m.update
up(self.__class__.__name__.encode())
up(self.curdirnode.abspath().encode())
up(self.target)
up(self.target.encode())
self.uid_ = m.digest()
return self.uid_
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
from __future__ import print_function
import sys
from optparse import OptionParser
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2009 University of Washington
......@@ -16,7 +16,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
from __future__ import print_function
import os
import sys
import time
......@@ -595,7 +594,18 @@ def sigint_hook(signal, frame):
# and use that result.
#
def read_waf_config():
for line in open(".lock-waf_" + sys.platform + "_build", "rt"):
f = None
try:
# sys.platform reports linux2 for python2 and linux for python3
f = open(".lock-waf_" + sys.platform + "_build", "rt")
except FileNotFoundError:
try:
f = open(".lock-waf_linux2_build", "rt")
except FileNotFoundError:
print('The .lock-waf ... directory was not found. You must do waf build before running test.py.', file=sys.stderr)
sys.exit(2)
for line in f:
if line.startswith("top_dir ="):
key, val = line.split('=')
top_dir = eval(val.strip())
......@@ -1077,20 +1087,20 @@ def run_tests():
#
if options.kinds or options.list or (len(options.constrain) and options.constrain in core_kinds):
if sys.platform == "win32":
waf_cmd = sys.executable + " waf --target=test-runner"
waf_cmd = "./waf --target=test-runner"
else:
waf_cmd = sys.executable + " waf --target=test-runner"
waf_cmd = "./waf --target=test-runner"
elif len(options.example):
if sys.platform == "win32": #Modify for windows
waf_cmd = sys.executable + " waf --target=%s" % os.path.basename(options.example)
waf_cmd = "./waf --target=%s" % os.path.basename(options.example)
else:
waf_cmd = sys.executable + " waf --target=%s" % os.path.basename(options.example)
waf_cmd = "./waf --target=%s" % os.path.basename(options.example)
else:
if sys.platform == "win32": #Modify for windows
waf_cmd = sys.executable + " waf"
waf_cmd = "./waf"
else:
waf_cmd = sys.executable + " waf"
waf_cmd = "./waf"
if options.verbose:
print("Building: %s" % waf_cmd)
......
#! /usr/bin/env python
#! /usr/bin/env python3
# These methods are used by test.py and waf to look for and read the
# .ns3rc configuration file, which is used to specify the modules that
......
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import subprocess
......
#!/usr/bin/env python
#!/usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import cairo
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2014 Siddharth Santurkar
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2014 Siddharth Santurkar
......
#! /usr/bin/env python
#! /usr/bin/env python3
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2014 Siddharth Santurkar
......
#!/usr/bin/env python
#!/usr/bin/env python3
# encoding: utf-8
#
# partially based on boost.py written by Gernot Vormayr
......
#!/usr/bin/env python
#!/usr/bin/env python3
# encoding: utf-8
# Christoph Koke, 2013
......
#!/usr/bin/env python
#!/usr/bin/env python3
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
......
#! /usr/bin/env python
#! /usr/bin/env python3
# encoding: utf-8
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment