fix GetOsp...()

Change-Id: Ib88f893ca9ff75153f5baf07edcb15c3d57fbe41
This commit is contained in:
Stefan Liebl 2015-03-25 16:28:50 +01:00
parent 0386b90ac5
commit e2ec08ef7c
7 changed files with 38 additions and 66 deletions

View File

@ -227,6 +227,7 @@ function s:GetPolynom(umrechnung)
if XmlTag['Attributes']['Value'] == a:umrechnung
let elements = XmlTag['Elements']
for element in elements
if type(element) == 4
let name = element['Name']
if name == 'Mas'
let umr['Mas'] = element['Elements'][0]
@ -238,6 +239,8 @@ function s:GetPolynom(umrechnung)
echoerr 'Unknown attribute' name
endif
endif
endif
unlet element
endfor
else
echoerr 'Error: Wrong conversion' XmlTag['Attributes']['n']

View File

@ -56,7 +56,7 @@ syntax keyword kgsKomponents unwirksamkeitswert
syntax keyword kgsKomponents deutsch
syntax keyword kgsDeprecated min_w min_x min_y max_w max_x max_y init_wert test_wert
syntax keyword kgsDeprecated test_stuetzstellen_x test_stuetzstellen_y
syntax keyword kgsDeprecated kopfdaten_applizierbar unwirksamkeitswert
syntax keyword kgsDeprecated kopfdaten_applizierbar
highlight def link kgsFunctions Function

View File

@ -68,7 +68,7 @@ endfunction
"command -nargs=1 PathNormpath call PathNormpath('<fargs>')
"function PathNormpath(string)
" if (v:version > 602)
" if has('python')
" try
"python <<EOF
"import vim
@ -107,7 +107,7 @@ function Double_quote(text)
endfunction
function Eval(expression)
if (v:version > 602)
if has('python')
try
python <<EOF
import vim
@ -120,14 +120,13 @@ EOF
let result = a:expression
endtry
else
echoerr 'Eval needs python'
let result = a:expression
let result = eval(a:expression)
endif
return result
endfunction
function ToInt(expression)
if (v:version > 602)
if has('python')
try
let expression = substitute(a:expression, '\.\d\+', '', '')
python <<EOF
@ -141,14 +140,13 @@ EOF
let result = a:expression
endtry
else
echoerr 'ToInt needs python'
let result = a:expression
let result = float2nr(a:expression)
endif
return result
endfunction
function ToHex(expression, bits)
if (v:version > 602)
if has('python')
try
let expression = substitute(a:expression, 'L', '', '')
python <<EOF
@ -157,18 +155,17 @@ result = hex(long(int(vim.eval('expression'))))
#print 'result: ', result
vim.command('let result = \"' + result + '\"')
EOF
if (a:bits != 0)
let digits = a:bits / 4
let result = substitute(result, '\(0x\)\x*\(\x\{' . digits . '}\>\)', '\1\2', '')
"echo 'result:'.result.':'. a:bits digits
endif
catch /^Vim\%((\a\+)\)\=:E370/ " python not available
throw 'ToHex needs python'
let result = a:expression
endtry
else
echoerr 'ToHex needs python'
let result = a:expression
let result = printf('%x', a:expression)
endif
if (a:bits != 0)
let digits = a:bits / 4
let result = substitute(result, '\(0x\)\x*\(\x\{' . digits . '}\>\)', '\1\2', '')
"echo 'result:'.result.':'. a:bits digits
endif
return result
endfunction

View File

@ -17,18 +17,23 @@ if exists('g:pythonPath')
else
" pythonPath zum Suchpfad hinzufügen
let PATH = $PATH
if (match(PATH, '\c' . escape(g:pythonPath, '\')) >= 0)
let paths = split(tolower(PATH), ';')
if ( count(paths, tolower(g:pythonPath)) > 0)
" ist schon drin, abbrechen
echo 'kein python.exe in g:pythonPath=' . g:pythonPath . ' gefunden'
finish
else
" andere Python Verzeichnisse aus PATH löschen
" for p in paths
" if (match(p, 'python') >= 0)
" call remove(paths, index(paths, p))
" endif
" endfor
" bei Bedarf ';' an PATH anhängen
if (match(PATH, ';$') < 0)
let PATH = PATH . ';'
endif
let PATH = PATH . g:pythonPath
"echo 'Python = ' . g:pythonPath
"echo 'PATH:' PATH
call add(paths, g:pythonPath)
let PATH = join(paths, ';')
echo 'Python = ' . g:pythonPath
echo 'PATH:' PATH
let $PATH = PATH
endif
endif
@ -40,8 +45,8 @@ if exists('g:pythonPath')
finish
endif
let s:pythonLibPath = expand(g:pythonPath . '/lib')
let s:pythonDllPath = expand(g:pythonPath . '/dlls')
" let s:pythonLibPath = expand(g:pythonPath . '/lib')
" let s:pythonDllPath = expand(g:pythonPath . '/dlls')
endif
"try

View File

@ -1,11 +0,0 @@
%echo off
set vim=%~dp0..\..\..\vim74\gvim.exe
set base=%1
set mine=%2
set theirs=%3
set merged=%4
if not exist %vim% (
echo gvim.exe nicht gefunden
)
echo %vim% %base% %mine% %theirs% %merged%

View File

@ -1,11 +0,0 @@
%echo off
set vim=%~dp0..\..\..\vim74\gvim.exe
set base=%1
set mine=%2
set theirs=%3
set merged=%4
if not exist %vim% (
echo gvim.exe nicht gefunden
)
echo %vim% %base% %mine% %theirs% %merged%

View File

@ -1,11 +0,0 @@
%echo off
set vim=%~dp0..\..\..\vim74\gvim.exe
set base=%1
set mine=%2
set theirs=%3
set merged=%4
if not exist %vim% (
echo gvim.exe nicht gefunden
)
echo %vim% %base% %mine% %theirs% %merged%