|
1 | | -import json |
2 | 1 | import os |
3 | 2 | import re |
4 | 3 | from urllib.parse import urlparse |
@@ -955,7 +954,7 @@ def describe_field(self, resource_type, field=None, raw=False): |
955 | 954 | if error is not None: |
956 | 955 | print(error) |
957 | 956 | else: |
958 | | - mdf_toolbox.print_jsonschema(schema) |
| 957 | + [print(line) for line in mdf_toolbox.prettify_jsonschema(schema)] |
959 | 958 | return |
960 | 959 |
|
961 | 960 | def describe_organization(self, organization, summary=False, raw=False): |
@@ -1036,16 +1035,5 @@ def describe_organization(self, organization, summary=False, raw=False): |
1036 | 1035 | if not org.get("parent_organizations"): |
1037 | 1036 | org.pop("parent_organizations", None) |
1038 | 1037 |
|
1039 | | - # Print dict as key: value |
1040 | | - # All values besides "services" are max single-depth containers |
1041 | | - for k, v in org.items(): |
1042 | | - if not v: |
1043 | | - v = "None" |
1044 | | - # "services", just prettyprint the dict |
1045 | | - if isinstance(v, dict): |
1046 | | - print("\t{}: {}".format(k, json.dumps(v, indent=4))) |
1047 | | - elif isinstance(v, list): |
1048 | | - print("\t{}: {}".format(k, ", ".join([(x or "None") for x in v]))) |
1049 | | - else: |
1050 | | - print("\t{}: {}".format(k, str(v))) |
| 1038 | + [print(line) for line in mdf_toolbox.prettify_json(org)] |
1051 | 1039 | return |
0 commit comments