Settings.py

From Dabo Wiki
Revision as of 16:16, 17 May 2020 by Ed (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

What it is

There is a file in the main directory of the dabo module named settings.py; it contains many settings that control the behavior of the framework. It should never be modified; instead, if a setting needs to be changed, create a settings_override.py file and make your changes there.

The Most Common Settings

allNativeEventInfo: Only needed if you are are developing UI wrappings for the framework. Never needed in application development. Default: False
autoBindEvents: Dabo will automatically detect methods whose names begin with the letters on, followed by the name of an event class, and if found, will automatically bind that method to the event. Example: if your class has a method named onHit(), Dabo will assume that it is an event handler for the Hit method, and bind that method to Hit events. While this is desireable behavior most of the time, you may occasionally need to turn it off if you need (or want) more explicit control. Default: True
checkForWebUpdates: If you have the general Dabo package installed (i.e., not from Subversion), Dabo will regularly check for updates and ask if you want any updates installed. Default: True
createDbFiles: When using SQLite, if you create a connection to a file that does not exist, Dabo will raise an error. You can override that behavior by changing this setting to True. Default: False
cryptoKeyDES: If you are using the PyCrypto package for creating encrypted ciphers, you need to set this to a string that will be used to encrypt and decrypt the cipher values. If you do use this, keep this value confidential, or anyone could potentially decrypt your ciphertext passwords. Default: None
custom_extensions: Dabo defines several file types and common descriptions. If you want to add additional values for custom file types your app needs, define them in this dictionary, with the extension as the key and the desciption as the value. Default: {}
dateFormat: Custom format for date values. If set to None, the current locale settings will be used. Default: None
dateTimeFormat: Custom format for datetime values. If set to None, the current locale settings will be used. Default: None
defaultEncoding: When non-ASCII values are encountered, this determines what encoding shall be used to store values where strings are needed. Default: "utf-8"
defaultFontSize: A common base for displayed fonts. If you need a larger/smaller font size across the board, set it here. Default: 10
defaultLanguage: Used in the localization code. Change this if you work in something other than English. Default: "en"
firstDayOfWeek: When showing calendars, this controls the day of week displayed in the leftmost column. Default: "Sunday"
loadUserLocale: Normally True should work fine, but if you have custom locale needs that you want to handle explicitly, set this to False. Default: True
MDI: Multiple Document Interface; common in Windows, in which multiple child documents are displayed within a single parent frame. If you want this behavior, change this to True. Default: False
timeFormat: Custom format for time values. If set to None, the current locale settings will be used. Default: None
verboseLogging: Dabo logs many messages, but only those for the error log display. If you set verboseLogging to True, though, you will get all the info level messages too. Default: False

Rarely-used Settings

allNativeEventInfo: Only needed if you are are developing UI wrappings for the framework. Never needed in application development. Default: False
eatBizExceptions: If you need to override the default behavior of having the form class handle business object exceptions, change this to False. Default: True
eventLogging: Used to turn on global event logging. You also need to set the LogEvents property of the object in question to a list of the string name of the events you wish to log. Default: False
fastNameSet: Objects in a UI should have unique names. Dabo has code to check the name of each object, and if not explicitly set, adds an integer suffix to guarantee uniquess. However, in complex UIs with many objects, this can add substantial overhead. If you can guarantee that your code will result in unique names, set this to True, and the framework will not check for uniqueness, speeding up instantiation. Default: False
loggitFile: Dabo has a @loggit decorator that records function calls to any method with this decorator. You can control the log location with this setting. Default: "functionCall.log"
macFontScaling: Font sizes that look correct in Windows and Linux look very small on Mac. Dabo handles that by automatically scaling your fonts bigger when run on a Mac, but if you don't want this behavior, set this to False. Default: True
webupdate_urlbase: The URL used for the web update server. This should never change, and if it does, the new URL will have to be included in the previous update. Default: "http://daboserver.com/webupdate"