mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-29 20:33:46 +08:00
Removes unused namelookup function.
Cutting out function whose only use was an unused constant.
This commit is contained in:
+1
-7
@@ -14,7 +14,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
from utils.protocol_utils import Enum, ndict, namelookup
|
||||
from utils.protocol_utils import Enum, ndict
|
||||
|
||||
# Datasource type should completely determine the other fields of a
|
||||
# message with its type.
|
||||
@@ -34,9 +34,3 @@ TRANSFORM_TYPE = ndict({
|
||||
'PASSTHROUGH': 'PASSTHROUGH',
|
||||
'EMPTY': ''
|
||||
})
|
||||
|
||||
|
||||
FINANCE_COMPONENT = namelookup({
|
||||
'TRADING_CLIENT': 'TRADING_CLIENT',
|
||||
'PORTFOLIO_CLIENT': 'PORTFOLIO_CLIENT',
|
||||
})
|
||||
|
||||
@@ -148,28 +148,3 @@ class ndict(MutableMapping):
|
||||
#return False
|
||||
|
||||
#return True
|
||||
|
||||
|
||||
# This is not neccesarily the most intuitive construction, but
|
||||
# we're aiming for raw performance rather than readability. So
|
||||
# we do things that we would not normally do in business logic.
|
||||
def namelookup(dct):
|
||||
ks = dct.keys()
|
||||
vs = dct.values()
|
||||
dct = {}
|
||||
|
||||
class _lookup:
|
||||
__slots__ = ks
|
||||
|
||||
def __init__(self):
|
||||
for k, v in zip(ks, vs):
|
||||
setattr(self, k, v)
|
||||
self.__setattr__ = self.locked
|
||||
|
||||
def locked(self, k, v):
|
||||
raise Exception('Name lookups are fixed at init.')
|
||||
|
||||
def __repr__(self):
|
||||
return '<namelookup %s>' % self.__slots__
|
||||
del dct
|
||||
return _lookup()
|
||||
|
||||
Reference in New Issue
Block a user