def deprecatedWorkerModuleAttribute(scope, attribute, compat_name=None, new_name=None):
 module_name = scope['__name__']
 assert (module_name in sys.modules), 'scope must be module, i.e. locals()'
 assert (sys.modules[module_name].__dict__ is scope), 'scope must be module, i.e. locals()'
 if (new_name is None):
  scope_keys = list(scope.keys())
  scope_values = list(scope.values())
  attribute_name = scope_keys[scope_values.index(attribute)]
 else:
  attribute_name = new_name
 compat_name = _compat_name(attribute_name, compat_name=compat_name)
 scope[compat_name] = attribute
 if attribute_name:
  msg = 'Use {0} instead.'.format(attribute_name)
 else:
  msg = "Don't use it."
 _deprecatedModuleAttribute(Version('Buildbot', 0, 9, 0), (_WORKER_WARNING_MARK + msg), module_name, compat_name)

def deprecatedWorkerModuleAttribute ( scope , attribute , compat_name = None , new_name = None ) : module_name = scope [ '__name__' ] assert ( module_name in sys . modules ) , 'scope must be module, i.e. locals()' assert ( sys . modules [ module_name ] . __dict__ is scope ) , 'scope must be module, i.e. locals()' if ( new_name is None ) : scope_keys = list ( scope . keys ( ) ) scope_values = list ( scope . values ( ) ) attribute_name = scope_keys [ scope_values . index ( attribute ) ] else : attribute_name = new_name compat_name = _compat_name ( attribute_name , compat_name = compat_name ) scope [ compat_name ] = attribute if attribute_name : msg = 'Use {0} instead.' . format ( attribute_name ) else : msg = "Don't use it." _deprecatedModuleAttribute ( Version ( 'Buildbot' , 0 , 9 , 0 ) , ( _WORKER_WARNING_MARK + msg ) , module_name , compat_name )
this is similar to twisteds deprecatedmoduleattribute .