summaryrefslogtreecommitdiff
path: root/scss/types.py
diff options
context:
space:
mode:
authorEevee (Alex Munroe) <eevee.git@veekun.com>2013-10-07 16:03:56 -0700
committerEevee (Alex Munroe) <eevee.git@veekun.com>2013-10-07 16:03:56 -0700
commit3a642158da561e238e6edebb53827a833add544f (patch)
treecdb88a571f68b28bf0be69415aeda75ca9eca1b2 /scss/types.py
parent10c79d6f3e9dd586da907c4c288b7a06cc500abc (diff)
downloadpyscss-3a642158da561e238e6edebb53827a833add544f.tar.gz
Revert "Unquote strings when used from variables in selectors"
Diverges from Ruby behavior, and is causing a crash somewhere when run against Yelp's codebase. This reverts commit 431a1d1471de6d86dd8cdf66924a606fea0df60e.
Diffstat (limited to 'scss/types.py')
-rw-r--r--scss/types.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/scss/types.py b/scss/types.py
index f34552c..7ef6dc3 100644
--- a/scss/types.py
+++ b/scss/types.py
@@ -101,7 +101,7 @@ class Value(object):
def __neg__(self):
return String("-" + self.render())
- def render(self, compress=False, unquote=False):
+ def render(self, compress=False):
return self.__str__()
@@ -130,7 +130,7 @@ class Null(Value):
def __ne__(self, other):
return Boolean(not self.__eq__(other))
- def render(self, compress=False, unquote=False):
+ def render(self, compress=False):
return self.sass_type_name
@@ -198,7 +198,7 @@ class Boolean(Value):
def __bool__(self):
return self.value
- def render(self, compress=False, unquote=False):
+ def render(self, compress=False):
if self.value:
return 'true'
else:
@@ -332,6 +332,7 @@ class Number(Value):
unit_denom=self.unit_denom * int(exp.value),
)
+
def __mul__(self, other):
if not isinstance(other, Number):
return NotImplemented
@@ -470,7 +471,7 @@ class Number(Value):
def is_unitless(self):
return not self.unit_numer and not self.unit_denom
- def render(self, compress=False, unquote=False):
+ def render(self, compress=False):
if not self.has_simple_unit:
raise ValueError("Can't express compound units in CSS: %r" % (self,))
@@ -604,14 +605,14 @@ class List(Value):
def __getitem__(self, key):
return self.value[key]
- def render(self, compress=False, unquote=False):
+ def render(self, compress=False):
if not self.value:
raise ValueError("Can't render empty list as CSS")
delim = self.delimiter(compress)
return delim.join(
- item.render(compress=compress, unquote=unquote)
+ item.render(compress=compress)
for item in self.value
)
@@ -847,7 +848,7 @@ class Color(Value):
return Color.from_rgb(*new_rgb, alpha=self.alpha)
- def render(self, compress=False, unquote=False):
+ def render(self, compress=False):
"""Return a rendered representation of the color. If `compress` is
true, the shortest possible representation is used; otherwise, named
colors are rendered as names and all others are rendered as hex (or
@@ -942,8 +943,8 @@ class String(Value):
def __hash__(self):
return hash(self.value)
- def __str__(self, unquote=False):
- if self.quotes and not unquote:
+ def __str__(self):
+ if self.quotes:
return self.quotes + escape(self.value) + self.quotes
else:
return self.value
@@ -983,8 +984,8 @@ class String(Value):
return String(self.value * int(other.value), quotes=self.quotes)
- def render(self, compress=False, unquote=False):
- return self.__str__(unquote)
+ def render(self, compress=False):
+ return self.__str__()
### XXX EXPERIMENTAL XXX
@@ -1019,7 +1020,7 @@ class Map(Value):
def get_by_pos(self, key):
return self.pairs[key][1]
- def render(self, compress=False, unquote=False):
+ def render(self, compress=False):
raise TypeError("Cannot render map %r as CSS" % (self,))