def processCommand(self, cmnd):
    '\n        Examine the action of cmnd and call the appropriate\n        method to deal with this command.  Raises a KeyError\n        if the "action" key is missing.\n        '
    try:
        cmndact = cmnd['action']
    except KeyError:
        raise ValueError(("Unknown command '%s'" % str(cmnd)))
    if (cmndact == 'clear'):
        try:
            bkgcolor = self.__helper.getColorFromCmnd(cmnd)
        except KeyError:
            bkgcolor = None
        self.clearScene(bkgcolor)
    elif (cmndact == 'exit'):
        self.exitViewer()
    elif (cmndact == 'hide'):
        self.showMinimized()
    elif (cmndact == 'screenInfo'):
        scrnrect = QApplication.desktop().availableGeometry()
        info = (self.physicalDpiX(), self.physicalDpiY(), scrnrect.width(), scrnrect.height())
        self.__rspdpipe.send(info)
    elif (cmndact == 'redraw'):
        try:
            bkgcolor = self.__helper.getColorFromCmnd(cmnd)
        except KeyError:
            bkgcolor = None
        self.redrawScene(bkgcolor)
    elif (cmndact == 'rescale'):
        self.scaleScene(float(cmnd['factor']), True)
    elif (cmndact == 'resize'):
        mysize = self.__helper.getSizeFromCmnd(cmnd)
        self.resizeScene(mysize.width(), mysize.height())
    elif (cmndact == 'newImage'):
        self.loadNewSceneImage(cmnd)
    elif (cmndact == 'save'):
        filename = cmnd['filename']
        fileformat = cmnd.get('fileformat', None)
        try:
            bkgcolor = self.__helper.getColorFromCmnd(cmnd)
        except KeyError:
            bkgcolor = None
        rastsize = self.__helper.getSizeFromCmnd(cmnd['rastsize'])
        self.saveSceneToFile(filename, fileformat, bkgcolor, rastsize)
    elif (cmndact == 'setTitle'):
        self.setWindowTitle(cmnd['title'])
    elif (cmndact == 'imgname'):
        myvalue = cmnd.get('name', None)
        if myvalue:
            self.__lastfilename = myvalue
        myvalue = cmnd.get('format', None)
        if myvalue:
            self.__lastformat = myvalue.lower()
    elif (cmndact == 'show'):
        if (not self.isVisible()):
            self.show()
    elif (cmndact == 'noalpha'):
        self.__noalpha = True
    else:
        raise ValueError(('Unknown command action %s' % str(cmndact)))
Examine the action of cmnd and call the appropriate
method to deal with this command.  Raises a KeyError
if the "action" key is missing.
def processCommand(self, cmnd):
    '\n        Examine the action of cmnd and call the appropriate\n        method to deal with this command.  Raises a KeyError\n        if the "action" key is missing.\n        '
    try:
        cmndact = cmnd['action']
    except KeyError:
        raise ValueError(("Unknown command '%s'" % str(cmnd)))
    if (cmndact == 'clear'):
        try:
            bkgcolor = self.__helper.getColorFromCmnd(cmnd)
        except KeyError:
            bkgcolor = None
        self.clearScene(bkgcolor)
    elif (cmndact == 'exit'):
        self.exitViewer()
    elif (cmndact == 'hide'):
        self.showMinimized()
    elif (cmndact == 'screenInfo'):
        scrnrect = QApplication.desktop().availableGeometry()
        info = (self.physicalDpiX(), self.physicalDpiY(), scrnrect.width(), scrnrect.height())
        self.__rspdpipe.send(info)
    elif (cmndact == 'redraw'):
        try:
            bkgcolor = self.__helper.getColorFromCmnd(cmnd)
        except KeyError:
            bkgcolor = None
        self.redrawScene(bkgcolor)
    elif (cmndact == 'rescale'):
        self.scaleScene(float(cmnd['factor']), True)
    elif (cmndact == 'resize'):
        mysize = self.__helper.getSizeFromCmnd(cmnd)
        self.resizeScene(mysize.width(), mysize.height())
    elif (cmndact == 'newImage'):
        self.loadNewSceneImage(cmnd)
    elif (cmndact == 'save'):
        filename = cmnd['filename']
        fileformat = cmnd.get('fileformat', None)
        try:
            bkgcolor = self.__helper.getColorFromCmnd(cmnd)
        except KeyError:
            bkgcolor = None
        rastsize = self.__helper.getSizeFromCmnd(cmnd['rastsize'])
        self.saveSceneToFile(filename, fileformat, bkgcolor, rastsize)
    elif (cmndact == 'setTitle'):
        self.setWindowTitle(cmnd['title'])
    elif (cmndact == 'imgname'):
        myvalue = cmnd.get('name', None)
        if myvalue:
            self.__lastfilename = myvalue
        myvalue = cmnd.get('format', None)
        if myvalue:
            self.__lastformat = myvalue.lower()
    elif (cmndact == 'show'):
        if (not self.isVisible()):
            self.show()
    elif (cmndact == 'noalpha'):
        self.__noalpha = True
    else:
        raise ValueError(('Unknown command action %s' % str(cmndact)))