From: Jan Kiszka <[email protected]> Move the comment when local imports must have happened before the line that prevent them. Also fix the Python syntax in the example boilerplate code.
Signed-off-by: Jan Kiszka <[email protected]> --- Documentation/pyjailhouse.md | 7 +++---- tools/jailhouse-cell-linux | 3 +-- tools/jailhouse-config-create | 3 +-- tools/jailhouse-hardware-check | 3 +-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Documentation/pyjailhouse.md b/Documentation/pyjailhouse.md index 14fcf7dd..7864694d 100644 --- a/Documentation/pyjailhouse.md +++ b/Documentation/pyjailhouse.md @@ -53,8 +53,7 @@ For the example, the following wouldn't work inside of boz.py: **Boilerplate code, with sys.path[0] warning** ` +# Imports from directory containing this must be done before the following sys.path[0] = os.path.dirname(os.path.abspath(__file__)) + "" -from pyjailhouse import -# Imports from directory containing this must be done above -# import statement, see python documentation on sys.path[0] -` \ No newline at end of file +from pyjailhouse import * +` diff --git a/tools/jailhouse-cell-linux b/tools/jailhouse-cell-linux index c3cee125..49babd92 100755 --- a/tools/jailhouse-cell-linux +++ b/tools/jailhouse-cell-linux @@ -17,10 +17,9 @@ import os import struct import sys +# Imports from directory containing this must be done before the following sys.path[0] = os.path.dirname(os.path.abspath(__file__)) + "/.." from pyjailhouse.cell import JailhouseCell -# Imports from directory containing this must be done above -# import statement, see python documentation on sys.path[0] libexecdir = None diff --git a/tools/jailhouse-config-create b/tools/jailhouse-config-create index 297dee2b..6673f46c 100755 --- a/tools/jailhouse-config-create +++ b/tools/jailhouse-config-create @@ -32,10 +32,9 @@ except ImportError: print("This script requires the mako library to run.") sys.exit(1) +# Imports from directory containing this must be done before the following sys.path[0] = os.path.dirname(os.path.abspath(__file__)) + "/.." import pyjailhouse.sysfs_parser as sysfs_parser -# Imports from directory containing this must be done above -# import statement, see python documentation on sys.path[0] datadir = None diff --git a/tools/jailhouse-hardware-check b/tools/jailhouse-hardware-check index d51ea892..51dea82d 100755 --- a/tools/jailhouse-hardware-check +++ b/tools/jailhouse-hardware-check @@ -17,10 +17,9 @@ import os import struct import sys +# Imports from directory containing this must be done before the following sys.path[0] = os.path.dirname(os.path.abspath(__file__)) + "/.." import pyjailhouse.sysfs_parser as sysfs_parser -# Imports from directory containing this must be done above -# import statement, see python documentation on sys.path[0] # just a dummy to make python2 happy if sys.version_info[0] < 3: -- 2.16.4 -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
