Build fix. jetstream has a local copy, not remote archive.
[WebKit-https.git] / Tools / Scripts / webkitpy / benchmark_runner / generic_factory.py
1 #!/usr/bin/env python
2
3 import logging
4 import os
5
6 from utils import loadModule, ModuleNotFoundError
7
8
9 _log = logging.getLogger(__name__)
10
11
12 class GenericFactory(object):
13
14     products = None
15
16     @classmethod
17     def iterateGetItem(cls, options, keys):
18         ret = options
19         for key in keys:
20             try:
21                 ret = ret.__getitem__(key)
22             except KeyError:
23                 raise
24         return ret
25
26     @classmethod
27     def create(cls, descriptions):
28         try:
29             return loadModule(cls.iterateGetItem(cls.products, descriptions))()
30         except:
31             raise