mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) add a python3 button
Summary: This adds a dropdown to the document settings model in staging/dev to set the python engine to Python2 or Python3. The setting is saved in `_grist_DocInfo.documentSettings.engine`. Test Plan: tested manually for now - separate diff needed to add runsc to jenkins setup and make this testable Reviewers: dsagal, alexmojaki Reviewed By: alexmojaki Differential Revision: https://phab.getgrist.com/D3014
This commit is contained in:
@@ -5,6 +5,7 @@ import * as path from 'path';
|
||||
import { ConnectionOptions } from 'typeorm';
|
||||
import * as uuidv4 from 'uuid/v4';
|
||||
|
||||
import {EngineCode} from 'app/common/DocumentSettings';
|
||||
import * as log from 'app/server/lib/log';
|
||||
import { OpenMode, SQLiteDB } from 'app/server/lib/SQLiteDB';
|
||||
import { getDocSessionAccess, getDocSessionUser, OptDocSession } from './DocSession';
|
||||
@@ -149,3 +150,20 @@ export function getLogMetaFromDocSession(docSession: OptDocSession) {
|
||||
...(client ? client.getLogMeta() : {}), // Client if present will repeat and add to user info.
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Only offer choices of engine on experimental deployments (staging/dev).
|
||||
*/
|
||||
export function getSupportedEngineChoices(): EngineCode[]|undefined {
|
||||
if (process.env.GRIST_EXPERIMENTAL_PLUGINS === '1') {
|
||||
return ['python2', 'python3'];
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a choice of engine is supported.
|
||||
*/
|
||||
export function supportsEngineChoices(): boolean {
|
||||
return getSupportedEngineChoices() !== undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user