def _get_window_registry(window):
 if (window is None):
  raise TypeError('window is None with scope window!')
 try:
  if (window == 'current'):
   app = get('app')
   win = app.activeWindow()
  elif (window == 'last-focused'):
   win = last_focused_window()
  else:
   win = window_registry[window]
 except (KeyError, NoWindow):
  win = None
 try:
  return win.registry
 except AttributeError:
  raise RegistryUnavailableError('window')

def _get_window_registry ( window ) : if ( window is None ) : raise TypeError ( 'window is None with scope window!' ) try : if ( window == 'current' ) : app = get ( 'app' ) win = app . activeWindow ( ) elif ( window == 'last-focused' ) : win = last_focused_window ( ) else : win = window_registry [ window ] except ( KeyError , NoWindow ) : win = None try : return win . registry except AttributeError : raise RegistryUnavailableError ( 'window' )
get the registry of a window .