######
#  Create a file (html or markdown) with the output of
#      - JVMHeap
#      - LogFiles
#      - Ports
#      - Variables
#
#  Author:        Christoph Stoettner
#  Mail:          christoph.stoettner@stoeps.de
#  Documentation: http://scripting101.stoeps.de
#
#  Version:       2.0
#  Date:          2014-06-08
#
#  License:       Apache 2.0
#

# TODO: Create a menu for file selection

import sys
import os.path

filename = raw_input( 'Path and Filename to Documentation file: ' )

sys.stdout = open( filename, "w")

print '# JVM Settings of all AppServers:'
execfile( 'ibmcnx/doc/JVMSettings.py' )

print '# Used Ports:'
execfile( 'ibmcnx/doc/Ports.py' )

print '# LogFile Settgins:'
execfile( 'ibmcnx/doc/LogFiles.py' )

print '# WebSphere Variables'
execfile( 'ibmcnx/doc/Variables.py' )
@@ -489,40 +489,368 @@
  )%0A%0A
-sys.stdout = open( filename, %22w%22
+if (os.path.isfile( fileopen )):%0A            answer = raw_input( %22File exists, Overwrite, Append or Abort? (O%7CA%7CX)%22 ).lower()%0A            if answer == %22o%22:%0A                sys.stdout = open( filename, %22w%22)%0A            elif answer == %22a%22:%0A                sys.stdout = open( filename, %22a%22)%0A            else:%0A                print %22Exit%22%0A                sys.exit(
 )%0A%0Ap

Create script to save documentation to a file