Добавлены настройки путей к программам для выполнения редактируемых файлов для каждого поддержимаего типа. И использование этих настроек при выполнении файла.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
This commit is contained in:
8
debian/changelog
vendored
8
debian/changelog
vendored
@@ -1,3 +1,10 @@
|
||||
projman (2.1.0-alpha0) stable; urgency=medium
|
||||
|
||||
* Добавил вывод информации о версиях tcl и tk
|
||||
* Добавил вывод номера версии tcl/tl в О Программе
|
||||
|
||||
-- Sergey Kalinin <svkalinin@samsonpost.ru> Mon, 10 Nov 2025 13:13:44 +0300
|
||||
|
||||
projman (2.1.0-alpha0) stable; urgency=medium
|
||||
|
||||
* Незначительные изменения
|
||||
@@ -401,3 +408,4 @@ projman (2.0.0-alfa0) stable; urgency=medium
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -65,6 +65,16 @@ multilineComments=true
|
||||
opened=
|
||||
editedFiles=
|
||||
recentFolder=
|
||||
\[Executor\]
|
||||
TCL=tclsh
|
||||
GO=go
|
||||
PY=python3
|
||||
SH=bash
|
||||
PL=perl
|
||||
RB=ruby
|
||||
HTM=firefox
|
||||
HTML=firefox
|
||||
LUA=lua
|
||||
"
|
||||
proc Config::create {dir} {
|
||||
set cfgFile [open [file join $dir projman.ini] "w+"]
|
||||
|
||||
@@ -1546,6 +1546,8 @@ namespace eval Editor {
|
||||
}
|
||||
set fileType [string toupper [string trimleft [file extension $fileFullPath] "."]]
|
||||
if {$fileType eq ""} {set fileType "Unknown"}
|
||||
|
||||
ExecutorCommandPathSetting $fileType
|
||||
|
||||
ttk::frame $fr.header
|
||||
set lblName "lbl[string range $itemName [expr [string last "." $itemName] +1] end]"
|
||||
|
||||
@@ -873,6 +873,16 @@ proc Execute {filePath w activeEditor} {
|
||||
set pos [$w.frame.text index insert]
|
||||
set lineNum [lindex [split $pos "."] 0]
|
||||
$w.frame.text insert 0.0 "======================================================================================\n"
|
||||
|
||||
# Added executor from config
|
||||
set fileType [string toupper [string trimleft [file extension $filePath] "."]]
|
||||
if {[info exists cfgVariables(fileType)] == 0} {
|
||||
$w.frame.text insert end "$cfgVariables($fileType) "
|
||||
}
|
||||
unset fileType
|
||||
# $w.frame.text insert end [string toupper [string trimleft [file extension $filePath] "."]]
|
||||
# $w.frame.text insert end cfgVariables($fileType)
|
||||
|
||||
$w.frame.text tag add bold $lineNum.0 $lineNum.end
|
||||
Highlight::ExecuteColorized $w.frame.text
|
||||
# focus -force $w.frame.text
|
||||
@@ -979,3 +989,34 @@ proc Settings {} {
|
||||
FileOper::Edit [file join $dir(cfg) projman.ini]
|
||||
# Config::read $dir(cfg)
|
||||
}
|
||||
|
||||
# Определяем пути до программ для запуска исходников
|
||||
proc ExecutorCommandPathSetting {fileType} {
|
||||
global cfgVariables tcl_platform
|
||||
# puts $cfgVariables($fileType)
|
||||
if {[info exists cfgVariables($fileType)] == 1 && $cfgVariables($fileType) ne ""} {
|
||||
if {$tcl_platform(platform) eq "windows"} {
|
||||
set cmd "where $cfgVariables($fileType)"
|
||||
} else {
|
||||
set cmd "which $cfgVariables($fileType)"
|
||||
}
|
||||
puts "ExecutorCommandPathSetting $fileType"
|
||||
puts [catch {exec {*}$cmd} executor_path]
|
||||
puts "executor_path $executor_path"
|
||||
if {[catch {exec {*}$cmd} executor_path]} {
|
||||
puts "Программа $cfgVariables($fileType) для выполнения файлов $fileType не найдена в системе"
|
||||
set cfgVariables($fileType) ""
|
||||
return
|
||||
}
|
||||
set full_path [string trim $executor_path]
|
||||
set first_path [lindex [split $executor_path "\n"] 0]
|
||||
|
||||
# puts "Git найден: $first_path"
|
||||
set cfgVariables($fileType) $first_path
|
||||
puts "first_path $first_path"
|
||||
}
|
||||
if {[info exists cfgVariables($fileType)] == 0} {
|
||||
set cfgVariables($fileType) ""
|
||||
puts $cfgVariables($fileType)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ exec wish9.0 "$0" -- "$@"
|
||||
######################################################
|
||||
# Version: 2.1.0
|
||||
# Release: alpha0
|
||||
# Build: 10112025130218
|
||||
# Build: 10112025132121
|
||||
######################################################
|
||||
|
||||
# определим текущую версию, релиз и т.д.
|
||||
|
||||
Reference in New Issue
Block a user