whitespace cleanup

This commit is contained in:
Tobias Oberstein 2013-10-26 16:43:39 +02:00
parent 0e35c9d40f
commit 8dc6137373
5 changed files with 2696 additions and 2694 deletions

File diff suppressed because it is too large Load diff

View file

@ -149,8 +149,8 @@ class SVGTransformationParser(object):
commands = []
token = next()
while token[0] is not EOF:
command, token = self.rule_svg_transform(next, token)
commands.append(command)
command, token = self.rule_svg_transform(next, token)
commands.append(command)
return commands
def rule_svg_transform(self, next, token):

View file

@ -49,24 +49,24 @@
# | '(' S* any* ')' | '[' S* any* ']' ] S*;
def parseCssString(str):
rules = []
# first, split on } to get the rule chunks
chunks = str.split('}')
for chunk in chunks:
# second, split on { to get the selector and the list of properties
bits = chunk.split('{')
if len(bits) != 2: continue
rule = {}
rule['selector'] = bits[0].strip()
# third, split on ; to get the property declarations
bites = bits[1].strip().split(';')
if len(bites) < 1: continue
props = {}
for bite in bites:
# fourth, split on : to get the property name and value
nibbles = bite.strip().split(':')
if len(nibbles) != 2: continue
props[nibbles[0].strip()] = nibbles[1].strip()
rule['properties'] = props
rules.append(rule)
return rules
rules = []
# first, split on } to get the rule chunks
chunks = str.split('}')
for chunk in chunks:
# second, split on { to get the selector and the list of properties
bits = chunk.split('{')
if len(bits) != 2: continue
rule = {}
rule['selector'] = bits[0].strip()
# third, split on ; to get the property declarations
bites = bits[1].strip().split(';')
if len(bites) < 1: continue
props = {}
for bite in bites:
# fourth, split on : to get the property name and value
nibbles = bite.strip().split(':')
if len(nibbles) != 2: continue
props[nibbles[0].strip()] = nibbles[1].strip()
rule['properties'] = props
rules.append(rule)
return rules

View file

@ -20,7 +20,7 @@ from setuptools import setup, find_packages
setup (
name = 'scour',
version = '0.26',
version = '0.27',
description = 'Scour SVG Optimizer',
long_description = open("README.md").read(),
license = 'Apache License 2.0',