(cls)
Called once for each user-usable plot mode.
        For Cartesian2D, it is invoked after the
        class definition: Cartesian2D._register()
Called once for each user-usable plot mode.
        For Cartesian2D, it is invoked after the
        class definition: Cartesian2D._register()
Called once for each user - usable plot mode . For Cartesian2D it is invoked after the class definition : Cartesian2D . _register ()
def _register(cls):
        """
        Called once for each user-usable plot mode.
        For Cartesian2D, it is invoked after the
        class definition: Cartesian2D._register()
        """
        name = cls.__name__
        #try:
        cls._init_mode()

        #except Exception as e:
        #    raise RuntimeError( ("Failed to initialize "
        #                      "plot mode %s. Reason: %s")
        #                       % (name, (str(e))) )

        try:
            i, d = cls.i_var_count, cls.d_var_count
            # Add the mode to _mode_map under all
            # given aliases
            for a in cls.aliases:
                if a not in PlotMode._mode_alias_list:
                    # Also track valid aliases, so
                    # we can quickly know when given
                    # an invalid one in _get_mode.
                    PlotMode._mode_alias_list.append(a)
                PlotMode._mode_map[d][i][a] = cls
            if cls.is_default:
                # If this mode was marked as the
                # default for this d,i combination,
                # also set that.
                PlotMode._mode_default_map[d][i] = cls

        except Exception as e:
            raise RuntimeError(("Failed to register "
                              "plot mode %s. Reason: %s")
                               % (name, (str(e))))
def _register ( cls ) : name = cls . __name__ #try: cls . _init_mode ( ) #except Exception as e: #    raise RuntimeError( ("Failed to initialize " #                      "plot mode %s. Reason: %s") #                       % (name, (str(e))) ) try : i , d = cls . i_var_count , cls . d_var_count # Add the mode to _mode_map under all # given aliases for a in cls . aliases : if a not in PlotMode . _mode_alias_list : # Also track valid aliases, so # we can quickly know when given # an invalid one in _get_mode. PlotMode . _mode_alias_list . append ( a ) PlotMode . _mode_map [ d ] [ i ] [ a ] = cls if cls . is_default : # If this mode was marked as the # default for this d,i combination, # also set that. PlotMode . _mode_default_map [ d ] [ i ] = cls except Exception as e : raise RuntimeError ( ( "Failed to register " "plot mode %s. Reason: %s" ) % ( name , ( str ( e ) ) ) )