Completed
Pull Request — master (#436)
by Anthony
02:00
created

VehicleAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %
Metric Value
wmc 2
dl 0
loc 8
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 7 2
1
from lib.actions import BaseAction
2
3
__all__ = [
4
    'VehicleAction'
5
]
6
7
8
class VehicleAction(BaseAction):
9
    def run(self, vin, action, **kwargs):
10
        if vin is None:
11
            vehicle = self.connection.vehicles()[0]
12
        else:
13
            vehicle = self.connection.vehicle(vin)
14
        response = action = getattr(vehicle, action)(**kwargs)
15
        return self.formatter.formatter(response)
16