diff mbox series

[13/15] scripts/qom-fuse: move to python/qemu/qmp/qom_fuse.py

Message ID 20201021185208.1611145-14-jsnow@redhat.com
State Accepted
Commit 173d185de98c4ee358e5615cedcd8773719586c0
Headers show
Series python: absorb scripts/qmp/qom-* tooling | expand

Commit Message

John Snow Oct. 21, 2020, 6:52 p.m. UTC
Move qom-fuse over to the python package now that it passes the
linter. Update the import paradigms so that it passes.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 scripts/qmp/qom-fuse => python/qemu/qmp/qom_fuse.py | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
 rename scripts/qmp/qom-fuse => python/qemu/qmp/qom_fuse.py (95%)
 mode change 100755 => 100644

Comments

Philippe Mathieu-Daudé Oct. 24, 2020, 7:56 p.m. UTC | #1
On 10/21/20 8:52 PM, John Snow wrote:
> Move qom-fuse over to the python package now that it passes the

> linter. Update the import paradigms so that it passes.

> 

> Signed-off-by: John Snow <jsnow@redhat.com>

> ---

>   scripts/qmp/qom-fuse => python/qemu/qmp/qom_fuse.py | 12 ++----------

>   1 file changed, 2 insertions(+), 10 deletions(-)

>   rename scripts/qmp/qom-fuse => python/qemu/qmp/qom_fuse.py (95%)

>   mode change 100755 => 100644


Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
diff mbox series

Patch

diff --git a/scripts/qmp/qom-fuse b/python/qemu/qmp/qom_fuse.py
old mode 100755
new mode 100644
similarity index 95%
rename from scripts/qmp/qom-fuse
rename to python/qemu/qmp/qom_fuse.py
index 22be366349..b0adcc1f8e
--- a/scripts/qmp/qom-fuse
+++ b/python/qemu/qmp/qom_fuse.py
@@ -1,4 +1,3 @@ 
-#!/usr/bin/env python3
 """
 QEMU Object Model FUSE filesystem tool
 
@@ -36,7 +35,6 @@ 
 
 import argparse
 from errno import ENOENT, EPERM
-import os
 import stat
 import sys
 from typing import (
@@ -51,10 +49,8 @@ 
 import fuse
 from fuse import FUSE, FuseOSError, Operations
 
-
-sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
-from qemu.qmp import QMPResponseError
-from qemu.qmp.qom_common import QOMCommand
+from . import QMPResponseError
+from .qom_common import QOMCommand
 
 
 fuse.fuse_python_api = (0, 2)
@@ -209,7 +205,3 @@  def readdir(self, path: str, fh: IO[bytes]) -> Iterator[str]:
         yield '..'
         for item in self.qom_list(path):
             yield item.name
-
-
-if __name__ == '__main__':
-    sys.exit(QOMFuse.entry_point())