Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: third_party/pyscss/scss/base.py

Issue 9111023: Pyscss is obsolete with Dart CSS complier; remove all pyscss code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove pyparsing from .gitignore Created 8 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/pyscss/scss/__init__.py ('k') | third_party/pyscss/scss/control.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pyscss/scss/base.py
diff --git a/third_party/pyscss/scss/base.py b/third_party/pyscss/scss/base.py
deleted file mode 100644
index ee24e7526498c405a96dbd441c0be5243c5fe62d..0000000000000000000000000000000000000000
--- a/third_party/pyscss/scss/base.py
+++ /dev/null
@@ -1,116 +0,0 @@
-from scss import SORTING
-
-
-class Node(object):
- """ Base class for parsed objects.
- """
- delim = ' '
- root = None
-
- def __init__(self, s, n, t):
- self.num, self.data = n, t
- self.parent = self._ctx = None
-
- def __str__(self):
- return self.delim.join(map(str, self.data))
-
- def __repr__(self):
- return '(%s%s)' % (
- self.__class__.__name__,
- ': %s' % ' '.join(map(repr, self.data)) if self.data else ''
- )
-
- def parse(self, target):
- self.parent = target
-
- def copy(self):
- return self
-
- @property
- def ctx(self):
- if self._ctx:
- return self._ctx
-
- if self.parent:
- return self.parent.ctx
-
- self._ctx = dict()
- return self._ctx
-
- @ctx.setter
- def ctx(self, value):
- self._ctx = value
-
-
-class Empty(Node):
-
- def __str__(self):
- return ''
-
-
-class ParseNode(Node):
-
- def parse(self, target):
- super(ParseNode, self).parse(target)
- for n in self.data:
- if isinstance(n, Node):
- n.parse(self)
-
- def copy(self):
- t = [n.copy() if isinstance(n, Node) else n for n in self.data]
- return self.__class__(None, self.num, t)
-
-
-class ContentNode(ParseNode):
-
- def __init__(self, s, n, t):
- super(ContentNode, self).__init__(s, n, t)
- self.name = self.data[0] if self.data else ''
- self.declareset = []
- self.ruleset = []
-
- def __str__(self):
- # Sort declaration
- if self.root.get_opt('sort'):
- self.declareset.sort(
- key=lambda x: SORTING.get(x.name, 999 ))
-
- nl, ws, ts = self.root.cache['delims']
- semicolon = '' if self.root.cache['opts'].get('compress') else ';'
-
- return ''.join((
-
- # Self
- ''.join((
-
- # Selector tree
- str(self.name),
-
- "{%s%s%s" % (nl, ws, ws) if self.name else '',
-
- # Declarations
- (';%s%s%s' % ( nl, ws, ws )).join(str(d) for d in self.declareset),
-
- semicolon,
-
- '%s}%s%s' % ( nl, nl, nl ) if self.name else ''
-
- )) if self.declareset else '',
-
- # Children
- ''.join(str(r) for r in self.ruleset)
- ))
-
-
-class IncludeNode(ParseNode):
-
- def parse(self, target):
- for node in self.data:
- if isinstance(node, Node):
- node.ctx.update(self.ctx)
- node.parse(target)
-
- def __str__(self):
- node = ContentNode(None, None, [])
- self.parse(node)
- return str(node)
« no previous file with comments | « third_party/pyscss/scss/__init__.py ('k') | third_party/pyscss/scss/control.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698