This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
118 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# pylint: disable=import-error,ungrouped-imports | ||
|
||
import sys | ||
|
||
from utils import is_installed, parse_qt_dependency | ||
|
||
if __name__ == "__main__": | ||
dep = parse_qt_dependency() | ||
if dep == "PySide6": | ||
from PySide6.scripts.pyside_tool import linguist | ||
|
||
elif is_installed("PySide6"): | ||
from PySide6.scripts.pyside_tool import linguist | ||
else: | ||
sys.exit("No Qt Linguist can be found in current Python environment.") | ||
|
||
sys.exit(linguist()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# pylint: disable=import-error | ||
# pylint: disable=import-error,ungrouped-imports | ||
|
||
import sys | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import pytest | ||
|
||
from scripts.utils import SupportedQtDependencies | ||
from tests import filter_available_qt_dependencies, invoke_script | ||
|
||
|
||
@pytest.mark.skip(reason="a GUI app cannot be closed gracefully") | ||
@pytest.mark.parametrize( | ||
"qt_dependency", | ||
filter_available_qt_dependencies(["PySide6"]), | ||
) | ||
def test_qml_help(qt_dependency: SupportedQtDependencies): | ||
result = invoke_script("linguist", [], qt_dependency) | ||
assert result.returncode == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { firstValueFrom } from 'rxjs' | ||
import type { CommandDeps } from '../commands' | ||
import { getTargetDocumentUri } from '../commands' | ||
import { run } from '../run' | ||
import { getToolCommand$ } from '../tool-utils' | ||
|
||
export async function editTranslations( | ||
{ extensionUri }: CommandDeps, | ||
...args: any[] | ||
) { | ||
const targetDocumentUriResult = getTargetDocumentUri(...args) | ||
|
||
if (targetDocumentUriResult.kind !== 'Success') return targetDocumentUriResult | ||
|
||
const translationFile = targetDocumentUriResult.value | ||
|
||
const getToolCommandResult = await firstValueFrom( | ||
getToolCommand$({ | ||
tool: 'linguist', | ||
extensionUri, | ||
resource: translationFile, | ||
}), | ||
) | ||
|
||
if (getToolCommandResult.kind !== 'Success') return getToolCommandResult | ||
|
||
return run({ | ||
command: [ | ||
...getToolCommandResult.value.command, | ||
...getToolCommandResult.value.options, | ||
translationFile.fsPath, | ||
], | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters