# Defines the following shortcuts: # signal.name -> return the shortname # signal -> display nicely the content of the signal # signal(3) -> recompute the signal at time 3, and display nicely # signal +1 -> increment the signal time of 1, recompute, and display. # signal.deps -> display the graph dependancy up to the default value (3) # signal.deps(6) -> same, but with depth = 6. # entity -> same as print(entity) # change the prompt to be '%' from __future__ import print_function # Changing prompt import sys from .entity import Entity from .signal_base import SignalBase # Enables shortcut "name" def sig_short_name(self): return self.getName().split(':')[-1] setattr(SignalBase, 'name', property(sig_short_name)) # Enables shortcuts "m" # This code implements a pseudo function 'm' in the class signal_base, # with no args, or optional args. Three calls can be made: # - sig.m : print the current value. # - sig.m(time): recompute at given