forked from s_ranjbar/city_retrofit
25 lines
629 B
Python
25 lines
629 B
Python
from usage.usage_feeders.de_usage_parameters import DeUsageParameters
|
|
from usage.usage_feeders.us_new_york_city_usage_parameters import UsNewYorkCityUsageParameters
|
|
|
|
|
|
class UsageFactory:
|
|
def __init__(self, handler, city):
|
|
self._handler = handler.lower().replace(' ', '_')
|
|
self._city = city
|
|
self.factory()
|
|
|
|
def us_new_york_city(self):
|
|
UsNewYorkCityUsageParameters(self._city)
|
|
|
|
def ca(self):
|
|
raise Exception('Not implemented')
|
|
|
|
def de(self):
|
|
DeUsageParameters(self._city)
|
|
|
|
def es(self):
|
|
raise Exception('Not implemented')
|
|
|
|
def factory(self):
|
|
getattr(self, self._handler, lambda: None)()
|