more python3, esp. in shebangs and doc
authorparmentelat <thierry.parmentelat@inria.fr>
Mon, 10 Dec 2018 17:34:05 +0000 (18:34 +0100)
committerparmentelat <thierry.parmentelat@inria.fr>
Mon, 10 Dec 2018 17:34:05 +0000 (18:34 +0100)
12 files changed:
PLC/Config.py
PLC/Methods/__init__.py
PLC/Shell.py
PLC/__init__.py
Server.py
aspects/ratelimitaspects.py
doc/DocBook.py
doc/DocBookLocal.py
doc/PLCAPI.xml.in
migrations/extract-views.py
tools/dzombie.py
tools/upgrade-db.py

index 78c1509..690f9e3 100644 (file)
@@ -1,4 +1,3 @@
-#!/usr/bin/python
 #
 # PLCAPI configuration store. Supports XML-based configuration file
 # format exported by MyPLC.
index 27e28b2..1eaed82 100644 (file)
@@ -1,6 +1,3 @@
-#!/usr/bin/python -tt
-
-
 
 import os
 import glob
index 48602f7..4118401 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 #
 # Interactive shell for testing PLCAPI
 #
index 39b6f70..7b7fc41 100644 (file)
@@ -1,4 +1,2 @@
-#!/usr/bin/python -tt
-
 import os
 all = [i[:-3] for i in os.listdir(os.path.dirname(__file__)) if i.endswith(".py") and not i.startswith(".")]
index 7b07264..c0e1f24 100755 (executable)
--- a/Server.py
+++ b/Server.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 #
 # Simple standalone HTTP server for testing PLCAPI
 #
index d2aa40d..a290079 100644 (file)
@@ -1,4 +1,3 @@
-#!/usr/bin/python
 #-*- coding: utf-8 -*-
 #
 # S.Çağlar Onur <caglar@cs.princeton.edu>
index edc42ca..af44f1c 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 #
 # Generates a DocBook section documenting all PLCAPI methods on
 # stdout.
index 2bed21a..4e7f960 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 from PLC.API import PLCAPI
 from PLC.Faults import PLCInvalidAPIMethod
index 02ed262..da18878 100644 (file)
 <programlisting> 
 >>> tagnames=['arch','fcdistro','hrn','hmac','exempt_node_until']
 >>> for tt in GetTagTypes(tagnames,['tagname','category']): 
->>> ... print "tagname=%-18s category=%s"%(tt['tagname'], tt['category'])
+>>> ... print("tagname=%-18s category=%s"%(tt['tagname'], tt['category']))
 tagname=hrn                category=node/sfa
 tagname=hmac               category=slice/auth  
 tagname=exempt_node_until  category=node/myops
@@ -419,24 +419,24 @@ LINE 1: ...M view_nodes WHERE deleted IS False AND (True AND hrn ILIKE ...
 >>> AddNodeGroup('betanodes','deployment','beta')
 22
 ### checking contents (no node has 'deployment' set to either 'alpha' or 'beta' yet)
->>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print ng
+>>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print(ng)
 {'groupname': u'alphanodes', 'node_ids': []}
 {'groupname': u'betanodes', 'node_ids': []}
 
 ### displaying node ids 
->>> for n in GetNodes({'hostname':'*.inria.fr'},['hostname','node_id']): print n
+>>> for n in GetNodes({'hostname':'*.inria.fr'},['hostname','node_id']): print(n)
 {'hostname': u'vnode01.inria.fr', 'node_id': 1}
 {'hostname': u'vnode02.inria.fr', 'node_id': 2}
 
 ### setting 'deployment' for these two nodes
 >>> SetNodeDeployment('vnode01.inria.fr','alpha')
->>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print ng
+>>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print(ng)
 {'groupname': u'alphanodes', 'node_ids': [1]}
 {'groupname': u'betanodes', 'node_ids': []}
 >>> SetNodeDeployment('vnode02.inria.fr','beta')
 
 ### checking contents again
->>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print ng
+>>> for ng in GetNodeGroups(['alphanodes','betanodes'],['groupname','node_ids']): print(ng)
 {'groupname': u'alphanodes', 'node_ids': [1]}
 {'groupname': u'betanodes', 'node_ids': [2]}
 </programlisting>
@@ -503,7 +503,7 @@ Type "system.listMethods()" or "help(method)" for more information.
       the <function>PLC.Shell</function> module:</para>
 
       <programlisting>
-#!/usr/bin/python
+#!/usr/bin/python3
 
 import sys
 
@@ -535,9 +535,9 @@ nodes = plc.GetNodes([121], ['node_id', 'hostname'])
     the name of all the hosts attached to a given slice.</para>
 
 <programlisting>
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
-import xmlrpclib
+import xmlrpc.client
 
 plc_host='www.planet-lab.eu'
 
@@ -550,7 +550,7 @@ auth = { 'AuthMethod' : 'password',
 
 api_url="https://%s:443/PLCAPI/"%plc_host
 
-plc_api = xmlrpclib.ServerProxy(api_url,allow_none=True)
+plc_api = xmlrpc.client.ServerProxy(api_url,allow_none=True)
 
 # the slice's node ids
 node_ids = plc_api.GetSlices(auth,slice_name,['node_ids'])[0]['node_ids']
index 02a7524..8add67c 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import sys
 import re
index d54a555..e42de3a 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 #
 # Tool that removes zombie records from database tables#
 import sys
index 338c55c..18adaad 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 #
 # Tool for upgrading/converting a db
 # Requirements: