diff options
author | elie <elie> | 2015-06-29 21:01:32 +0000 |
---|---|---|
committer | elie <elie> | 2015-06-29 21:01:32 +0000 |
commit | 1c69ba85d01259b72a246ccc9337e2991133b466 (patch) | |
tree | 448d2ca527b4dff4cb1b6b0bd081ce1e5bd4c953 /pysnmp/smi | |
parent | bc0647778478f3f3e481f00cccf4bfa0e8faea6a (diff) | |
download | pysnmp-git-1c69ba85d01259b72a246ccc9337e2991133b466.tar.gz |
provide public attributes even if pysmi not available
Diffstat (limited to 'pysnmp/smi')
-rw-r--r-- | pysnmp/smi/compiler.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/pysnmp/smi/compiler.py b/pysnmp/smi/compiler.py index e8f31dc7..4efb224f 100644 --- a/pysnmp/smi/compiler.py +++ b/pysnmp/smi/compiler.py @@ -5,6 +5,16 @@ import os import sys +defaultSources = [ 'file:///usr/share/snmp/mibs' ] + +if sys.platform[:3] == 'win': + defaultDest = os.path.join(os.path.expanduser("~"), + 'PySNMP Configuration', 'mibs') +else: + defaultDest = os.path.join(os.path.expanduser("~"), '.pysnmp', 'mibs') + +defaultBorrowers = [] + try: from pysmi.reader.url import getReadersFromUrls from pysmi.searcher.pypackage import PyPackageSearcher @@ -26,15 +36,6 @@ except ImportError: raise error.SmiError('MIB compiler not available (pysmi not installed)') else: - defaultSources = [ 'file:///usr/share/snmp/mibs' ] - - if sys.platform[:3] == 'win': - defaultDest = os.path.join(os.path.expanduser("~"), - 'PySNMP Configuration', 'mibs') - else: - defaultDest = os.path.join(os.path.expanduser("~"), '.pysnmp', 'mibs') - - defaultBorrowers = [] def addMibCompiler(mibBuilder, sources=defaultSources, |