Skip to content

Commit e346cf4

Browse files
committed
Changed all the print statements to print() for Python3 compatibility.
1 parent 2a8aa59 commit e346cf4

21 files changed

+48
-48
lines changed

apps/spreadsheetExporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _export_network_fired(self):
5656
self.active_ntwk,
5757
file_name = file_name,
5858
form = form )
59-
print ('{} --> {}'.format(self.active_ntwk_name,file_name))
59+
print(('{} --> {}'.format(self.active_ntwk_name,file_name)))
6060

6161
def _export_all_networks_fired(self):
6262
form_dict = {
@@ -73,7 +73,7 @@ def _export_all_networks_fired(self):
7373
form = form
7474
)
7575
for k in [ '{} --> {}'.format(k.name,file_name) for k in ns.ntwk_set]:
76-
print k
76+
print(k)
7777

7878

7979
view = View(

doc/gh-pages.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ def init_repo(path):
128128

129129
sh('git add -A %s' % tag)
130130
sh('git commit -m"Updated doc release: %s"' % tag)
131-
print
132-
print 'Most recent 3 commits:'
131+
print()
132+
print('Most recent 3 commits:')
133133
sys.stdout.flush()
134134
sh('git --no-pager log --oneline HEAD~3..')
135135
finally:
136136
cd(startdir)
137137

138-
print
139-
print 'Now verify the build in: %r' % dest
140-
print "If everything looks good, 'git push'"
138+
print()
139+
print('Now verify the build in: %r' % dest)
140+
print("If everything looks good, 'git push'")

doc/sphinxext/apigen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def generate_api_doc(self, uri):
206206
# get the names of all classes and functions
207207
functions, classes = self._parse_module(uri)
208208
if not len(functions) and not len(classes):
209-
print 'WARNING: Empty -',uri # dbg
209+
print('WARNING: Empty -',uri) # dbg
210210
return ''
211211

212212
# Make a shorter version of the uri that omits the package name for

doc/sphinxext/docscrape.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,9 @@ def __init__(self, func, role='func', doc=None):
414414
try:
415415
NumpyDocString.__init__(self, doc)
416416
except ValueError, e:
417-
print '*'*78
418-
print "ERROR: '%s' while parsing `%s`" % (e, self._f)
419-
print '*'*78
417+
print('*'*78)
418+
print("ERROR: '%s' while parsing `%s`" % (e, self._f))
419+
print('*'*78)
420420
#print "Docstring follows:"
421421
#print doclines
422422
#print '='*78
@@ -452,7 +452,7 @@ def __str__(self):
452452

453453
if self._role:
454454
if not roles.has_key(self._role):
455-
print "Warning: invalid role %s" % self._role
455+
print("Warning: invalid role %s" % self._role)
456456
out += '.. %s:: %s\n \n\n' % (roles.get(self._role,''),
457457
func_name)
458458

doc/sphinxext/notebooks_to_rst.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ def find_replace(filename, pattern, replace):
4343

4444

4545
def go(source_dir):
46-
print os.listdir(source_dir)
46+
print(os.listdir(source_dir))
4747
if not os.path.exists(source_dir):
4848
raise ValueError ('source_dir doesnt exist')
4949

50-
print '----- starting NB Evaluation and Conversion'
50+
print('----- starting NB Evaluation and Conversion')
5151
logging.basicConfig(level=logging.DEBUG, format=log_format, datefmt=log_datefmt)
5252
nb_files = recursive_find_by_filter(source_dir, '*.ipynb')
53-
print 'source dir is %s'%source_dir
53+
print('source dir is %s'%source_dir)
5454
for nb_file in nb_files:
55-
print nb_file
55+
print(nb_file)
5656
basename = os.path.basename(nb_file)
5757
notebook_name = basename[:basename.rfind('.')]
5858
build_directory = os.path.dirname(nb_file)

doc/sphinxext/numpydoc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def mangle_docstrings(app, what, name, obj, options, lines,
4949
try:
5050
references.append(int(l[len('.. ['):l.index(']')]))
5151
except ValueError:
52-
print "WARNING: invalid reference in %s docstring" % name
52+
print("WARNING: invalid reference in %s docstring" % name)
5353

5454
# Start renaming from the biggest number, otherwise we may
5555
# overwrite references.
@@ -104,7 +104,7 @@ def monkeypatch_sphinx_ext_autodoc():
104104
if sphinx.ext.autodoc.format_signature is our_format_signature:
105105
return
106106

107-
print "[numpydoc] Monkeypatching sphinx.ext.autodoc ..."
107+
print("[numpydoc] Monkeypatching sphinx.ext.autodoc ...")
108108
_original_format_signature = sphinx.ext.autodoc.format_signature
109109
sphinx.ext.autodoc.format_signature = our_format_signature
110110

doc/sphinxext/phantom_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def setup(app):
2323
def initialize(app):
2424
fn = app.config.phantom_import_file
2525
if (fn and os.path.isfile(fn)):
26-
print "[numpydoc] Phantom importing modules from", fn, "..."
26+
print("[numpydoc] Phantom importing modules from", fn, "...")
2727
import_phantom_module(fn)
2828

2929
#------------------------------------------------------------------------------

doc/sphinxext/tests/test_docscrape.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def test_examples():
165165

166166
def test_index():
167167
assert_equal(doc['index']['default'], 'random')
168-
print doc['index']
168+
print(doc['index'])
169169
assert_equal(len(doc['index']), 2)
170170
assert_equal(len(doc['index']['refguide']), 2)
171171

doc/sphinxext/visa.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ def __init__(self, *args, **kwargs):
88
pass
99

1010
def __getattr__(self,name):
11-
print 'tried to get %s'%name
11+
print('tried to get %s'%name)
1212
return Dummy1()
1313

1414
class Dummy1(object):
1515
def __init__(self, *args, **kwargs):
1616
pass
1717

1818
def __getattr__(self,name):
19-
print 'tried to get %s'%name
19+
print('tried to get %s'%name)
2020
return Dummy2()
2121

2222
def __call__(self, *args, **kwargs):
@@ -27,7 +27,7 @@ def __init__(self, *args, **kwargs):
2727
pass
2828

2929
def __getattr__(self,name):
30-
print 'tried to get %s'%name
30+
print('tried to get %s'%name)
3131
return Dummy3()
3232

3333
def __call__(self, *args, **kwargs):
@@ -38,7 +38,7 @@ def __init__(self, *args, **kwargs):
3838
pass
3939

4040
def __getattr__(self,name):
41-
print 'tried to get %s'%name
41+
print('tried to get %s'%name)
4242
return 1
4343

4444

@@ -50,7 +50,7 @@ def write(self,msg, *args, **kwargs):
5050
'''
5151
dummy doc
5252
'''
53-
print msg
53+
print(msg)
5454
pass
5555

5656

skrf/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
try:
3030
import data
3131
except:
32-
print 'warning: data module didn\'t load. dont worry about it.'
32+
print('warning: data module didn\'t load. dont worry about it.')
3333
pass
3434
# Import contents into current namespace for ease of calling
3535
from frequency import *
@@ -48,7 +48,7 @@
4848
import vi
4949
from vi import *
5050
except(ImportError):
51-
print '\nWARNING: pyvisa not installed, virtual instruments will not be available\n'
51+
print('\nWARNING: pyvisa not installed, virtual instruments will not be available\n')
5252

5353

5454

0 commit comments

Comments
 (0)