def __init__(self, modes=None, themes=None, options=None,
                 script_template="codemirror2/codemirror_script.html", *args, **kwargs):
        """
        options: will be json-encoded and passed to ``CodeMirror.fromTextArea``

        modes: list of mode files to load, example: ["xml", "css", "python"].

        themes: list of themes to load, example: ["default", "neat", "elegant", "night"]
        """
        super(CodeMirrorEditor, self).__init__(*args, **kwargs)
        def_options = copy.deepcopy(getattr(settings, "CODEMIRROR_DEFAULT_OPTIONS", {}))
        if options is not None:
            def_options.update(options)
        self.options = def_options
        if modes is None:
            if 'mode' in self.options:
                modes = [self.options['mode']]
            else:
                modes = ["clike", "diff", "htmlmixed", "lua", "sql", "rst", "smalltalk", "xml",
                        "css", "haskell", "javascript", "php", "python", "scheme", "stex", "yaml"]
        self.modes = modes
        if themes is None:
            if 'theme' in self.options:
                themes = [self.options['theme']]
            else:
                themes = ["default"]
        self.themes = themes
        self.script_template = script_template
def __init__ ( self , modes = None , themes = None , options = None , script_template = "codemirror2/codemirror_script.html" , * args , ** kwargs ) : super ( CodeMirrorEditor , self ) . __init__ ( * args , ** kwargs ) def_options = copy . deepcopy ( getattr ( settings , "CODEMIRROR_DEFAULT_OPTIONS" , { } ) ) if options is not None : def_options . update ( options ) self . options = def_options if modes is None : if 'mode' in self . options : modes = [ self . options [ 'mode' ] ] else : modes = [ "clike" , "diff" , "htmlmixed" , "lua" , "sql" , "rst" , "smalltalk" , "xml" , "css" , "haskell" , "javascript" , "php" , "python" , "scheme" , "stex" , "yaml" ] self . modes = modes if themes is None : if 'theme' in self . options : themes = [ self . options [ 'theme' ] ] else : themes = [ "default" ] self . themes = themes self . script_template = script_template
options: will be json-encoded and passed to ``CodeMirror.fromTextArea``

        modes: list of mode files to load, example: ["xml", "css", "python"].

        themes: list of themes to load, example: ["default", "neat", "elegant", "night"]