X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=examples%2Fplanetlab%2Fccn_simple_transfer.py;h=fabbcbc5b2e229b53de4a9a98cfc53dea6f26b30;hb=83880a4c0856307dc617da9e75a49cf64bf78cbf;hp=43f537b2a7cf31759ea49de1a1d750fe81ed41a8;hpb=d50ba1a08e541ded7a8b322493ebb1d0cc59c6ff;p=nepi.git diff --git a/examples/planetlab/ccn_simple_transfer.py b/examples/planetlab/ccn_simple_transfer.py index 43f537b2..fabbcbc5 100644 --- a/examples/planetlab/ccn_simple_transfer.py +++ b/examples/planetlab/ccn_simple_transfer.py @@ -3,9 +3,8 @@ # Copyright (C) 2014 INRIA # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation; # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -32,6 +31,8 @@ # 0 ------- network -------- 1 # +from __future__ import print_function + from nepi.execution.ec import ExperimentController from optparse import OptionParser, SUPPRESS_HELP @@ -159,11 +160,10 @@ ec.deploy() ec.wait_finished([ccncat]) stdout = ec.trace(ccncat, "stdout") -f = open("video.ts", "w") -f.write(stdout) -f.close() +with open("video.ts", "w") as f: + f.write(stdout) ec.shutdown() -print "Transfered FILE stored localy at video.ts" +print("Transfered FILE stored localy at video.ts")