@@ -50,32 +50,38 @@ def __init__(self):
5050 self ._index_rebuild = _index_rebuild
5151 self ._restore = _restore
5252
53+ # Re-export internal modules for backward compatibility
54+ self .ast = ast
55+ self .errors = errors
56+ self .net = net
57+ self .query = query
58+
5359 net .Connection ._r = self
5460
55- for module in (net , query , ast , errors ):
61+ for module in (self . net , self . query , self . ast , self . errors ):
5662 for function_name in module .__all__ :
5763 setattr (self , function_name , getattr (module , function_name ))
5864
5965 self .set_loop_type (None )
6066
6167 def set_loop_type (self , library = None ):
6268 if library is None :
63- self .connection_type = net .DefaultConnection
69+ self .connection_type = self . net .DefaultConnection
6470 return
6571
6672 # find module file
6773 manager = pkg_resources .ResourceManager ()
68- libPath = "%(library)s_net/net_%(library)s.py" % {"library" : library }
69- if not manager .resource_exists (__name__ , libPath ):
74+ lib_path = "%(library)s_net/net_%(library)s.py" % {"library" : library }
75+ if not manager .resource_exists (__name__ , lib_path ):
7076 raise ValueError ("Unknown loop type: %r" % library )
7177
7278 # load the module
73- modulePath = manager .resource_filename (__name__ , libPath )
74- moduleName = "net_%s" % library
75- moduleFile , pathName , desc = imp .find_module (
76- moduleName , [os .path .dirname (modulePath )]
79+ module_path = manager .resource_filename (__name__ , lib_path )
80+ module_name = "net_%s" % library
81+ module_file , pathName , desc = imp .find_module (
82+ module_name , [os .path .dirname (module_path )]
7783 )
78- module = imp .load_module ("rethinkdb." + moduleName , moduleFile , pathName , desc )
84+ module = imp .load_module ("rethinkdb." + module_name , module_file , pathName , desc )
7985
8086 # set the connection type
8187 self .connection_type = module .Connection
0 commit comments