# Path: Cogs/DL.py
# def setup(bot):
# async def async_post_json(url, data = None, headers = None, ssl = None):
# async def async_post_text(url, data = None, headers = None, ssl = None):
# async def async_post_bytes(url, data = None, headers = None, ssl = None):
# async def async_head_json(url, headers = None, ssl = None):
# async def async_dl(url, headers = None, ssl = None):
# async def async_text(url, headers = None, ssl = None):
# async def async_json(url, headers = None, ssl = None):
# 
# Path: Cogs/Nullify.py
# def setup(bot):
# def clean(string, deaden_links = False, ctx = None):
# def escape_all(string, mentions = True, markdown = True):
# def resolve_mentions(string, ctx = None, escape = True, show_mentions = True, channel_mentions = False):


from xml.sax.saxutils import unescape
from Cogs import DL
from Cogs import Nullify

			partdown += "\*\*\*" + types[i] + ":\*\*\* \*" + names[i] + '\*\n'
		else:
			partdown += "***" + types[i] + ":*** *" + names[i] + '*\n'
	partdown = partdown[:-1]
	return partdown
		
async def getMarkdown( url, style = None, escape = False):
	# Ensure we're using a list
	if url.lower().endswith("pcpartpicker.com/list/"):
		# Not *just* the list... we want actual parts
		return None
	url = url.replace("#view=", "")
	if '/b/' in url.lower():
		# We have a build - let's try to convert to list
		try:
			response = await DL.async_text(url,{"user-agent":"Mozilla"})
		except Exception:
			return None
		try:
			newLink = response.split('">View full price breakdown<')[0].split('"')[-1]
		except Exception as e:
			newLink = None
		if newLink == None:
			return None
		url = "https://pcpartpicker.com" + str(newLink)
		
	# url = url.replace('/b/', '/list/')
	if not style:
		style = 'normal'
	try:

# Path: Cogs/DL.py
# def setup(bot):
# async def async_post_json(url, data = None, headers = None, ssl = None):
# async def async_post_text(url, data = None, headers = None, ssl = None):
# async def async_post_bytes(url, data = None, headers = None, ssl = None):
# async def async_head_json(url, headers = None, ssl = None):
# async def async_dl(url, headers = None, ssl = None):
# async def async_text(url, headers = None, ssl = None):
# async def async_json(url, headers = None, ssl = None):
# 
# Path: Cogs/Nullify.py
# def setup(bot):
# def clean(string, deaden_links = False, ctx = None):
# def escape_all(string, mentions = True, markdown = True):
# def resolve_mentions(string, ctx = None, escape = True, show_mentions = True, channel_mentions = False):


# Path: Cogs/PCPP.py
from xml.sax.saxutils import unescape
from Cogs import DL
from Cogs import Nullify

			partdown += "\*\*\*" + types[i] + ":\*\*\* \*" + names[i] + '\*\n'
		else:
			partdown += "***" + types[i] + ":*** *" + names[i] + '*\n'
	partdown = partdown[:-1]
	return partdown
		
async def getMarkdown( url, style = None, escape = False):
	# Ensure we're using a list
	if url.lower().endswith("pcpartpicker.com/list/"):
		# Not *just* the list... we want actual parts
		return None
	url = url.replace("#view=", "")
	if '/b/' in url.lower():
		# We have a build - let's try to convert to list
		try:
			response = await DL.async_text(url,{"user-agent":"Mozilla"})
		except Exception:
			return None
		try:
			newLink = response.split('">View full price breakdown<')[0].split('"')[-1]
		except Exception as e:
			newLink = None
		if newLink == None:
			return None
		url = "https://pcpartpicker.com" + str(newLink)
		
	# url = url.replace('/b/', '/list/')
	if not style:
		style = 'normal'
	try:

		response = await DL.async_text(url,{"user-agent":"Mozilla"})
