Exemplo n.º 1
0
 def __str__(self):
     name, expr = ''.join(str(s) for s in self.data[0].data ), self.data[2:]
     if not SORTING.has_key(name.strip('*_')) and self.root.get_opt('warn'):
         warn("Unknown declaration: %s" % name)
     return ( ':' + self.root.delims[1] ).join([
         ''.join(str(s) for s in name),
         ' '.join(str(e) for e in expr)])
Exemplo n.º 2
0
    def __str__(self):
        node = Node(tuple())
        if self.parse(node) and hasattr(node, 'ruleset'):
            return ''.join( r.__str__() for r in getattr(node, 'ruleset') )

        if self.root.get_opt('warn'):
            warn("Required mixin not found: %s:%d." % ( self.name, len(self.params)))
        return ''
Exemplo n.º 3
0
 def parse(self, target):
     name = str(self.data[1])
     rulesets = self.root.cache['rset'].get(name)
     if rulesets:
         for rul in rulesets:
             for sg in target.selectorgroup:
                 rul.selectorgroup.append(sg.increase(rul.selectorgroup[0]))
     elif self.root.get_opt('warn'):
         warn("Ruleset for extend not found: %s" % name)
Exemplo n.º 4
0
 def value(self):
     try:
         return self.do_expression(self.data, self.ctx)
     except TypeError, e:
         if self.root.get_opt('warn'):
             warn(str(e))