mirror of
				https://github.com/miaowware/qrm2.git
				synced 2025-11-04 04:00:21 -05:00 
			
		
		
		
	addressing the issue for once
This commit is contained in:
		
							parent
							
								
									69d36fea7f
								
							
						
					
					
						commit
						b0072f779e
					
				
							
								
								
									
										17
									
								
								exts/ae7q.py
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								exts/ae7q.py
									
									
									
									
									
								
							@ -97,19 +97,18 @@ class AE7QCog(commands.Cog):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        for row in table_contents[0:3]:
 | 
					        for row in table_contents[0:3]:
 | 
				
			||||||
            header = f'**{row[0]}** ({row[1]})'
 | 
					            header = f'**{row[0]}** ({row[1]})'
 | 
				
			||||||
            body = f'Class: *{row[2]}*\n'
 | 
					            body = (f'Class: *{row[2]}*\n'
 | 
				
			||||||
            body += f'Region: *{row[3]}*\n'
 | 
					                    f'Region: *{row[3]}*\n'
 | 
				
			||||||
            body += f'Status: *{row[4]}*\n'
 | 
					                    f'Status: *{row[4]}*\n'
 | 
				
			||||||
            body += f'Granted: *{row[5]}*\n'
 | 
					                    f'Granted: *{row[5]}*\n'
 | 
				
			||||||
            body += f'Effective: *{row[6]}*\n'
 | 
					                    f'Effective: *{row[6]}*\n'
 | 
				
			||||||
            body += f'Cancelled: *{row[7]}*\n'
 | 
					                    f'Cancelled: *{row[7]}*\n'
 | 
				
			||||||
            body += f'Expires: *{row[8]}*'
 | 
					                    f'Expires: *{row[8]}*')
 | 
				
			||||||
            embed.add_field(name=header, value=body, inline=False)
 | 
					            embed.add_field(name=header, value=body, inline=False)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        embed.description = desc
 | 
					        embed.description = desc
 | 
				
			||||||
        if len(table_contents) > 3:
 | 
					        if len(table_contents) > 3:
 | 
				
			||||||
            embed.description += f'\nRecords 1 to 3 of {len(table_contents)}.'
 | 
					            embed.description += f'\nRecords 1 to 3 of {len(table_contents)}. See ae7q.com for more...'
 | 
				
			||||||
            embed.description += ' See ae7q.com for more...'
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        await ctx.send(embed=embed)
 | 
					        await ctx.send(embed=embed)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -22,8 +22,7 @@ import common as cmn
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class QrmHelpCommand(commands.HelpCommand):
 | 
					class QrmHelpCommand(commands.HelpCommand):
 | 
				
			||||||
    def __init__(self):
 | 
					    def __init__(self):
 | 
				
			||||||
        super().__init__(command_attrs={'help': 'Shows help about qrm or a command',
 | 
					        super().__init__(command_attrs={'help': 'Shows help about qrm or a command', 'aliases': ['h']})
 | 
				
			||||||
                                        'aliases': ['h']})
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_bot_mapping(self):
 | 
					    def get_bot_mapping(self):
 | 
				
			||||||
        bot = self.context.bot
 | 
					        bot = self.context.bot
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										12
									
								
								exts/grid.py
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								exts/grid.py
									
									
									
									
									
								
							@ -83,18 +83,18 @@ If two grid squares are given, the distance and azimuth between them is calculat
 | 
				
			|||||||
                    # Haversine formula
 | 
					                    # Haversine formula
 | 
				
			||||||
                    d_lat = math.radians(loc2[0] - loc[0])
 | 
					                    d_lat = math.radians(loc2[0] - loc[0])
 | 
				
			||||||
                    d_lon = math.radians(loc2[1] - loc[1])
 | 
					                    d_lon = math.radians(loc2[1] - loc[1])
 | 
				
			||||||
                    a = math.sin(d_lat/2) ** 2 +\
 | 
					                    a = math.sin(d_lat/2) ** 2
 | 
				
			||||||
                        math.cos(math.radians(loc[0])) * math.cos(math.radians(loc2[0])) *\
 | 
					                        + math.cos(math.radians(loc[0])) * math.cos(math.radians(loc2[0]))
 | 
				
			||||||
                        math.sin(d_lon/2) ** 2
 | 
					                        * math.sin(d_lon/2) ** 2
 | 
				
			||||||
                    c = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a))
 | 
					                    c = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a))
 | 
				
			||||||
                    d = radius * c
 | 
					                    d = radius * c
 | 
				
			||||||
                    d_mi = 0.6213712 * d
 | 
					                    d_mi = 0.6213712 * d
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    # Bearing
 | 
					                    # Bearing
 | 
				
			||||||
                    y_dist = math.sin(math.radians(loc2[1]-loc[1])) * math.cos(math.radians(loc2[0]))
 | 
					                    y_dist = math.sin(math.radians(loc2[1]-loc[1])) * math.cos(math.radians(loc2[0]))
 | 
				
			||||||
                    x_dist = math.cos(math.radians(loc[0])) * math.sin(math.radians(loc2[0])) -\
 | 
					                    x_dist = math.cos(math.radians(loc[0])) * math.sin(math.radians(loc2[0]))
 | 
				
			||||||
                        math.sin(math.radians(loc[0])) * math.cos(math.radians(loc2[0])) *\
 | 
					                             - math.sin(math.radians(loc[0])) * math.cos(math.radians(loc2[0]))
 | 
				
			||||||
                        math.cos(math.radians(loc2[1] - loc[1]))
 | 
					                             * math.cos(math.radians(loc2[1] - loc[1]))
 | 
				
			||||||
                    bearing = (math.degrees(math.atan2(y_dist, x_dist)) + 360) % 360
 | 
					                    bearing = (math.degrees(math.atan2(y_dist, x_dist)) + 360) % 360
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    embed = cmn.embed_factory(ctx)
 | 
					                    embed = cmn.embed_factory(ctx)
 | 
				
			||||||
 | 
				
			|||||||
