<s> from . Buffer import Buffer <EOL> from . Motions import Motions <EOL> from . Cursor import Cursor <EOL> from . Search import Search <EOL> from . view . Window import Window , WindowLines <EOL> from . Logger import debug <EOL> import curses <EOL> class Port : <EOL> def dimensions ( self ) : <EOL> return self . screen . getmaxyx ( ) <EOL> def height ( self ) : <EOL> return self . dimensions ( ) [ <NUM_LIT:0> ] <EOL> def width ( self ) : <EOL> return self . dimensions ( ) [ <NUM_LIT:1> ] <EOL> def clear ( self ) : <EOL> self . screen . clear ( ) <EOL> def draw ( self , string ) : <EOL> self . screen . clear ( ) <EOL> self . screen . addstr ( string [ : - <NUM_LIT:1> ] ) <EOL> self . screen . refresh ( ) <EOL> def move ( self , y , x ) : <EOL> self . screen . move ( y - <NUM_LIT:1> , x - <NUM_LIT:1> ) <EOL> self . screen . refresh ( ) <EOL> class WindowManager : <EOL> def currentWindow ( self ) : <EOL> return self . window <EOL> def commandLineWindow ( self ) : <EOL> return self . commandLine <EOL> def createPort ( self , parentScreen ) : <EOL> height , width = parentScreen . getmaxyx ( ) <EOL> layout = ( height - <NUM_LIT:1> , width , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> port = Port ( ) <EOL> port . screen = curses . newwin ( * layout ) <EOL> return port <EOL> def createCommandPort ( self , parentScreen ) : <EOL> height , width = parentScreen . getmaxyx ( ) <EOL> y = height - <NUM_LIT:1> <EOL> layout = ( <NUM_LIT:1> , width , y , <NUM_LIT:0> ) <EOL> port = Port ( ) <EOL> port . screen = curses . newwin ( * layout ) <EOL> return port <EOL> def createWindow ( self , port ) : <EOL> """<STR_LIT>""" <EOL> """<STR_LIT>""" <EOL> """<STR_LIT>""" <EOL> cursor = Cursor ( ) <EOL> buffer = Buffer ( ) <EOL> motions = Motions ( ) <EOL> window = Window ( ) <EOL> window . port = port <EOL> window . lines = WindowLines ( ) <EOL> cursor . buffer = buffer <EOL> cursor . motions = motions <EOL> motions . buffer = buffer <EOL> motions . cursor = cursor <EOL> motions . search = Search ( ) <EOL> motions . search . buffer = buffer <EOL> window . cursor = cursor <EOL> window . buffer = buffer <EOL> window . motions = motions <EOL> return window </s>
