whitespace cleanup
This commit is contained in:
parent
0e35c9d40f
commit
8dc6137373
5 changed files with 2696 additions and 2694 deletions
5328
scour/scour.py
5328
scour/scour.py
File diff suppressed because it is too large
Load diff
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue