change how deleting log entries works, now just choose a number of the item to delete, also add seconds to log entries
This commit is contained in:
		
							parent
							
								
									efa3e0a58f
								
							
						
					
					
						commit
						5104864dd5
					
				| @ -137,16 +137,16 @@ def addLogBook() : | |||||||
|   #writeln(str(db)) |   #writeln(str(db)) | ||||||
|   #writeln("|PA") |   #writeln("|PA") | ||||||
|   ts = calendar.timegm(time.gmtime()) |   ts = calendar.timegm(time.gmtime()) | ||||||
|   now = datetime.now().strftime('%Y-%m-%d %H:%M') |   now = datetime.now().strftime('%Y-%m-%d %H:%M:%S') | ||||||
|   writeln("|CL") |   writeln("|CL") | ||||||
| 
 | 
 | ||||||
|   write("Enter the date for this log entry (YYYY-MM-DD HH:MM): ") |   write("Enter the date for this log entry (YYYY-MM-DD HH:MM:SS): ") | ||||||
|   getDate = getstr(1,16,16,now) |   getDate = getstr(1,16,16,now) | ||||||
|   if not getDate : |   if not getDate : | ||||||
|     return isNull() |     return isNull() | ||||||
| 
 | 
 | ||||||
|   write("Enter the call-sign of the person you made contact with: ") |   write("Enter the call-sign of the person you made contact with: ") | ||||||
|   getCall = getstr(2,10,10,db["users"][handle]["callsign"]) |   getCall = getstr(2,10,10,"") | ||||||
|   if not getCall : |   if not getCall : | ||||||
|     return isNull() |     return isNull() | ||||||
| 
 | 
 | ||||||
| @ -203,18 +203,23 @@ def addLogBook() : | |||||||
| def delLogBook() : | def delLogBook() : | ||||||
|   global db |   global db | ||||||
|   global handle |   global handle | ||||||
|  |   tmpDB = [] | ||||||
|   found = False |   found = False | ||||||
|   writeln("|CL") |   writeln("|CL") | ||||||
|   for LOG in sorted(db["logs"], reverse=True) : |   for LOG in sorted(db["logs"], reverse=True) : | ||||||
|     if db["logs"][LOG]["reportedBy"] == handle : |     if db["logs"][LOG]["reportedBy"] == handle : | ||||||
|       found = True |       found = True | ||||||
|       writeln(LOG) |       tmpDB.append(LOG) | ||||||
|   if found : |   if found : | ||||||
|     write("|CREnter the date of the entry to delete: ") |     L = len(tmpDB) | ||||||
|  |     for I in range(L) : | ||||||
|  |       writeln("["+str(I+1)+"] "+tmpDB[I]) | ||||||
|  |     write("|CREnter the number of the entry to delete: ") | ||||||
|     getDate = getstr(1,16,16,"") |     getDate = getstr(1,16,16,"") | ||||||
|     if getDate : |     if getDate : | ||||||
|       if getDate in db["logs"] : |       NUM = int(getDate) - 1 | ||||||
|         del db["logs"][getDate] |       if tmpDB[NUM] in db["logs"] : | ||||||
|  |         del db["logs"][tmpDB[NUM]] | ||||||
|         saveDB() |         saveDB() | ||||||
|         writeln("Deleted: "+getDate) |         writeln("Deleted: "+getDate) | ||||||
|         writeln("|PA") |         writeln("|PA") | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 MeaTLoTioN
						MeaTLoTioN