Permalink
Browse files

Created a second test file and added file writing

  • Loading branch information...
1 parent 8300dd5 commit 6c0bd759a5806c93849f097ebb0f108a2ba1aad0 @liquidise committed Jan 1, 2012
Showing with 8 additions and 6 deletions.
  1. +3 −0 README.md
  2. +5 −6 isCSS.py
View
@@ -7,6 +7,9 @@ isCSS (inline style CSS) is a parser and compiler that parses inline styles in a
The HTML file is edited to replace all inline styles with their new CSS classes
+Usage
+-----
+
Dependancies
------------
* BeautifulSoup
View
@@ -19,11 +19,9 @@ def printCSS( name, styles ):
args.add_argument( "--html", required = True )
args.add_argument( "--css", required = False )
-htmlPath = args.parse_args().html
-cssPath = args.parse_args().css
-
-htmlF = open( htmlPath, "r+" )
+htmlF = open( args.parse_args().html, "r+" )
+cssPath = args.parse_args().css
if cssPath:
cssF = open( cssPath, "r+" )
@@ -44,11 +42,12 @@ def printCSS( name, styles ):
count += 1
if "class" in element:
- element['class'] += newClassName
+ print element['class']
+ element['class'] += " " + newClassName
else:
element['class'] = newClassName
printCSS( newClassName, styles )
del element['style']
-print soup
+htmlF.write( str(soup) )

0 comments on commit 6c0bd75

Please sign in to comment.