Fix missing import, pep8

This commit is contained in:
Chase Sterling 2014-02-19 23:46:53 -05:00
parent fff75b51ce
commit c64da3ceb4
1 changed files with 38 additions and 35 deletions

View File

@ -47,6 +47,7 @@ import pkg_resources
import gettext import gettext
import locale import locale
import base64 import base64
import urllib
try: try:
import json import json
@ -505,6 +506,7 @@ def is_magnet(uri):
return True return True
return False return False
def get_magnet_info(uri): def get_magnet_info(uri):
""" """
Return information about a magnet link. Return information about a magnet link.
@ -540,7 +542,7 @@ def get_magnet_info(uri):
else: else:
break break
elif param.startswith(dn_param): elif param.startswith(dn_param):
name = unquote_plus(param[len(dn_param):]) name = urllib.unquote_plus(param[len(dn_param):])
if info_hash: if info_hash:
if not name: if not name:
@ -548,6 +550,7 @@ def get_magnet_info(uri):
return {"name": name, "info_hash": info_hash, "files_tree": ''} return {"name": name, "info_hash": info_hash, "files_tree": ''}
return False return False
def create_magnet_uri(infohash, name=None, trackers=[]): def create_magnet_uri(infohash, name=None, trackers=[]):
""" """
Creates a magnet uri Creates a magnet uri