@ -133,8 +133,7 @@ def qrz_process_info(data: dict):
 | 
				
			|||||||
        state = f', {data["state"]}'
 | 
					        state = f', {data["state"]}'
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        state = ''
 | 
					        state = ''
 | 
				
			||||||
    address = data.get('addr1', '') + '\n' + data.get('addr2', '') + \
 | 
					    address = data.get('addr1', '') + '\n' + data.get('addr2', '') + state + ' ' + data.get('zip', '')
 | 
				
			||||||
        state + ' ' + data.get('zip', '')
 | 
					 | 
				
			||||||
    address = address.strip()
 | 
					    address = address.strip()
 | 
				
			||||||
    if address == '':
 | 
					    if address == '':
 | 
				
			||||||
        address = None
 | 
					        address = None
 | 
				
			||||||
 | 
				
			|||||||
@ -75,10 +75,10 @@ class StudyCog(commands.Cog):
 | 
				
			|||||||
            embed.description = self.source
 | 
					            embed.description = self.source
 | 
				
			||||||
            embed.colour = cmn.colours.good
 | 
					            embed.colour = cmn.colours.good
 | 
				
			||||||
            embed.add_field(name='Question:', value=question['text'], inline=False)
 | 
					            embed.add_field(name='Question:', value=question['text'], inline=False)
 | 
				
			||||||
            embed.add_field(name='Answers:', value='**A:** ' + question['answers']['A'] +
 | 
					            embed.add_field(name='Answers:', value='**A:** ' + question['answers']['A']
 | 
				
			||||||
                            '\n**B:** ' + question['answers']['B'] +
 | 
					                            + '\n**B:** ' + question['answers']['B']
 | 
				
			||||||
                            '\n**C:** ' + question['answers']['C'] +
 | 
					                            + '\n**C:** ' + question['answers']['C']
 | 
				
			||||||
                            '\n**D:** ' + question['answers']['D'], inline=False)
 | 
					                            + '\n**D:** ' + question['answers']['D'], inline=False)
 | 
				
			||||||
            embed.add_field(name='Answer:', value='Type _?rqa_ for answer', inline=False)
 | 
					            embed.add_field(name='Answer:', value='Type _?rqa_ for answer', inline=False)
 | 
				
			||||||
            if 'image' in question:
 | 
					            if 'image' in question:
 | 
				
			||||||
                image_url = f'https://hamstudy.org/_1330011/images/{selected_pool.split("_",1)[1]}/{question["image"]}'
 | 
					                image_url = f'https://hamstudy.org/_1330011/images/{selected_pool.split("_",1)[1]}/{question["image"]}'
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user