summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerman M. Bravo <german.mb@deipi.com>2013-08-13 17:59:57 -0500
committerGerman M. Bravo <german.mb@deipi.com>2013-08-13 17:59:57 -0500
commit14524db5da90d2bb88747650d899d09f5ce7bd27 (patch)
tree15224b447a9331c627d07c4284d085b7841045d2
parent75720cfe4cd7ca9c9bc9d8faeb7dd34045eefa6f (diff)
downloadpyscss-14524db5da90d2bb88747650d899d09f5ce7bd27.tar.gz
Normalized function names
-rw-r--r--scss/expression.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/scss/expression.py b/scss/expression.py
index 0da97a4..20c8cf5 100644
--- a/scss/expression.py
+++ b/scss/expression.py
@@ -251,7 +251,7 @@ class CallOp(Expression):
def evaluate(self, calculator, divide=False):
# TODO bake this into the context and options "dicts", plus library
- name = normalize_var(self.func_name)
+ func_name = normalize_var(self.func_name)
# Turn the pairs of arg tuples into *args and **kwargs
# TODO unclear whether this is correct -- how does arg, kwarg, arg
@@ -272,15 +272,14 @@ class CallOp(Expression):
# TODO merge this with the library
try:
- func = calculator.namespace.function(self.func_name, num_args)
+ func = calculator.namespace.function(func_name, num_args)
# @functions take a ns as first arg. TODO: Python functions possibly
# should too
if getattr(func, '__name__', None) == '__call':
func = partial(func, calculator.namespace)
except KeyError:
- if not is_builtin_css_function(self.func_name):
- # TODO log.warn, log.error, warning, exception?
- log.warn("no such function")
+ if not is_builtin_css_function(func_name):
+ log.error("Function not found: %s:%s", func_name, num_args, extra={'stack': True})
rendered_args = []
for var, value in evald_argpairs:
@@ -291,7 +290,7 @@ class CallOp(Expression):
rendered_args.append("%s: %s" % (var, rendered_value))
return String(
- u"%s(%s)" % (self.func_name, u", ".join(rendered_args)),
+ u"%s(%s)" % (func_name, u", ".join(rendered_args)),
quotes=None)
else:
return func(*args, **kwargs)