#!/usr/pkg/bin/python2.7

import os
from pytemplate import PyTemplate
	
__version__= "0.1.0"

class MyProgram(PyTemplate):
    def __init__(self):
	""" 
	program initialization 
	"""
	self.version=__version__
        PyTemplate.__init__(self)
	# Set the version used by predefined --version option
	# A way to add an new option, help value will be displayed in usage function
	# Don't forget to create the associated load_joy method
	self.parser.add_option("-j","--joy",help="here is joy!")

    def load_joy(self,args):
	""" Implements the joy option """
	return

    def load_fullconfig(self,args):
	""" Load your configuration file here """
	if os.path.isfile(args):
		self.lprint("your configuraton file is "+args)
	return

    def loadparams(self,args):
	""" use params sent to program """
	return

    def main(self):
	try:
	    """ Here are a few example for message display and log """	
            self.lprint("message not displayed if -q option used and not logged.",False,False)
            self.lprint("message displayed even if -q option and not logged.",True,False)
            self.lprint("message not displayed if -q option and logged.",False,True)
            self.lprint("message displayed even it -q option and logged.",True,True)
            self.errprint("message error example, always logged")
	except Exception,e:
		print e

if __name__ == '__main__':
    try:
        prog = MyProgram()
        prog.run()
    except Exception, e:
	print e




