ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran-z <...@git.apache.org>
Subject [GitHub] incubator-ariatosca pull request #97: Aria 48 aria cli
Date Thu, 13 Apr 2017 13:55:00 GMT
Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/97#discussion_r111388512
  
    --- Diff: aria/utils/formatting.py ---
    @@ -83,6 +83,49 @@ def full_type_name(value):
         return name if module == '__builtin__' else '%s.%s' % (module, name)
     
     
    +def decode_list(data):
    +    decoded_list = []
    +    for item in data:
    +        if isinstance(item, unicode):
    +            item = item.encode('utf-8')
    +        elif isinstance(item, list):
    +            item = decode_list(item)
    +        elif isinstance(item, dict):
    +            item = decode_dict(item)
    +        decoded_list.append(item)
    +    return decoded_list
    +
    +
    +def decode_dict(data):
    +    decoded_dict = {}
    +    for key, value in data.iteritems():
    +        if isinstance(key, unicode):
    +            key = key.encode('utf-8')
    +        if isinstance(value, unicode):
    +            value = value.encode('utf-8')
    +        elif isinstance(value, list):
    +            value = decode_list(value)
    +        elif isinstance(value, dict):
    +            value = decode_dict(value)
    +        decoded_dict[key] = value
    +    return decoded_dict
    +
    +
    +def try_convert_from_str(string, target_type):
    --- End diff --
    
    remove


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message