mirror of
https://github.com/yusufipk/dikte.git
synced 2026-09-11 10:56:10 +00:00
Merge master: the modules moved into a package
Every file this branch touches moved into dikte/, so the merge is mostly the rename following the edits. What needed a hand: hotkey.py: master replaced the _macos()/_gnome() pair with one backend() chooser, and this branch had added _windows() to the pair. Windows is a fifth value of the chooser now, and everything that used to ask "macOS or Windows?" asks backend() instead. The key is held by the running process there, so installs_shortcuts() and shortcut_needs_restart() are both false for it, and desktop_name() says Windows. install.ps1 and the Windows README name dikte/__main__.py, the entry point the Linux and macOS installers were pointed at in the same commit. The Start Menu entry, the autostart entry and the dikte.cmd shim all come off one $entry variable. settings_ui.py: the shortcut tab now has a Windows sentence of its own, with the Turkish for it. Falling through to the branch master wrote for a desktop with no registry would have told a Windows user to check /dev/input. Nothing covers that branch: there is no Windows Settings test class, the way there is one for macOS. CONTRIBUTING: the chooser it names is backend() now, and the test count is the merged one, 1067 of 1110 running anywhere.
This commit is contained in:
+6
-3
@@ -11,6 +11,9 @@ param(
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$repo = $PSScriptRoot
|
||||
# The one file that starts the application, whoever is asking: the Start Menu
|
||||
# entry, the autostart entry and the dikte command all name it.
|
||||
$entry = Join-Path $repo "dikte\__main__.py"
|
||||
$startMenu = [Environment]::GetFolderPath("Programs")
|
||||
$startup = [Environment]::GetFolderPath("Startup")
|
||||
$shortcut = Join-Path $startMenu "Dikte.lnk"
|
||||
@@ -55,7 +58,7 @@ $shell = New-Object -ComObject WScript.Shell
|
||||
foreach ($path in @($shortcut) + $(if ($Autostart) { @($autostartLink) } else { @() })) {
|
||||
$link = $shell.CreateShortcut($path)
|
||||
$link.TargetPath = $pythonw
|
||||
$link.Arguments = "`"$repo\dikte.py`" --gui"
|
||||
$link.Arguments = "`"$entry`" --gui"
|
||||
$link.WorkingDirectory = $repo
|
||||
$link.Description = "Dikte: dictation"
|
||||
$link.Save()
|
||||
@@ -67,11 +70,11 @@ foreach ($path in @($shortcut) + $(if ($Autostart) { @($autostartLink) } else {
|
||||
# the one the command line should run, whatever a later PATH change puts first.
|
||||
$shimDir = Split-Path $cmdShim
|
||||
if (Test-Path $shimDir) {
|
||||
"@echo off`r`n`"$($python.Source)`" `"$repo\dikte.py`" %*" |
|
||||
"@echo off`r`n`"$($python.Source)`" `"$entry`" %*" |
|
||||
Out-File $cmdShim -Encoding ascii
|
||||
Write-Host "command: dikte ($cmdShim)"
|
||||
} else {
|
||||
Write-Warning "No $shimDir on this machine, so there is no dikte command. Run it as: python `"$repo\dikte.py`""
|
||||
Write-Warning "No $shimDir on this machine, so there is no dikte command. Run it as: python `"$entry`""
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
|
||||
Reference in New Issue
Block a user