Is this stanza from wsadminlib.py on developerworks helpful?
# Provide access to wsadminlib methods when accessed as an import.
# This is benign if wsadminlib is opened with execfile().
# Supports both connected and disconnected operations.
# (ie, works when wsadmin is connected to a running server,
# and works when wsadmin is not connected to a server.)
try:
AdminConfig = sys._getframe(1).f_locals['AdminConfig']
AdminApp = sys._getframe(1).f_locals['AdminApp']
AdminControl = sys._getframe(1).f_locals['AdminControl']
AdminTask = sys._getframe(1).f_locals['AdminTask']
except:
print "Warning: Caught exception accessing Admin objects. Continuing."