Changeset - 022e35e17182
[Not reviewed]
default
3 1 0
drewp - 23 years ago 2002-07-04 08:21:35

bunch of renaming; some additions to the files
4 files changed with 1 insertions and 134 deletions:
0 comments (0 inline, 0 general)
Port.py
Show inline comments
 
from nodetypes import DiscoType
 

	
 
ANY = -1
 

	
 
class Port:
 
    def __setattr__(self, key, value):
 
        '''Alias for __setitem___'''
 
        self[key] = value
 
    def __setitem__(self, key, value):
 
        pass
 
    def __getattr__(self, key):
 
        '''Alias for __getitem___'''
 
        return self[key]
 
    def __getitem__(self, key):
 
        pass
 

	
 
class InputPort(Port):
 
    def __init__(self, allowedtype, required=1, maxpins=ANY):
 
    def __init__(self, required=1, maxpins=ANY):
 
        self.pins = []
 

	
 
class OutputPort(Port):
 
    def __init__(self):
 
        self.pins = []
 

	
 
class Pin:
 
    def __init__(self, connection, value=DiscoType):
 
        pass
 

	
 
'''
 
Snippet Pi=3: RFC 2: New port semantics
 

	
 
# an example of the max node's op
 
def changed(self, inputs):
 
    # note how this function does not use stateaccess, as it doesn't use state
 
    return max(inputs.values())
 

	
 
# so, how the heck does this work?
 
# we check the function to get the names of kw args in the function.
 
# we always pass self, but everything else is optional
 
# the node asked for inputs, which looks like this:
 
# inputs = {'portname' : PortObj, 'portname2', PortObj}
 
# somehow, the PortObjs are max'ible.
nodetype.py
Show inline comments
 
deleted file
op.py
Show inline comments
 
deleted file
port.py
Show inline comments
 
deleted file
0 comments (0 inline, 0 general)