commit f3c0005c67d3a11d16eb46bd0ea667dcbce183c5
parent 9803bdddea3563e2cdacb9708f9e60486640a529
Author: lash <dev@holbrook.no>
Date: Thu, 12 May 2022 08:19:25 +0000
Allow string keys for value to be applied in more, less
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/aiee/arg.py b/aiee/arg.py
@@ -77,6 +77,11 @@ class ArgFlag:
flags = getattr(self, k)
except TypeError:
flags = k
+ try:
+ vv = to_key(v)
+ v = getattr(self, vv)
+ except TypeError:
+ pass
mask = ~(self.__all & v)
r = flags & mask
return r
@@ -88,6 +93,12 @@ class ArgFlag:
flags = getattr(self, k)
except TypeError:
flags = k
+ try:
+ vv = to_key(v)
+ v = getattr(self, vv)
+ except TypeError:
+ pass
+
return flags | v