Back to index

plone3  3.1.7
Functions | Variables
compress Namespace Reference

Functions

def strip

Variables

tuple one_line_comment = re.compile(r'^\s*//.*$', re.M)
tuple trailing_comment = re.compile(r'//(\w|\s)*$', re.M)
tuple multi_line_comment = re.compile(r'^\s*/\*.*?\*/', re.M | re.S)
tuple whitespace_after_separator = re.compile(r';\s*', re.M | re.S)
tuple whitespace_after_opening_bracket = re.compile(r'{\s*', re.M | re.S)
tuple starting_whitespace = re.compile(r'^\s*', re.M | re.S)
tuple data = open(file)

Function Documentation

def compress.strip (   data)
Processes the data, removing comments and unecessary whitespace.

Definition at line 27 of file compress.py.

00027 
00028 def strip(data):
00029     """Processes the data, removing comments and unecessary whitespace."""
00030     data = one_line_comment.sub('', data)
00031     data = trailing_comment.sub('', data)
00032     data = multi_line_comment.sub('', data)
00033     data = whitespace_after_separator.sub(';', data)
00034     data = whitespace_after_opening_bracket.sub('{', data)
00035     data = starting_whitespace.sub('', data)
00036     return data.strip()


Variable Documentation

tuple compress.data = open(file)

Definition at line 38 of file compress.py.

tuple compress.multi_line_comment = re.compile(r'^\s*/\*.*?\*/', re.M | re.S)

Definition at line 22 of file compress.py.

tuple compress.one_line_comment = re.compile(r'^\s*//.*$', re.M)

Definition at line 20 of file compress.py.

tuple compress.starting_whitespace = re.compile(r'^\s*', re.M | re.S)

Definition at line 25 of file compress.py.

tuple compress.trailing_comment = re.compile(r'//(\w|\s)*$', re.M)

Definition at line 21 of file compress.py.

tuple compress.whitespace_after_opening_bracket = re.compile(r'{\s*', re.M | re.S)

Definition at line 24 of file compress.py.

tuple compress.whitespace_after_separator = re.compile(r';\s*', re.M | re.S)

Definition at line 23 of file compress.py.