mirror of
				https://github.com/miaowware/qrm2.git
				synced 2025-11-03 19:50:20 -05:00 
			
		
		
		
	QRZCog: quick mini linting (#60)
This commit is contained in:
		
							parent
							
								
									29d604c456
								
							
						
					
					
						commit
						af3f341c27
					
				@ -61,7 +61,7 @@ class QRZCog(commands.Cog):
 | 
				
			|||||||
            raise ValueError(resp_session['Error'])
 | 
					            raise ValueError(resp_session['Error'])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        resp_xml_data = resp_xml.xpath('/x:QRZDatabase/x:Callsign',
 | 
					        resp_xml_data = resp_xml.xpath('/x:QRZDatabase/x:Callsign',
 | 
				
			||||||
                                                namespaces={'x':'http://xmldata.qrz.com'})
 | 
					                                       namespaces={'x': 'http://xmldata.qrz.com'})
 | 
				
			||||||
        resp_data = {el.tag.split('}')[1]: el.text for el in resp_xml_data[0].getiterator()}
 | 
					        resp_data = {el.tag.split('}')[1]: el.text for el in resp_xml_data[0].getiterator()}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        embed = discord.Embed(title=f"QRZ Data for {resp_data['call']}",
 | 
					        embed = discord.Embed(title=f"QRZ Data for {resp_data['call']}",
 | 
				
			||||||
@ -105,7 +105,7 @@ async def qrz_login(user: str, passwd: str, session: aiohttp.ClientSession):
 | 
				
			|||||||
        resp_xml = etree.parse(BytesIO(await resp.read())).getroot()
 | 
					        resp_xml = etree.parse(BytesIO(await resp.read())).getroot()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    resp_xml_session = resp_xml.xpath('/x:QRZDatabase/x:Session',
 | 
					    resp_xml_session = resp_xml.xpath('/x:QRZDatabase/x:Session',
 | 
				
			||||||
                                      namespaces={'x':'http://xmldata.qrz.com'})
 | 
					                                      namespaces={'x': 'http://xmldata.qrz.com'})
 | 
				
			||||||
    resp_session = {el.tag.split('}')[1]: el.text for el in resp_xml_session[0].getiterator()}
 | 
					    resp_session = {el.tag.split('}')[1]: el.text for el in resp_xml_session[0].getiterator()}
 | 
				
			||||||
    if 'Error' in resp_session:
 | 
					    if 'Error' in resp_session:
 | 
				
			||||||
        raise ConnectionError(resp_session['Error'])
 | 
					        raise ConnectionError(resp_session['Error'])
 | 
				
			||||||
@ -122,7 +122,7 @@ async def qrz_test_session(key: str, session: aiohttp.ClientSession):
 | 
				
			|||||||
        resp_xml = etree.parse(BytesIO(await resp.read())).getroot()
 | 
					        resp_xml = etree.parse(BytesIO(await resp.read())).getroot()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    resp_xml_session = resp_xml.xpath('/x:QRZDatabase/x:Session',
 | 
					    resp_xml_session = resp_xml.xpath('/x:QRZDatabase/x:Session',
 | 
				
			||||||
                                      namespaces={'x':'http://xmldata.qrz.com'})
 | 
					                                      namespaces={'x': 'http://xmldata.qrz.com'})
 | 
				
			||||||
    resp_session = {el.tag.split('}')[1]: el.text for el in resp_xml_session[0].getiterator()}
 | 
					    resp_session = {el.tag.split('}')[1]: el.text for el in resp_xml_session[0].getiterator()}
 | 
				
			||||||
    if 'Error' in resp_session:
 | 
					    if 'Error' in resp_session:
 | 
				
			||||||
        raise ConnectionError(resp_session['Error'])
 | 
					        raise ConnectionError(resp_session['Error'])
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user