def _edit_example(self): commentary = examples.create_post_example(self.api_level, self.route) text = click.edit(commentary) if text: raw_object = "".join([line for line in text.splitlines() if not line.startswith("#")]).strip() else: raw_object = "" return json.loads(raw_object)
def _edit_example(self): commentary = examples.create_post_example(self.api_level, self.route) text = click.edit(commentary) if text: raw_object = "".join([ line for line in text.splitlines() if not line.startswith("#") ]).strip() else: raw_object = "" return json.loads(raw_object)
def _edit_example(self): commentary = \ '''# The body must be a valid FarmRoleTemplate object. # # Type your FarmRoleTemplate object below this line. The above text will not be sent to the API server.''' text = click.edit(commentary) if text: raw_object = "".join([line for line in text.splitlines() if not line.startswith("#")]).strip() else: raw_object = "" return json.loads(raw_object)
def _edit_example(self): commentary = \ '''# The body must be a valid FarmTemplate object. # # Type your FarmTemplate object below this line. The above text will not be sent to the API server.''' text = click.edit(commentary) if text: raw_object = "".join([ line for line in text.splitlines() if not line.startswith("#") ]).strip() else: raw_object = "" return json.loads(raw_object)
def _edit_object(self, *args, **kwargs): raw_object = self._get_object(*args, **kwargs) raw_object = click.edit(raw_object) if raw_object is None: raise ValueError("No changes in JSON") return json.loads(raw_object)