def _ResetGeneratedClasses(): """Remove the dynamic classes.""" global _generatedClasses for name in _generatedClasses: ApiFunction.clearApi(globals()[name]) del globals()[name] _generatedClasses = [] # Warning: we're passing all of globals() into registerClasses. # This is a) pass by reference, and b) a lot more stuff. types._registerClasses(globals()) # pylint: disable=protected-access
def _InitializeGeneratedClasses(): """Generate classes for extra types that appear in the web API.""" signatures = ApiFunction.allSignatures() # Collect the first part of all function names. names = set([name.split(".")[0] for name in signatures]) # Collect the return types of all functions. returns = set([signatures[sig]["returns"] for sig in signatures]) want = [name for name in names.intersection(returns) if name not in globals()] for name in want: globals()[name] = _MakeClass(name) _generatedClasses.append(name) ApiFunction._bound_signatures.add(name) # pylint: disable=protected-access # Warning: we're passing all of globals() into registerClasses. # This is a) pass by reference, and b) a lot more stuff. types._registerClasses(globals()) # pylint: disable=protected-access
def _InitializeGeneratedClasses(): """Generate classes for extra types that appear in the web API.""" signatures = ApiFunction.allSignatures() # Collect the first part of all function names. names = set([name.split('.')[0] for name in signatures]) # Collect the return types of all functions. returns = set([signatures[sig]['returns'] for sig in signatures]) want = [name for name in names.intersection(returns) if name not in globals()] for name in want: globals()[name] = _MakeClass(name) _generatedClasses.append(name) ApiFunction._bound_signatures.add(name) # pylint: disable=protected-access # Warning: we're passing all of globals() into registerClasses. # This is a) pass by reference, and b) a lot more stuff. types._registerClasses(globals()) # pylint: disable=protected-access
def _InitializeGeneratedClasses(): """Generate classes for extra types that appear in the web API.""" signatures = ApiFunction.allSignatures() # Collect the first part of any function names that contain a '.'. names = set([name.split('.')[0] for name in signatures if '.' in name]) # Collect the return types of all functions. returns = set([signatures[sig]['returns'] for sig in signatures]) # We generate classes for all return types that match algorithms names TYPE.x # excluding those already handled by the client library, and those # explicitly blacklisted. blacklist = ['List'] want = [name for name in names.intersection(returns) if name not in globals() and name not in blacklist] for name in want: globals()[name] = _MakeClass(name) _generatedClasses.append(name) # Warning: we're passing all of globals() into registerClasses. # This is a) pass by reference, and b) a lot more stuff. types._registerClasses(globals()) # pylint: disable=protected-access
def _InitializeGeneratedClasses(): """Generate classes for extra types that appear in the web API.""" signatures = ApiFunction.allSignatures() # Collect the first part of all function names. names = set([name.split('.')[0] for name in signatures]) # Collect the return types of all functions. returns = set([signatures[sig]['returns'] for sig in signatures]) # We generate classes for all return types that match algorithms names TYPE.x # excluding those already handled by the client library, and those # explicitly blacklisted. blacklist = ['List'] want = [name for name in names.intersection(returns) if name not in globals() and name not in blacklist] for name in want: globals()[name] = _MakeClass(name) _generatedClasses.append(name) # Warning: we're passing all of globals() into registerClasses. # This is a) pass by reference, and b) a lot more stuff. types._registerClasses(globals()) # pylint: disable=protected-access