root/trunk/dabo/settings.py

Revision 4875, 6.7 kB (checked in by cito, 3 weeks ago)

Fixed #1191 and improved #1185 (sys.getfilesystemencoding() can be None on certain platforms).

  • Property svn:eol-style set to native
Line 
1 # -*- coding: utf-8 -*-
2
3 # Dabo Global Settings
4
5 # Do not modify this file directly. Instead, create a file called
6 # settings_override.py, and copy/paste the settings section below into the
7 # settings_override.py file. This way, when you update Dabo, you won't blow
8 # away your custom tweaks.
9
10 # Note that creating a settings_override.py isn't the only way to tweak the
11 # settings - your custom code can also just make the settings in the dabo
12 # namespace at runtime, eg:
13 #
14 #  import dabo
15 #  dabo.eventLogging = True
16 #  <do stuff>
17 #  dabo.eventLogging = False
18
19 # Also note that settings_override.py is not the appropriate place to put
20 # application-specific settings, although it may seem at first like an easy
21 # place to do so.
22
23
24 ### Settings - begin
25
26 # Do we write info-level messages to stdout?
27 verboseLogging = False
28
29 # Event logging is turned off globally by default for performance reasons.
30 # Set to True (and also set LogEvents on the object(s)) to get logging.
31 eventLogging = False
32
33 # Set the following to True to get all the data in the UI event put into
34 # the dEvent EventData dictionary. Only do that for testing, though,
35 # because it is very expensive from a performance standpoint.
36 allNativeEventInfo = False
37
38 # Set dabo.fastNameSet to True to bypass Dabo's checking to make sure siblings
39 # have unique names, greatly speeding up instantiation of many objects. If you
40 # do this, your code takes responsibility for ensuring that sibling names are
41 # in fact unique. We recommend you leave fastNameSet to False here, and wrap
42 # your object creations around setting it to True. eg:
43 #
44 #   dabo.fastNameSet = True
45 #   for i in range(200):
46 #     self.addObject(dabo.ui.dButton, Name="b_%s" % i)
47 #   dabo.fastNameSet = False
48 fastNameSet = False
49
50
51 # dabo.autoBindEvents is a global flag which determines if events are bound
52 # automatically to callback functions when the object is instantiated. E.g.,
53 # where you used to have to have code like:
54 #
55 #   def initEvents(self):
56 #       self.bindEvent(dEvents.MouseEnter, self.onMouseEnter)
57 #
58 # with autoBindEvents, all you need to do is define the onMouseEnter function,
59 # and Dabo will understand that that function should be called upon the
60 # MouseEnter event. Additionally, if an object has it's RegID set, the form
61 # can have callbacks of the form on<EventName>_<ObjectName>(), which become
62 # the callback function for that event and object. E.g.:
63 #
64 #   def onMouseEnter_cmdOkay(self, evt):
65 #       """This gets called when the mouse enters the okay command button."""
66 #
67 autoBindEvents = True
68
69
70 # If you set MDI to True, then dFormMain and dForm will default to being MDI
71 # parent and MDI child, respectively. IOW, you don't have to change your dForm
72 # and dFormMain subclasses to inherit from dFormChildMDI, etc., but it comes at
73 # the cost of being a global setting. This must be set before dabo.ui is
74 # imported (ie right at the top of your app). Note that you could instead choose
75 # to deal with MDI/SDI explicitly in your form subclasses. IOW:
76 #       class MyForm(dabo.ui.dFormChildMDI)
77 #       class MyForm(dabo.ui.dFormParentMDI)
78 #       class MyForm(dabo.ui.dFormSDI)
79 #
80 # All the MDI setting does is make dFormMain == (dFormMainSDI or dFormMainParentMDI)
81 # and dForm == (dFormSDI or dFormChildMDI)
82 MDI = False
83 # (note: MDI doesn't work at all on Mac as of this writing, and is implemented
84 #        as a pageframe on Linux. I'm almost thinking we should default to True
85 #        on Windows though, because it seems to be the arrangement most users
86 #        expect.)
87
88 # macFontScaling: If you set a font to 10 pt it'll look medium-small on most
89 # Windows and Linux screens. However, it will look very small on Mac because
90 # of automatic conversion in OS X. 8pt fonts on Mac are barely even readable.
91 # Set macFontScaling to True to make your fonts appear the same size on all
92 # platforms.
93 macFontScaling = True
94  
95 # When doing date calculations, displaying calendars, etc., this determines whether
96 # 'Sunday' or 'Monday' is considered the beginning of the week
97 firstDayOfWeek = "Sunday"
98
99 # This setting controls the format that will be used by dDateTextBox controls
100 # to display date values. The available choices are listed.
101 dateFormat = "American"     # MM/DD/YYYY
102 # dateFormat = "YMD"            # YYYY-MM-DD
103 # dateFormat = "European"       # DD.MM.YYYY
104
105 # Default font size when none other is specified
106 defaultFontSize = 10
107
108 # Default language to use when none is specified
109 defaultLanguage = "en"
110
111 # Default encoding to use when none is specified
112 defaultEncoding = "utf-8"
113
114 # Default log file for the dabo.dBug.loggit function
115 loggitFile = "functionCall.log"
116
117 # Does the UI layer (dForm) eat exceptions from the biz layer
118 # such as 'invalid row specified' or bizrule violations and
119 # automatically display an informational message to the user (True),
120 # or does the exception go unhandled so that the developer can
121 # quickly diagnose the issue (False)?
122 eatBizExceptions = True
123  
124 # Check for web updates?
125 checkForWebUpdates = True
126
127 # Date and Time formats. None will use the os user's settings, but
128 # your code can easily override these. Example:
129 #   dabo.settings.dateFormat = "%d.%m.%Y" -> "31.12.2008".
130 dateFormat = None
131 dateTimeFormat = None
132 timeFormat = None
133
134 # Do we load the os user's locale settings automatically?
135 # Pythonista note: this executes:
136 #    locale.setlocale(locale.LC_ALL, '')
137 loadUserLocale = True
138
139 # File extensions understood by the getFile functions. The format is a dictionary, with
140 # the extension as the key, and the descriptive text as the value. To add your own
141 # custom extensions, create a dict with this same format named 'custom_extensions'
142 # in your settings_override file, and those will be added to this list.
143 custom_extensions = {}
144 file_extensions = {
145         "*": "All Files",
146         "py": "Python Scripts",
147         "txt": "Text Files",
148         "log": "Log Files",
149         "fsxml": "Dabo FieldSpec Files",
150         "cnxml": "Dabo Connection Files",
151         "rfxml": "Dabo Report Format Files",
152         "cdxml": "Dabo Class Designer Files",
153         "mnxml": "Dabo Menu Designer Files",
154         "pdf": "PDF Files",
155         "js": "Javascript Files",
156         "html" : "HTML Files",
157         "xml" : "XML Files",
158         "jpg" : "JPEG Images",
159         "jpeg" : "JPEG Images",
160         "gif" : "GIF Images",
161         "tif" : "TIFF Images",
162         "tiff" : "TIFF Images",
163         "png" : "PNG Images",
164         "ico" : "Icon Images",
165         "bmp" : "Bitmap Images",
166         "sh": "Shell Scripts",
167         "zip": "ZIP Files",
168         "tar": "tar Archives",
169         "gz": "gzipped Files",
170         "tgz": "gzipped tar Archives",
171         "mov": "QuickTime Movies",
172         "wmv": "Windows Media Videos",
173         "mpg": "MPEG Videos",
174         "mpeg": "MPEG Videos",
175         "mp3": "mp3 Audio Files",
176 }
177
178 # For file-based data backends such as SQLite, do we allow creating a connection to
179 # a non-existent file, which SQLite will then create?
180 createDbFiles = False
181        
182
183 ### Settings - end
184
185 # Do not copy/paste anything below this line into settings_override.py.
186
187 try:
188     from settings_override import *
189 except ImportError:
190     pass
Note: See TracBrowser for help on using the browser.