Coverage for dryxPython.mmd.mmd : 62%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
#!/usr/local/bin/python # encoding: utf-8 mmd.py =========== :Summary: My MMD helpers
:Author: David Young
:Date Created: September 19, 2013
:dryx syntax: - ``_someObject`` = a 'private' object that should only be changed for debugging
:Notes: - If you have any questions requiring this script please email me: d.r.young@qub.ac.uk
:Tasks: @review: when complete add cl commands @review: make internal function private @review: pull all general functions and classes into dryxPython """ ################# GLOBAL IMPORTS ####################
################################################################### # CLASSES # ###################################################################
################################################################### # PUBLIC FUNCTIONS # ################################################################### ## LAST MODIFIED : September 19, 2013 ## CREATED : September 19, 2013 ## AUTHOR : DRYX log, pathToMMDFile, css="amblin"): """convert mmd file to html
**Key Arguments:**
**Return:** - ``pathToHtmlFile`` -- the path to the html file
**Todo** - @review: when complete, clean convert_to_html function - @review: when complete add logging - @review: when complete, decide whether to abstract function to another module """ ################ > IMPORTS ################ ## STANDARD LIB ## ## THIRD PARTY ## ## LOCAL APPLICATION ##
## TEST THE ARGUMENTS
## GRAB THE CSS ## except IOError, e: message = 'could not open the file %s' % (pathToReadFile,) log.critical(message) raise IOError(message)
## MAKE A HEADER IS WRITTEN except IOError, e: message = 'could not open the file %s' % (pathToReadFile,) log.critical(message) raise IOError(message)
thisData = "Filename: %s\n\n%s" % (filenameNoExtension,thisData) pathToWriteFile = pathToMMDFile try: log.debug("attempting to open the file %s" % (pathToWriteFile,)) writeFile = open(pathToWriteFile, 'w') except IOError, e: message = 'could not open the file %s' % (pathToWriteFile,) log.critical(message) raise IOError(message) writeFile.write(thisData) writeFile.close()
except IOError, e: message = 'could not open the file %s' % (pathToReadFile,) log.critical(message) raise IOError(message)
except IOError, e: message = 'could not open the file %s' % (pathToWriteFile,) log.critical(message) raise IOError(message)
################################################################### # PRIVATE (HELPER) FUNCTIONS # ###################################################################
############################################ # CODE TO BE DEPECIATED # ############################################
main()
################################################################### # TEMPLATE FUNCTIONS # ################################################################### |