diff --git a/examples/python/dominfo.py b/examples/python/dominfo.py index e41709c51984900995c2f04c7fdedc7e11ed68e2..2f250e73830ea6e3a76a675e58e8f230c75e618f 100755 --- a/examples/python/dominfo.py +++ b/examples/python/dominfo.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/env python # dominfo - print some information about a domain import libvirt diff --git a/examples/python/domrestore.py b/examples/python/domrestore.py index b0321388d9863d041229e1b63960cb11990cf9f4..ccc82f633c5e5527082938dfe16c8e9b3a793d3a 100755 --- a/examples/python/domrestore.py +++ b/examples/python/domrestore.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/env python # domstart - make sure a given domU is running, if not start it import libvirt diff --git a/examples/python/domsave.py b/examples/python/domsave.py index 35e2c8a54307eace47be23a493beac0ff208158a..12ffac191d0c4814ec802c917bc3e45612e88a9c 100755 --- a/examples/python/domsave.py +++ b/examples/python/domsave.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/env python # domstart - make sure a given domU is running, if not start it import libvirt diff --git a/examples/python/domstart.py b/examples/python/domstart.py index 52fb79e8406bc21a5caa006d7113e3def99dcc44..b1e89b8e4306dea9e8ba29e3e184dc4806038246 100755 --- a/examples/python/domstart.py +++ b/examples/python/domstart.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/env python # domstart - make sure a given domU is running, if not start it import libvirt diff --git a/examples/python/esxlist.py b/examples/python/esxlist.py index a0602e89250d8b3371071b0cc31a311ac80b2847..c55424fe1b2ce9a7c9c69e7e603afde4a078c465 100755 --- a/examples/python/esxlist.py +++ b/examples/python/esxlist.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/env python # esxlist - list active domains of an ESX host and print some info. # also demonstrates how to use the libvirt.openAuth() method diff --git a/python/generator.py b/python/generator.py index 68009b947e74720de9b5f8b7412c575db29da035..15751bd16c358166a57c14aa1a03ecfbbb861dff 100755 --- a/python/generator.py +++ b/python/generator.py @@ -1010,7 +1010,7 @@ def buildWrappers(): classes = open("libvirt.py", "w") extra = open(os.path.join(srcPref,"libvirt-override.py"), "r") - classes.write("#!/usr/bin/python -i\n") + classes.write("#!/usr/bin/env python\n") classes.write("#\n") classes.write("# WARNING WARNING WARNING WARNING\n") classes.write("#\n") diff --git a/python/libvirt-override.py b/python/libvirt-override.py index d544a0e64d19cc8b3c27eea2e14f52c5e0705957..909ebe349a7181f0a8cbd582952005f96a29631c 100644 --- a/python/libvirt-override.py +++ b/python/libvirt-override.py @@ -2,6 +2,11 @@ # Manually written part of python bindings for libvirt # +# Specify -i commandline option after python was started +if __name__ == "__main__": + import os + os.environ["PYTHONINSPECT"] = "1" + # On cygwin, the DLL is called cygvirtmod.dll try: import libvirtmod diff --git a/src/esx/esx_vi_generator.py b/src/esx/esx_vi_generator.py index 01636aa6f1f743ffe49b0a0053133888e2a4a1da..459337975b13591db32fa6cc63cbae95ad6aee7f 100755 --- a/src/esx/esx_vi_generator.py +++ b/src/esx/esx_vi_generator.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # # esx_vi_generator.py: generates most of the SOAP type mapping code