(self)
return active_sketch
Sketch object from the API client.

        Returns:
            Sketch object.
Sketch object from the API client.
Sketch object from the API client .
def sketch(self):
        """Sketch object from the API client.

        Returns:
            Sketch object.
        """
        active_sketch = None
        sketch_from_config = self.config_assistant.get_config('sketch')

        if self.sketch_from_flag:
            active_sketch = self.api.get_sketch(
                sketch_id=int(self.sketch_from_flag))
        elif sketch_from_config:
            active_sketch = self.api.get_sketch(
                sketch_id=int(sketch_from_config))

        if not active_sketch:
            click.echo(
                'ERROR: You need to specify a sketch, either with a '
                'flag (--sketch <SKETCH ID>) or update the config.')
            sys.exit(1)

        # Make sure we have access to the sketch.
        try:
            active_sketch.name
        except KeyError:
            click.echo('ERROR: No such sketch or you don\'t have access.')
            sys.exit(1)

        return active_sketch
def sketch ( self ) : active_sketch = None sketch_from_config = self . config_assistant . get_config ( 'sketch' ) if self . sketch_from_flag : active_sketch = self . api . get_sketch ( sketch_id = int ( self . sketch_from_flag ) ) elif sketch_from_config : active_sketch = self . api . get_sketch ( sketch_id = int ( sketch_from_config ) ) if not active_sketch : click . echo ( 'ERROR: You need to specify a sketch, either with a ' 'flag (--sketch <SKETCH ID>) or update the config.' ) sys . exit ( 1 ) # Make sure we have access to the sketch. try : active_sketch . name except KeyError : click . echo ( 'ERROR: No such sketch or you don\'t have access.' ) sys . exit ( 1 ) return active_sketch