root/projects/2008/pyogp/pyogp.lib.base/branches/kotler_tests/pyogp/lib/base/settings.py

Revision 2487, 6.3 kB (checked in by kotler.linden, 5 months ago)

asset manager updates

Line 
1 class Settings(object):
2
3     def __init__(self, quiet_logging = False):
4         """ some lovely configurable settings
5
6         These are applied application wide, and can be
7         overridden at any time in a specific instance
8         """
9
10         self.quiet_logging = quiet_logging
11
12         #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13         # Application behavior settings
14         #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
16         # default start location to use in login
17         self.DEFAULT_START_LOCATION = 'last'
18
19         # toggle handling udp packets
20         self.HANDLE_PACKETS = True
21
22         # Inventory related
23
24         # enable inventory management
25         self.ENABLE_INVENTORY_MANAGEMENT = True
26
27         # enable accepting inventory offers
28         self.ACCEPT_INVENTORY_OFFERS = False
29
30         # enable library
31         self.ENABLE_LIBRARY = True
32
33         # enable object tracking
34         self.ENABLE_OBJECT_TRACKING = True
35
36         # enable communications monitoring
37         self.ENABLE_COMMUNICATIONS_TRACKING = True
38
39         # toggle parsing all/handled packets
40         self.ENABLE_DEFERRED_PACKET_PARSING = True
41
42         # toggle group chat handling
43         self.ENABLE_GROUP_CHAT = True
44
45         # enable the appearance manager
46         self.ENABLE_APPEARANCE_MANAGEMENT = True
47        
48         # ~~~~~~
49         # Camera
50         # ~~~~~~
51
52         # these defaults are for facing due east
53         self.DEFAULT_CAMERA_DRAW_DISTANCE = 128
54         self.DEFAULT_CAMERA_AT_AXIS = (1.0, 0.0, 0.0)
55         self.DEFAULT_CAMERA_LEFT_AXIS = (0.0, 1.0, 0.0)
56         self.DEFAULT_CAMERA_UP_AXIS = (0.0, 0.0, 1.0)
57
58         #~~~~~~~~~~~~~~~~~~~~~~~
59         # Extended Login Options
60         #~~~~~~~~~~~~~~~~~~~~~~~
61
62         # self.ENABLE_INVENTORY_MANAGEMENT is set above, and triggers the use of these options in the login params
63         self.INVENTORY_LOGIN_OPTIONS = ["inventory-root", "inventory-skeleton", "inventory-skel-lib"]
64
65         # self.ENABLE_LIBRARY is set above, and triggers the use of these options in the login params
66         self.LIBRARY_LOGIN_OPTIONS = ["inventory-lib-root", "inventory-lib-owner"]
67
68         self.ALEXANDRIA_LINDEN = 'ba2a564a-f0f1-4b82-9c61-b7520bfcd09f'
69
70         # ToDo: handle this!
71         self.ENABLE_EXTENDED_LOGIN_OPTIONS = False
72         self.EXTENDED_LOGIN_OPTIONS = ["gestures", "event_categories", "event_notifications", "classified_categories", "buddy_list", "ui-config", "login-flags", "global-textures" ]
73
74         #~~~~~~~~~~~~~~~~~~~
75         # Simulator specific
76         #~~~~~~~~~~~~~~~~~~~
77
78         # toggle handling a region's event queue
79         self.ENABLE_REGION_EVENT_QUEUE = True
80
81         # shall we handle the eq data?
82         self.HANDLE_EVENT_QUEUE_DATA = True
83
84         # how many seconds to wait between polling
85         # a region's event queue
86         self.REGION_EVENT_QUEUE_POLL_INTERVAL = 1
87
88         # allow connecting to multiple simulators
89         self.MULTIPLE_SIM_CONNECTIONS = False
90
91         # enabled the tracking of region parcels
92         self.ENABLE_PARCEL_TRACKING = True
93
94         #~~~~~~~~~~~~~~~~~~~~~~
95         # Agent Domain specific
96         #~~~~~~~~~~~~~~~~~~~~~~
97
98         # toggle handling an agent domain's event queue
99         self.ENABLE_AGENTDOMAIN_EVENT_QUEUE = True
100         # how many seconds to wait between polling
101         # a agent doamins's event queue
102         self.AGENT_DOMAIN_EVENT_QUEUE_POLL_INTERVAL = 15
103
104         #~~~~~~~~~~~~~~~~~~
105         # Logging behaviors
106         #~~~~~~~~~~~~~~~~~~
107         # being a test tool, and an immature one at that,
108         # enable fine granularity in the logging, but
109         # make sure we can tone it down as well
110
111         self.LOG_VERBOSE = True
112         self.ENABLE_BYTES_TO_HEX_LOGGING = False
113         self.ENABLE_CAPS_LOGGING = True
114         self.ENABLE_CAPS_LLSD_LOGGING = False
115         self.ENABLE_EQ_LOGGING = True
116         self.ENABLE_UDP_LOGGING = True
117         self.ENABLE_OBJECT_LOGGING = True
118         self.LOG_SKIPPED_PACKETS = True
119         self.ENABLE_HOST_LOGGING = True
120         self.LOG_COROUTINE_SPAWNS = True
121
122         # allow disabling logging of certain packets
123         self.DISABLE_SPAMMERS = True
124         self.UDP_SPAMMERS = ['PacketAck', 'AgentUpdate']
125
126         # override the defaults
127         if self.quiet_logging:
128             self.LOG_VERBOSE = False
129             self.ENABLE_BYTES_TO_HEX_LOGGING = False
130             self.ENABLE_CAPS_LOGGING = False
131             self.ENABLE_CAPS_LLSD_LOGGING = False
132             self.ENABLE_EQ_LOGGING = False
133             self.ENABLE_UDP_LOGGING = False
134             self.LOG_SKIPPED_PACKETS = False
135             self.ENABLE_OBJECT_LOGGING = False
136             self.ENABLE_HOST_LOGGING = False
137             self.LOG_COROUTINE_SPAWNS = False
138
139         #~~~~~~~~~~~~~~~~~~~~~~
140         # Test related settings
141         #~~~~~~~~~~~~~~~~~~~~~~
142
143         self.ENABLE_LOGGING_IN_TESTS = True
144
145     # parameters for xmplrpc login
146     def get_default_xmlrpc_login_parameters(self):
147         """ returns some default login params """
148
149         login_options = []
150
151         if self.ENABLE_INVENTORY_MANAGEMENT:
152             for option in self.INVENTORY_LOGIN_OPTIONS:
153                 login_options.append(option)
154
155         if self.ENABLE_LIBRARY:
156             for option in self.LIBRARY_LOGIN_OPTIONS:
157                 login_options.append(option)
158
159         if self.ENABLE_EXTENDED_LOGIN_OPTIONS:
160             for option in self.EXTENDED_LOGIN_OPTIONS:
161                 login_options.append(option)
162
163         params = {   
164             'major': '1',
165             'minor': '22',
166             'patch': '9',
167             'build': '1',
168             'platform': 'Win',
169             'options': login_options,
170             'user-agent': 'pyogp 0.1',
171             'id0': '',
172             'viewer_digest': '09d93740-8f37-c418-fbf2-2a78c7b0d1ea',
173             'version': 'pyogp 0.1',
174             'channel': 'pyogp',
175             'mac': '',
176             'agree_to_tos': True,
177             'read_critical': True
178         }
179
180         return params
181
182 """
183 Contributors can be viewed at:
184 http://svn.secondlife.com/svn/linden/projects/2008/pyogp/CONTRIBUTORS.txt
185
186 $LicenseInfo:firstyear=2008&license=apachev2$
187
188 Copyright 2009, Linden Research, Inc.
189
190 Licensed under the Apache License, Version 2.0 (the "License").
191 You may obtain a copy of the License at:
192     http://www.apache.org/licenses/LICENSE-2.0
193 or in
194     http://svn.secondlife.com/svn/linden/projects/2008/pyogp/LICENSE.txt
195
196 $/LicenseInfo$
197 """
198
Note: See TracBrowser for help on using the browser.