diff options
author | Aleksey Lim <alsroot@member.fsf.org> | 2009-04-16 16:04:08 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2009-04-16 16:04:08 (GMT) |
commit | e1e76c2c3f355f47e93f553aba68f4eb3cc687cb (patch) | |
tree | d21653c149dcdd36dc789255462bb39d95ca7deb | |
parent | 94803ba0a06d53874e96d69ae7f5774b3a3e1f2f (diff) |
Unify binary-blobs search code
-rw-r--r-- | common/Util/CSoundClient.py | 13 | ||||
-rw-r--r-- | common/Util/Clooper/__init__.py | 21 |
2 files changed, 22 insertions, 12 deletions
diff --git a/common/Util/CSoundClient.py b/common/Util/CSoundClient.py index 89e8eff..04db585 100644 --- a/common/Util/CSoundClient.py +++ b/common/Util/CSoundClient.py @@ -7,18 +7,7 @@ import time import array from math import sqrt -# binary blobs rock&roll -try: - from common.Util.Clooper.aclient import * -except: - try: - from common.Util.Clooper.linux32_508.aclient import * - except: - try: - from common.Util.Clooper.linux32_510.aclient import * - except: - from common.Util.Clooper.linux64_510.aclient import * - +from common.Util.Clooper import * import common.Config as Config from common.Generation.GenerationConstants import GenerationConstants diff --git a/common/Util/Clooper/__init__.py b/common/Util/Clooper/__init__.py index e69de29..363fc88 100644 --- a/common/Util/Clooper/__init__.py +++ b/common/Util/Clooper/__init__.py @@ -0,0 +1,21 @@ +import os +import sys +import logging + +_sys_path = sys.path +_root_path = os.path.dirname(__file__) + +for i in os.listdir(_root_path): + path = os.path.join(_root_path, i) + if (os.path.isdir(path)): + sys.path = _sys_path + [os.path.join('.', path)] + try: + from aclient import * + logging.debug('use %s blobs' % path) + _sys_path = None + break + except Exception, e: + logging.debug('skip %s blobs: %s' % (path, e)) + +if _sys_path: + raise('cannot find proper binary blobs') |