mirror of
				https://github.com/KevinMidboe/delugeClient.git
				synced 2025-10-29 12:00:13 +00:00 
			
		
		
		
	Changed import statement to be compatible with python2 and changed our byteconverter utils function to convert to utf-8 not ascii for better multicultural support.
This commit is contained in:
		| @@ -43,7 +43,7 @@ from pprint import pprint | |||||||
| from deluge_client import DelugeRPCClient | from deluge_client import DelugeRPCClient | ||||||
| from sshtunnel import SSHTunnelForwarder | from sshtunnel import SSHTunnelForwarder | ||||||
| from docopt import docopt | from docopt import docopt | ||||||
| from .utils import ColorizeFilter, convert | from utils import ColorizeFilter, convert | ||||||
|  |  | ||||||
| BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								utils.py
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								utils.py
									
									
									
									
									
								
							| @@ -35,7 +35,7 @@ class ColorizeFilter(logging.Filter): | |||||||
|       return True |       return True | ||||||
|  |  | ||||||
| def convert(data): | def convert(data): | ||||||
|     if isinstance(data, bytes):  return data.decode('ascii') |     if isinstance(data, bytes):  return data.decode('utf-8') | ||||||
|     if isinstance(data, dict):   return dict(map(convert, data.items())) |     if isinstance(data, dict):   return dict(map(convert, data.items())) | ||||||
|     if isinstance(data, tuple):  return map(convert, data) |     if isinstance(data, tuple):  return map(convert, data) | ||||||
|     json_data = json.dumps(data) |     json_data = json.dumps(data) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user