mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-03 13:30:52 -05:00 
			
		
		
		
	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:
		
							parent
							
								
									ae261d38b7
								
							
						
					
					
						commit
						34caaa937e
					
				
							
								
								
									
										8
									
								
								g.py
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								g.py
									
									
									
									
									
								
							@ -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
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										3
									
								
								ssort.f
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								ssort.f
									
									
									
									
									
								
							@ -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
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										3
									
								
								wsjt.py
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								wsjt.py
									
									
									
									
									
								
							@ -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:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user