Added check for optparse module, if not we install the Optik package.
This commit is contained in:
@@ -1,10 +1,28 @@
|
||||
#!/usr/bin/env python
|
||||
# Checks with python if a module is installed
|
||||
import sys
|
||||
try:
|
||||
import dns
|
||||
has = 1
|
||||
except:
|
||||
has = 0
|
||||
|
||||
module = sys.argv[1]
|
||||
|
||||
if module == 'dns':
|
||||
try:
|
||||
import dns
|
||||
has = 1
|
||||
except:
|
||||
has = 0
|
||||
|
||||
|
||||
if module == 'optparse':
|
||||
try:
|
||||
from optparse import OptionParser
|
||||
has = 1
|
||||
except:
|
||||
try:
|
||||
from optik import OptionParser
|
||||
has = 1
|
||||
except:
|
||||
has = 0
|
||||
|
||||
|
||||
if has == 1:
|
||||
sys.exit(0)
|
||||
|
||||
Reference in New Issue
Block a user