Created
August 10, 2010 22:50
-
-
Save pmuellr/518152 to your computer and use it in GitHub Desktop.
quick little script to convert a colloquy transcript to HTML, kinda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
#----------------------------------------------------------------------------- | |
def main(): | |
iFileNames = sys.argv[1:] | |
for iFileName in iFileNames: | |
oFileName = os.path.basename(iFileName) + ".html" | |
iFile = file(iFileName) | |
iContents = iFile.read() | |
iFile.close() | |
oFile = file(oFileName, "w") | |
oFile.write(css) | |
oFile.write(iContents) | |
oFile.close() | |
print "generated: %s" % (oFileName) | |
#----------------------------------------------------------------------------- | |
css = """ | |
<style> | |
event { | |
display: none; | |
} | |
envelope { | |
display: block; | |
border: thin solid black; | |
background-color: #EEE; | |
margin: 0.3em; | |
padding: 0.3em; | |
-moz-border-radius: 1.0em; | |
-webkit-border-radius: 1.0em; | |
} | |
envelope sender { | |
border: 0 solid red; | |
display: block; | |
font-weight: bold; | |
color: #F0F; | |
margin: 0.0em; | |
padding: 0.2em; | |
background-color: #DDD; | |
-moz-border-radius: 1.0em; | |
-webkit-border-radius: 1.0em; | |
} | |
envelope message { | |
border: 0 solid red; | |
display: block; | |
margin: 0.0em; | |
padding: 0.0em; | |
padding-left: 1.0em; | |
} | |
</style> | |
""" | |
main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment