From 38f2c044c380ebde2908554e22a88c3f244fde91 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Wed, 10 Jul 2019 00:27:02 -0500 Subject: [PATCH] [FIX] asterisk_click2dial: Travis errors --- asterisk_click2dial/scripts/set_name_agi.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/asterisk_click2dial/scripts/set_name_agi.py b/asterisk_click2dial/scripts/set_name_agi.py index cd0445d..f734f52 100755 --- a/asterisk_click2dial/scripts/set_name_agi.py +++ b/asterisk_click2dial/scripts/set_name_agi.py @@ -115,8 +115,8 @@ options = [ '(will not try to connect to Odoo)'}, {'names': ('-p', '--port'), 'dest': 'port', 'type': 'int', 'action': 'store', 'default': False, - 'help': "Port of Odoo's webservice interface. Default = 443 when SSL is on, " - "8069 when SSL is off"}, + 'help': "Port of Odoo's webservice interface. Default = 443 when SSL " + "is on, 8069 when SSL is off"}, {'names': ('-e', '--ssl'), 'dest': 'ssl', 'help': "Use SSL connections instead of clear connections. " "Default = no, use clear XML-RPC or JSON-RPC", @@ -206,7 +206,7 @@ def geolocate_phone_number(number, my_country_code, lang): def convert_to_ascii(my_unicode): '''Convert to ascii, with clever management of accents (é -> e, è -> e)''' import unicodedata - if isinstance(my_unicode, unicode): + if isinstance(my_unicode, bytes): my_unicode_with_ascii_chars_only = ''.join(( char for char in unicodedata.normalize('NFD', my_unicode) if unicodedata.category(char) != 'Mn')) @@ -233,9 +233,9 @@ def main(options, arguments): # connect to Odoo or geoloc, we just keep it phone_chars = [str(d) for d in range(10)] phone_chars += ['+'] - if ( - agi.env.get('agi_calleridname') and - any([x not in phone_chars for x in agi.env['agi_calleridname']]) and + if (agi.env.get('agi_calleridname') and + any([x not in phone_chars for x in + agi.env['agi_calleridname']]) and agi.env['agi_calleridname'].lower() not in ['asterisk', 'unknown', 'anonymous'] and not options.notify):