will be used for rpc library. Signed-off-by: YAMAMOTO Takashi <[email protected]> --- ryu/contrib/__init__.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
diff --git a/ryu/contrib/__init__.py b/ryu/contrib/__init__.py index 7faed78..9540297 100644 --- a/ryu/contrib/__init__.py +++ b/ryu/contrib/__init__.py @@ -1,7 +1,27 @@ +#!/usr/bin/env python +# +# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. +# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp> +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Adjust module loading path for third party libraries + import os import sys +_original_sys_path = list(sys.path) + for path in __path__: if path in sys.path: sys.path.remove(path) @@ -9,3 +29,14 @@ for path in __path__: if path in sys.path: sys.path.remove(path) sys.path.insert(0, path) # prioritize our own copy than system's + +def import_system(module): + """import a system module + """ + saved_path = sys.path + try: + sys.path = _original_sys_path + __import__(module) + finally: + sys.path = saved_path + return sys.modules[module] -- 1.8.0.1 ------------------------------------------------------------------------------ AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial. http://p.sf.net/sfu/alienvault_d2d _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
