CC-2633: moving to_unicode() to api_client.py
- move to_unicode() to api_client.py - fixed how it decodes path in airtime-import.py
This commit is contained in:
parent
e2a5344e6e
commit
375cfb2c2d
4 changed files with 34 additions and 26 deletions
|
@ -32,7 +32,13 @@ def api_client_factory(config):
|
|||
else:
|
||||
logger.info('API Client "'+config["api_client"]+'" not supported. Please check your config file.\n')
|
||||
sys.exit()
|
||||
|
||||
|
||||
def to_unicode(obj, encoding='utf-8'):
|
||||
if isinstance(obj, basestring):
|
||||
if not isinstance(obj, unicode):
|
||||
obj = unicode(obj, encoding)
|
||||
return obj
|
||||
|
||||
class ApiClientInterface:
|
||||
|
||||
# Implementation: optional
|
||||
|
@ -515,7 +521,6 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
|
||||
return response
|
||||
|
||||
|
||||
################################################################################
|
||||
# OpenBroadcast API Client
|
||||
################################################################################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue