Init new application.

When you want to create a new application. This application will be given it's own subfolder in the master folder, and an app.conf is created to hold the application settings. The new app.conf is created by making a dict with your new settings and call setmyappsetting on the existing global settings object.

setmyappsettings parameters

appname The name of the new application to create
myappsettings A dict with your default settings
mypathsfactory None A method that returns the applications own path. De default implementation returns a AppPaths object with only apppath set to the applications directory.
mysettingsfactory None A method that returns the applications own settings. The default implementation returns a MyAppSeetings object with only the defaults set.
myupdatefactory None

App paths defaults

If no app path factory is used, you get the default AppPaths object. This has only one member.

apppath The path to the application folder

App settings defaults

If no app settings factory is used, you get the default MyAppSettings object.

fileversion The version of the structure set or loaded.
expectedversion The current version of new settings.
defaults The default values used if no one set or loaded.
filepath A overriding file path used for loading settings.
settings The dict with the settings.
paths A reference to the application paths (MyAppsPath)
master A reference to the global settings.

App path factory

The app path factory should return a class the has AppPaths as super class. The default implementation of the AppPaths super class is to set the apppath based on either the name or the apppath parameter.

def mypathsfactory(self,appname=None,apppath=None,language='en'):
    return DEReporterPaths(appname=appname,apppath=apppath,language=language)




App settings factory

The app settings factory should return a class the has MyAppSettings as super class.

def mysettingsfactory(self,myappsettings,myapppaths,master):
    return DG3MyAppSettings(settings=myappsettings,paths=myapppaths,master=master)

App update factory

The app update factory takes the apps dict and checks if the structure need an update. The only reason for having it in this app setting method is that i can be uses for swapping setting and that it calls the loadmyappsettings that will run a default method that do updates.

def checkmyappforupate(self,myapp,mysettings):