aboutsummaryrefslogtreecommitdiff
path: root/whatmaps/command.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-04-22 13:18:40 +0200
committerGuido Günther <agx@sigxcpu.org>2014-04-22 13:35:00 +0200
commitc62b6858897306d25ac6018bc11d6abb39733bac (patch)
tree84ff7e894c395db9cdbd74d20cc0db0cfa0c5374 /whatmaps/command.py
parent5bbc7bf44383d6f924551465c29eff44828b788c (diff)
Use print as function
to make python3 happy
Diffstat (limited to 'whatmaps/command.py')
-rwxr-xr-xwhatmaps/command.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/whatmaps/command.py b/whatmaps/command.py
index 14e56b7..3e8773b 100755
--- a/whatmaps/command.py
+++ b/whatmaps/command.py
@@ -16,6 +16,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+from __future__ import print_function
+
import glob
import os
import logging
@@ -97,10 +99,10 @@ def detect_distro():
def write_cmd_file(services, cmd_file, distro):
"Write out commands needed to restart the services to a file"
out = open(cmd_file, 'w')
- print >>out, '#! /bin/sh'
+ print('#! /bin/sh', file=out)
for service in services:
logging.debug("Need to restart %s", service)
- print >>out, " ".join(distro.restart_service_cmd(service))
+ print(" ".join(distro.restart_service_cmd(service)), file=out)
out.close()
os.chmod(cmd_file, 0755)
@@ -218,9 +220,9 @@ def main(argv):
logging.info("Restarting %s" % service)
distro.restart_service(service)
elif all_services:
- print "Services that possibly need to be restarted:"
+ print("Services that possibly need to be restarted:")
for s in all_services:
- print s
+ print(s)
return 0