[CRIU] [PATCH 2/3] p.haul: minor style fixes in htype.py

Nikita Spiridonov nspiridonov at odin.com
Thu Nov 26 04:52:18 PST 2015


Move public htype.py functions to the top of the file.

Signed-off-by: Nikita Spiridonov <nspiridonov at odin.com>
---
 phaul/htype.py |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/phaul/htype.py b/phaul/htype.py
index 77a7e32..e6104b3 100644
--- a/phaul/htype.py
+++ b/phaul/htype.py
@@ -16,21 +16,6 @@ __haul_modules = {
 }
 
 
-def __get(id):
-	hauler_name, haulee_id = id[0], id[1]
-	if hauler_name not in __haul_modules:
-		logging.error("Unknown type. Try one of %s", str(get_haul_names()))
-		return None
-
-	# Import specified haulers module relatively
-	hauler_module_name = ".{0}".format(__haul_modules[hauler_name])
-	hauler_module = importlib.import_module(hauler_module_name, __package__)
-	logging.debug("%s hauler imported from %s", hauler_name,
-		hauler_module.__file__)
-
-	return hauler_module.p_haul_type(haulee_id)
-
-
 def get_haul_names():
 	"""Return list of available haulers"""
 	return __haul_modules.keys()
@@ -46,3 +31,18 @@ def get_dst(id):
 	ht = __get(id)
 	ht.init_dst()
 	return ht
+
+
+def __get(id):
+	hauler_name, haulee_id = id[0], id[1]
+	if hauler_name not in __haul_modules:
+		logging.error("Unknown type. Try one of %s", str(get_haul_names()))
+		return None
+
+	# Import specified haulers module relatively
+	hauler_module_name = ".{0}".format(__haul_modules[hauler_name])
+	hauler_module = importlib.import_module(hauler_module_name, __package__)
+	logging.debug("%s hauler imported from %s", hauler_name,
+		hauler_module.__file__)
+
+	return hauler_module.p_haul_type(haulee_id)
-- 
1.7.1



More information about the CRIU mailing list