mirror of https://gitlab.com/ita1024/waf.git
Code mistakenly removed from the core classes
This commit is contained in:
parent
ab385ea63c
commit
c14f00f4c1
|
@ -1,3 +1,7 @@
|
|||
NEW IN WAF 1.7.4
|
||||
----------------
|
||||
* Fixed a regression in the Node,Task and Context classes
|
||||
|
||||
NEW IN WAF 1.7.3
|
||||
-----------------
|
||||
* Fixed the LD_LIBRARY_PATH race condition in waf_unit_test #1200
|
||||
|
|
|
@ -182,6 +182,15 @@ class Context(ctx):
|
|||
self.exec_dict = {'ctx':self, 'conf':self, 'bld':self, 'opt':self}
|
||||
self.logger = None
|
||||
|
||||
def __hash__(self):
|
||||
"""
|
||||
Return a hash value for storing context objects in dicts or sets. The value is not persistent.
|
||||
|
||||
:return: hash value
|
||||
:rtype: int
|
||||
"""
|
||||
return id(self)
|
||||
|
||||
def load(self, tool_list, *k, **kw):
|
||||
"""
|
||||
Load a Waf tool as a module, and try calling the function named :py:const:`waflib.Context.Context.fun` from it.
|
||||
|
|
|
@ -130,6 +130,10 @@ class Node(object):
|
|||
"String representation (abspath), for debugging purposes"
|
||||
return self.abspath()
|
||||
|
||||
def __hash__(self):
|
||||
"Node hash, used for storage in dicts. This hash is not persistent."
|
||||
return id(self)
|
||||
|
||||
def __eq__(self, node):
|
||||
"Node comparison, based on the IDs"
|
||||
return id(self) == id(node)
|
||||
|
|
|
@ -190,6 +190,10 @@ class TaskBase(evil):
|
|||
return 'executing: %s\n' % self.fun.__name__
|
||||
return self.__class__.__name__ + '\n'
|
||||
|
||||
def __hash__(self):
|
||||
"Very fast hashing scheme but not persistent (replace/implement in subclasses and see :py:meth:`waflib.Task.Task.uid`)"
|
||||
return id(self)
|
||||
|
||||
def exec_command(self, cmd, **kw):
|
||||
"""
|
||||
Wrapper for :py:meth:`waflib.Context.Context.exec_command` which sets a current working directory to ``build.variant_dir``
|
||||
|
|
Loading…
Reference in New Issue