1. Arne Babenhauserheide
  2. babtools-misc

Source

babtools-misc / babtools_EXAMPLE.py

#!/usr/bin/env python
# encoding: utf-8

#    babtools_EXAMPLE - Example structure for babtools. 
# 
#    Copyright © 2008 Arne Babenhauserheide
# 
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>

"""babtools_EXAMPLE - Example structure for babtools.
 

Usage: 
 - babscript.py 
  
   for default usage, or 
   
 - babscript.py --help
   
   for getting help
  

Examples: 
  - babscript.py
    
    Print the help message, since we have nothing else to do right now. 


Plans: 
  - None. At the moment I'm happy with this structure.


Ideas: 
  - Adding information, how to use Mercurial to use this structure in your own project and keep it up to date while keeping your changes. 
  - Get the version information from the Changelog. -> i.e.: First line.split()[-1] => One less point where I have to change things when updating. 


Source URL (Mercurial): U{http://freehg.org/u/ArneBab/babtools_EXAMPLE/}

PyPI URL: U{http://pypi.python.org/pypi/babtools_EXAMPLE}
"""

__version__ = "0.9"

def read_changelog():
    """Read and return the Changelog"""
    try: 
        f = open("Changelog.txt", "r")
        log = f.read()
        f.close()
    except: 
        log = ""
    return log

__changelog__ = "Changelog: \n\n" + read_changelog()


#### Self-Test ####

def _test(): 
    from doctest import testmod
    testmod()

if __name__  == "__main__": 
    
    from sys import argv
    _test()