cortexapps-cli 0.26.1__tar.gz → 0.26.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cortexapps-cli
3
- Version: 0.26.1
3
+ Version: 0.26.3
4
4
  Summary: Command Line Interface for cortexapps
5
5
  License: MIT
6
6
  Author: Cortex Apps
@@ -73,11 +73,12 @@ def read_file(args):
73
73
  def read_json_from_yaml(args):
74
74
  if str(type(args.file)) == "<class '_io.TextIOWrapper'>":
75
75
  data = yaml.safe_load(args.file.read())
76
+
76
77
  else:
77
78
  with open(args.file.name, 'rb') as f:
78
79
  data = yaml.safe_load(f)
79
80
 
80
- return '{ "spec": "' + str(data) + '" }'
81
+ return json.dumps({ "spec": "" + str(data) + "" })
81
82
 
82
83
  def check_config_file(config_file, replace_string):
83
84
  if not os.path.isfile(config_file):
@@ -294,6 +295,15 @@ def add_argument_groups(subparser):
294
295
  metavar=''
295
296
  )
296
297
 
298
+ def add_argument_hierarchyDepth(subparser):
299
+ subparser.add_argument(
300
+ '-d',
301
+ '--hierarchy-depth',
302
+ help='Depth of the parent / children hierarchy nodes. Can be \'full\' or a valid integer',
303
+ default='full',
304
+ metavar=''
305
+ )
306
+
297
307
  def add_argument_id(subparser, help_text='The id of the CQL query'):
298
308
  subparser.add_argument(
299
309
  '-i',
@@ -324,6 +334,16 @@ def add_argument_includeDrafts(subparser, help_text='Include plugin drafts.'):
324
334
  action='store_true'
325
335
  )
326
336
 
337
+ def add_argument_includeHierarchyFields(subparser):
338
+ subparser.add_argument(
339
+ '-i',
340
+ '--includeHierarchyFields',
341
+ help='List of sub fields to include for hierarchies. Only supports \'groups\'',
342
+ required=False,
343
+ default=argparse.SUPPRESS,
344
+ metavar=''
345
+ )
346
+
327
347
  def add_argument_includeIncoming(subparser, help_text='Including incoming dependencies.'):
328
348
  subparser.add_argument(
329
349
  '-i',
@@ -1025,22 +1045,9 @@ def subparser_catalog_list(subparser):
1025
1045
  action='store_true',
1026
1046
  required=False
1027
1047
  )
1028
- sp.add_argument(
1029
- '-d',
1030
- '--hierarchy-depth',
1031
- help='Depth of the parent / children hierarchy nodes. Can be \'full\' or a valid integer',
1032
- default='full',
1033
- metavar=''
1034
- )
1048
+ add_argument_hierarchyDepth(sp)
1035
1049
  add_argument_groups(sp)
1036
- sp.add_argument(
1037
- '-i',
1038
- '--includeHierarchyFields',
1039
- help='List of sub fields to include for hierarchies. Only supports \'groups\'',
1040
- default=False,
1041
- action='store_true',
1042
- required=False
1043
- )
1050
+ add_argument_includeHierarchyFields(sp)
1044
1051
  sp.add_argument(
1045
1052
  '-in',
1046
1053
  '--includeNestedFields',
@@ -1123,14 +1130,8 @@ def catalog_descriptor(args):
1123
1130
 
1124
1131
  def subparser_catalog_details(subparser):
1125
1132
  sp = subparser.add_parser('details', help='Retrieve entity details')
1126
- sp.add_argument(
1127
- '-i',
1128
- '--includeHierarchyFields',
1129
- help='List of sub fields to include for hierarchies. Only supports \'groups\'',
1130
- default=argparse.SUPPRESS,
1131
- metavar=''
1132
- )
1133
- add_argument_groups(sp)
1133
+ add_argument_includeHierarchyFields(sp)
1134
+ add_argument_hierarchyDepth(sp)
1134
1135
  add_argument_tag(sp)
1135
1136
  sp.set_defaults(func=catalog_details)
1136
1137
 
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
  name = "cortexapps-cli"
3
3
  # version will be incremented via command line as part of github actions build
4
- version = "0.26.1"
4
+ version = "0.26.3"
5
5
  description = "Command Line Interface for cortexapps"
6
6
  license = "MIT"
7
7
  authors = [
File without changes