Workaround code for James's problem with the Python rfind method; better

error message in ssort.f.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@43 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2006-01-03 16:33:16 +00:00
parent 6074556d20
commit 45caec5d23
3 changed files with 10 additions and 4 deletions

8
g.py
View File

@ -17,8 +17,14 @@ def ftnstr(x):
#------------------------------------------------------ filetime #------------------------------------------------------ filetime
def filetime(t): def filetime(t):
# i=t.rfind(".") # i=t.rfind(".")
i=6 i=rfnd(t,".")
t=t[:i][-6:] t=t[:i][-6:]
t=t[0:2]+":"+t[2:4]+":"+t[4:6] t=t[0:2]+":"+t[2:4]+":"+t[4:6]
return t return t
#------------------------------------------------------ rfnd
#Temporary workaround to replace t.rfind(c)
def rfnd(t,c):
for i in range(len(t)-1,0,-1):
if t[i:i+1]==c: return i
return -1

View File

@ -26,7 +26,8 @@ c = -2 means sort x in decreasing order and carry y along.
nn = n nn = n
if (nn .lt. 1) then if (nn .lt. 1) then
print *,'n = ',nn,' kflag = ',kflag,' in ssort.' print*,'ssort: The number of sort elements is not positive.'
print*,'ssort: n = ',nn,' kflag = ',kflag
return return
endif endif
c c

View File

@ -92,7 +92,6 @@ g.freeze_decode=0
g.mode="" g.mode=""
g.ndevin=IntVar() g.ndevin=IntVar()
g.ndevout=IntVar() g.ndevout=IntVar()
#------------------------------------------------------ showspecjt #------------------------------------------------------ showspecjt
def showspecjt(): def showspecjt():
g.showspecjt=1 g.showspecjt=1
@ -1239,8 +1238,8 @@ def update():
msg4.configure(text=t,bg='red') msg4.configure(text=t,bg='red')
t=g.ftnstr(Audio.gcom2.decodedfile) t=g.ftnstr(Audio.gcom2.decodedfile)
i=0
# i=t.rfind(".") # i=t.rfind(".")
i=g.rfnd(t,".")
t=t[:i] t=t[:i]
lab3.configure(text=t) lab3.configure(text=t)
if mode.get() != g.mode or first: if mode.get() != g.mode or first: