create pickles2-contents-editor object
556593
public function createPickles2ContentsEditor(){
		$px2ce = new \pickles2\libs\contentsEditor\main();

		$px2ce->init(
			array(
				'page_path' => '/px2me-dummy.html', // <- 編集対象ページのパス
				'appMode' => $this->getAppMode(), // 'web' or 'desktop'. default to 'web'
				'entryScript' => $this->entryScript,
				'customFields' => array() ,
				'log' => function($msg){},
				'commands' => @$this->options['commands'],
			)
		);

		return $px2ce;
	}
240191
def save(self):
        
        e = self.editor

        self._style = e.current_style
        self._show_line_numbers = e.show_line_numbers
        self._highlight_search = e.highlight_search
        self._show_ruler = e.show_ruler
        self._relative_number = e.relative_number
        self._cursorcolumn = e.cursorcolumn
        self._cursorline = e.cursorline
        self._colorcolumn = e.colorcolumn
297019
def obj_from_file(filename='annotation.yaml', filetype='auto'):
    '''  '''

    if filetype == 'auto':
        _, ext = os.path.splitext(filename)
        filetype = ext[1:]

    if filetype in ('yaml', 'yml'):
        from ruamel.yaml import YAML
        yaml = YAML(typ="unsafe")
        with open(filename, encoding="utf-8") as f:
            obj = yaml.load(f)
        if obj is None:
            obj = {}
        # import yaml
        # with open(filename, encoding="utf-8") as f:
        #     intext = f.read()
        #     obj = yaml.load(intext)
    elif filetype in ('pickle', 'pkl', 'pklz', 'picklezip'):
        fcontent = read_pkl_and_pklz(filename)
        # import pickle
        if sys.version_info[0] < 3:
            import cPickle as pickle
        else:
            import _pickle as pickle
        # import sPickle as pickle
        if sys.version_info.major == 2:
            obj = pickle.loads(fcontent)
        else:
            obj = pickle.loads(fcontent, encoding="latin1")
    else:
        logger.error('Unknown filetype ' + filetype)
    return obj
1277150
def unpickle(pickle_file):
    """"""
    pickle = None
    with open(pickle_file, "rb") as pickle_f:
        pickle = dill.load(pickle_f)
    if not pickle:
        LOG.error("Could not load python object from file")
    return pickle
1229699
def createEditor(self, parent, option, index):
        """"""
        # bring up separate window for component parameters
        view = parent.parentWidget()
        component = view.model().data(index)

        if component is not None:
            editor = component.showEditor()
        else:
            print 'delegate data type', type(component)
            raise Exception('UnknownDelegateType')

        # connect editor to update defaults
        editor.attributesSaved.connect(view.updateDefaults)
        editor.attributesSaved.connect(view.somethingChanged)

        if component.name == 'Vocalization':
            # find any associated file auto-parameters
            files = view.model().autoParams().findFileParam(component)
            if files is not None:
                editor.selectMany(files)
            editor.vocalFilesChanged.connect(view.updateVocalAuto)

        return editor
595208
function _createEditorWindow (darPath, options = {}) {
  // Create the browser window.
  let editorWindow = new BrowserWindow({ width: 1024, height: 768 })
  let editorConfig = {
    darStorageFolder,
    darPath,
    readOnly: Boolean(options.isNew)
  }
  if (options.folder) {
    Object.assign(editorConfig, {
      unpacked: true
    })
  }
  editorWindow.editorConfig = editorConfig
  editorWindow.sharedStorage = sharedStorage

  let windowId = editorWindow.id
  windowStates.set(windowId, {
    dirty: false
  })
  // and load the index.html of the app.
  let mainUrl = url.format({
    pathname: path.join(__dirname, 'index.html'),
    protocol: 'file:',
    slashes: true
  })
  editorWindow.loadURL(mainUrl)

  // Open the DevTools.
  if (DEBUG) {
    editorWindow.webContents.openDevTools()
  }

  editorWindow.on('close', e => {
    let state = windowStates.get(windowId)
    if (state.dirty) {
      _promptUnsavedChanges(e, editorWindow)
    }
  })

  editorWindow.on('closed', e => {
    windowStates.delete(windowId)
  })
}
368190
function exporter (editorState, options = {}) {
  // Retrieve the content state and its blocks
  const contentState = editorState.getCurrentContent()
  const blocks = contentState.getBlocksAsArray()
  // Convert to an abstract syntax tree
  return processBlocks(blocks, contentState, options)
}
1219700
def open_in_editor
      editor = ENV['CODE_BUDDY_EDITOR'] || ENV['EDITOR']
      case editor
      when 'mate'
        `mate #{path} -l #{line}`
      when /(mvim|emacsclient)/
        `#{$1} +#{line} #{path}`
      when 'netbeans'
        `netbeans #{path}:#{line}`
      else
        puts "Sorry unable to open the file for editing.  Please set your environment variable to either mate or mvim 'export CODE_BUDDY_EDITOR=mate' and restart the server"
      end
    end
1016674
function exporter(editorState) {
  var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

  // Retrieve the content state and its blocks
  var contentState = editorState.getCurrentContent();
  var blocks = contentState.getBlocksAsArray();
  // Convert to an abstract syntax tree
  return (0, _processor2.default)(blocks, contentState, options);
}
460085
def set(self, prefix, url, obj):
        
        if not self.cache_dir:
            return

        filename = self._get_cache_file(prefix, url)

        try:
            os.makedirs(os.path.join(self.cache_dir, prefix))
        except OSError:
            pass

        with open(filename, 'wb') as file:
            pickle.dump(obj, file)
647068
def pickle_load(name, extension='.pkl'):
    
    filename = name + extension
    infile = open(filename, 'rb')
    data = pickle.load(infile)
    infile.close()
    return data
905852
def fix_pickle(self):
        """"""
        from coconut import __coconut__  # this is expensive, so only do it here
        for var in self.vars:
            if not var.startswith("__") and var in dir(__coconut__):
                self.vars[var] = getattr(__coconut__, var)
937056
def from_pickle(cls, filename):
        """"""
        with open(filename, 'rb') as f:
            mesh = pickle.load(f).copy()
        return mesh
569687
def pickledump(theobject, fname):
    """"""
    fhandle = open(fname, 'wb')
    pickle.dump(theobject, fhandle)
431778
def setEditorData( self, editor, index ):
        
        item        = self.parent().itemFromIndex(index)
        value       = item.value()
        tree        = self.parent()
        querywidget = tree.parent()
        factory     = querywidget.factory()
        
        factory.setEditorData(editor, value)
436786
def pickle(self) -> None:
        

        pickle_path = self.tgt_dir / "corpus.p"
        logger.debug("pickling %r object and saving it to path %s", self, pickle_path)
        with pickle_path.open("wb") as f:
            pickle.dump(self, f)
882579
def _get_or_create_editor_buffer(self, location=None, text=None):
        
        assert location is None or text is None  # Don't pass two of them.
        assert location is None or isinstance(location, string_types)

        if location is None:
            # Create and add an empty EditorBuffer
            eb = EditorBuffer(self.editor, text=text)
            self._add_editor_buffer(eb)

            return eb
        else:
            # When a location is given, first look whether the file was already
            # opened.
            eb = self.get_editor_buffer_for_location(location)

            # Not found? Create one.
            if eb is None:
                # Create and add EditorBuffer
                eb = EditorBuffer(self.editor, location)
                self._add_editor_buffer(eb)

                return eb
            else:
                # Found! Return it.
                return eb