1
0
Fork 0
mirror of https://github.com/marty-oehme/scripts.git synced 2024-12-22 16:08:09 +00:00

Small tweaks

This commit is contained in:
Maboroshy 2017-09-16 18:37:25 +04:00 committed by GitHub
parent ba259c6e2f
commit 8d95e5fa81

View file

@ -2,17 +2,22 @@ import QtQml 2.2
import QOwnNotesTypes 1.0 import QOwnNotesTypes 1.0
Script { Script {
function checkPyCommand() {
if (script.startSynchronousProcess('pythonw', '-V', '').toString().indexOf('Python 3') != '-1') {return 'pythonw'}
if (script.startSynchronousProcess('python3', '-V', '').toString().indexOf('Python 3') != '-1') {return 'python3'}
if (script.startSynchronousProcess('python', '-V', '').toString().indexOf('Python 3') != '-1') {return 'python'}
return ''
}
function setDefaultPyCommand() { function setDefaultPyCommand() {
if (script.getPersistentVariable('MdNT/pyCommand', '') == '') { if (script.getPersistentVariable('MdNT/pyCommand', '') == '') {
script.setPersistentVariable('MdNT/pyCommand', checkPyCommand())
if (script.platformIsWindows()) {
var defaultPyCommand = 'pythonw'
}
else {
var defaultPyCommand = 'python3'
}
if (script.startSynchronousProcess(defaultPyCommand, '-V', '').toString().indexOf('Python 3') != '-1') {
script.setPersistentVariable('MdNT/pyCommand', checkPyCommand())
}
} }
return script.getPersistentVariable('MdNT/pyCommand', '') return script.getPersistentVariable('MdNT/pyCommand', '')
} }
@ -38,8 +43,7 @@ Script {
{ {
'identifier': 'inboxFolder', 'identifier': 'inboxFolder',
'name': 'Inbox folder name', 'name': 'Inbox folder name',
'description': 'Name of inbox folder located in the root of note folder. It is single for all note folders.\n' + 'description': 'Name of inbox folder located in the root of note folder. An new inbox folder will be created if no exists.',
'An new inbox folder will be created if no exists.',
'type': 'string', 'type': 'string',
'default': 'Inbox', 'default': 'Inbox',
}, },
@ -47,7 +51,7 @@ Script {
'identifier': 'scanFolder', 'identifier': 'scanFolder',
'name': 'Scan whole folder rather than only Inbox folder', 'name': 'Scan whole folder rather than only Inbox folder',
'description': 'If true the script will convert any non-".md" file in folder to note.\n' + 'description': 'If true the script will convert any non-".md" file in folder to note.\n' +
'"Sub-folder to single note" and modification times in note titles will still be only for Inbox.', '"Sub-folder to single note" and modification times in note titles features will still work only for Inbox.',
'type': 'boolean', 'type': 'boolean',
'default': 'false', 'default': 'false',
}, },