def initialize():
    if (Initialize.startInitialization(__name__)):
        return
    
    # initialization code (note: it's all a kluge, could be cleaned up pretty easily)

    # Note: the global declarations are needed due to the kluge above
    # involving globals()[example_command_classname]
    
    classnames = [ ] # extended below

    global ExampleCommand1
    from prototype.test_commands import ExampleCommand1
    classnames.append("ExampleCommand1")

    global ExampleCommand2
    from prototype.test_commands import ExampleCommand2
    classnames.append("ExampleCommand2")

    global test_connectWithState
    from prototype.test_connectWithState import test_connectWithState
    classnames.append("test_connectWithState")

    global ExampleCommand2E
    from prototype.example_expr_command import ExampleCommand2E
    classnames.append("ExampleCommand2E")

    for classname in classnames:
        cmdname = classname # for now
        register_debug_menu_command( cmdname, (lambda widget, classname = classname: enter_example_command(widget, classname)) )
    
    Initialize.endInitialization(__name__)
    return
Exemplo n.º 2
0
def initialize():
    if (Initialize.startInitialization(__name__)):
        return
    
    # initialization code
    global _iconprefix
    _iconprefix = os.path.dirname(os.path.abspath(sys.argv[0]))
    _iconprefix = os.sep.join(_iconprefix.split(os.sep)[:-1] + ["src"])
        # Note: for developers, this is .../cad/src and also contains the
        # toplevel python modules or packages (as of 080111 anyway);
        # within built releases, it may not be the same directory as that
        # even though it ends with "src". [bruce comment 080111]

    if EndUser.getAlternateSourcePath() != None:
        new_iconprefix = EndUser.getAlternateSourcePath()
        print "ALTERNATE_CAD_SRC_PATH: setting _iconprefix to %r rather than %r" % \
              ( new_iconprefix, _iconprefix )
        _iconprefix = new_iconprefix

    Initialize.endInitialization(__name__)
    return
Exemplo n.º 3
0
def initialize():
    # must be called after mainwindow exists
    if (Initialize.startInitialization(__name__)):
        return
    PluginlikeGenerator.register(HeterojunctionGenerator)
    Initialize.endInitialization(__name__)