Ejemplo n.º 1
0
			def main(self, text):
				logger = mylogging.getLogger(__name__)
				logger.send_email("my message", "my subject")
				return text		
Ejemplo n.º 2
0
class MyProgram(myapp.MyApp):
    def main(self, <myargs>):
        # my code here
        
if __name__ == "__main__":
    return MyProgram.run(<myargs>)
"""


import os, glob, sys
from os.path import basename, splitext, join, dirname

from myPyApps import myconfig, mylogging, myargparse

LOGGER = mylogging.getLogger(__name__)

class MyApp():
    """
    Parent class to construct my application from.
    
    Inherit from this class, then override the 'main()' function with any arguments you want.
    Then run the application by calling the 'run()' function with the appropriate main arguments.
    """
    
    def __init__(self, config_default=splitext(basename(sys.argv[0]))[0], 
                 config_path=myconfig.DEFAULT_PATH, 
                 config_filter=[],
                 logging_email=True, 
                 options={}):
        """