def load(filename, mode=None): ''' Modes are - 0 (default): replacing the current layout view - 1: making a new view - 2: adding the layout to the current view (mode 2) ''' # if it's remote, we have to ship the file over first filename = fast_realpath(filename) if is_host_remote(): filename = ship_file(filename) # filename has changed to reflect what it is on the remote system tokens = ['load', filename] if mode is not None: tokens.append(str(mode)) send(' '.join(tokens))
def view(cellname): send('cellview ' + str(cellname))
def kill(): send('kill')
def reload(): send('reload view')
''' Test script with no dependencies on layout packages This should have the same behavior whether interpreted by klayout or python ''' from os.path import join, dirname import sys sys.path.append(join(dirname(__file__), '..', 'python')) import lyipc.client as ipc import time, os print('Sending ping') ipc.send('ping') print('Going to load gds now') gdsname = os.path.realpath('box.gds') ipc.load(gdsname) print('Done')