def __init__(self, attrs=None):
    params = attrs.copy()
    width = params.pop('width')
    height = params.pop('height')
    toolbars = params.pop('toolbars', 'full')
    imagePath = params.pop('imagePath', '')
    filePath = params.pop('filePath', '')
    upload_settings = params.pop('upload_settings', {})
    settings = params.pop('settings', {})
    command = params.pop('command', None)
    event_handler = params.pop('event_handler', None)
    self.command = command
    self.event_handler = event_handler
    self.upload_settings = upload_settings.copy()
    self.upload_settings.update({'imagePathFormat': imagePath, 'filePathFormat': filePath})
    self._upload_settings = self.upload_settings.copy()
    self.recalc_path(None)
    self.ueditor_settings = {'toolbars': toolbars, 'initialFrameWidth': width, 'initialFrameHeight': height}
    if (toolbars == 'full'):
        del self.ueditor_settings['toolbars']
    elif (isinstance(toolbars, string_types) and (toolbars in USettings.TOOLBARS_SETTINGS)):
        self.ueditor_settings['toolbars'] = USettings.TOOLBARS_SETTINGS[toolbars]
    else:
        self.ueditor_settings['toolbars'] = toolbars
    self.ueditor_settings.update(settings)
    super(UEditorWidget, self).__init__(attrs)
def __init__(self, attrs=None):
    params = attrs.copy()
    width = params.pop('width')
    height = params.pop('height')
    toolbars = params.pop('toolbars', 'full')
    imagePath = params.pop('imagePath', )
    filePath = params.pop('filePath', )
    upload_settings = params.pop('upload_settings', {})
    settings = params.pop('settings', {})
    command = params.pop('command', None)
    event_handler = params.pop('event_handler', None)
    self.command = command
    self.event_handler = event_handler
    self.upload_settings = upload_settings.copy()
    self.upload_settings.update({'imagePathFormat': imagePath, 'filePathFormat': filePath})
    self._upload_settings = self.upload_settings.copy()
    self.recalc_path(None)
    self.ueditor_settings = {'toolbars': toolbars, 'initialFrameWidth': width, 'initialFrameHeight': height}
    if (toolbars == 'full'):
        del self.ueditor_settings['toolbars']
    elif (isinstance(toolbars, string_types) and (toolbars in USettings.TOOLBARS_SETTINGS)):
        self.ueditor_settings['toolbars'] = USettings.TOOLBARS_SETTINGS[toolbars]
    else:
        self.ueditor_settings['toolbars'] = toolbars
    self.ueditor_settings.update(settings)
    super(UEditorWidget, self).__init__(attrs)