Changeset 43
- Timestamp:
- 08/26/06 00:04:49 (2 years ago)
- Files:
-
- trunk/etc/domainmodel.conf.new (modified) (3 diffs)
- trunk/setup.py (modified) (1 diff)
- trunk/src/dm/dictionary.py (modified) (1 diff)
- trunk/src/dm/environment.py (modified) (4 diffs)
- trunk/src/dm/filesystem.py (modified) (1 diff)
- trunk/src/dm/view/basetest.py (modified) (3 diffs)
- trunk/src/dm/view/registry.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/etc/domainmodel.conf.new
r40 r43 1 ## Please Note: This file is a meant as a starting point for a configuration file for a 2 new dm application. It is also used to setup development of the dm package. 3 1 4 [DEFAULT] 2 5 # service_name: 3 # * name of the service being provided 4 service_name = Model Domain6 # * name of the service being provided (defaults to system name) 7 #service_name = Model Domain 5 8 6 9 # system_mode: 7 10 # * whether e.g. in production or development mode 8 11 # * valid values: production (default) | development 9 system_mode = development 12 #system_mode = production 10 13 11 14 # system_name: … … 16 19 17 20 # plugin_data_dir: 18 # * path to service's plugins' variable data directory21 # * path to plugin filesystems 19 22 plugin_data_dir = /tmp/domainmodel_testing/plugin_data 20 23 … … 107 110 # * secret key (used for generating secure session keys) 108 111 # * NB: make sure your service's secret_key is different from the default 109 # * type one random character (no spaces) for each '#' character in the line: 110 secret_key = (*Y£F@{£FHW$Rli(EFH(*SEHF(&9S(P&SYGDF(&G9Ged9f7gs 112 secret_key = (*YZF@{ZFHW$Rli(EFH(*SEHF(&9S(P&SYGDF(&G9Ged9f7gs 111 113 112 114 trunk/setup.py
r30 r43 19 19 long_description = \ 20 20 """ 21 Domain model provides a framework for enterprise applications.21 DomainModel provides a framework for enterprise software applications. 22 22 """, 23 23 package_dir = {'': 'src'}, 24 24 packages = getPackages(os.path.join(basePath, 'src')), 25 data_files=[26 ('share/dm/etc', ['etc/kforge.conf.new']),27 ] + getDataFiles(28 'share/dm/www/media', basePath, 'src/dm/django/media'29 ) + getDataFiles(30 'share/dm/templates', basePath, 'src/dm/django/templates'31 )32 25 ) 33 26 trunk/src/dm/dictionary.py
r35 r43 29 29 30 30 def setDefaultWords(self): 31 self[PYTHONPATH] = os.environ.get('PYTHONPATH', '') 32 self[SYSTEM_NAME] = self.getSystemName() 33 self[SYSTEM_MODE] = 'production' 34 self[SYSTEM_VERSION] = self.getSystemVersion() 35 self[VISITOR_NAME] = 'visitor' 36 self[VISITOR_ROLE] = 'Visitor' 31 self[PYTHONPATH] = os.environ.get('PYTHONPATH', '') 32 self[SYSTEM_NAME] = self.getSystemName() 33 self[SYSTEM_SERVICE_NAME] = self[SYSTEM_NAME] 34 self[SYSTEM_MODE] = 'production' 35 self[SYSTEM_VERSION] = self.getSystemVersion() 36 self[VISITOR_NAME] = 'visitor' 37 self[VISITOR_ROLE] = 'Visitor' 37 38 self[INITIAL_PERSON_ROLE] = 'Visitor' 38 39 self[PLUGIN_PACKAGE_NAME] = 'dm.plugin' 39 self[CAPTCHA_IS_ENABLED] = '' # False (ConfigParser only supports str)40 self[AUTH_COOKIE_NAME] = '%s_auth' % self[SYSTEM_NAME]40 self[CAPTCHA_IS_ENABLED] = '' # False (ConfigParser only supports str) 41 self[AUTH_COOKIE_NAME] = '%s_auth' % self[SYSTEM_NAME] 41 42 self[NO_AUTH_COOKIE_NAME] = '%s_no_auth' % self[SYSTEM_NAME] 42 43 trunk/src/dm/environment.py
r39 r43 3 3 4 4 class SystemEnvironment(object): 5 "Boundary object encapsulating environment variables." 5 6 6 7 DJANGO_SETTINGS_MODULE = 'DJANGO_SETTINGS_MODULE' … … 14 15 15 16 def assertDjangoSettingsModule(self): 16 "Raises exception if DJANGO_SETTINGS_MODULE isnot set in environment."17 "Raises exception if DJANGO_SETTINGS_MODULE not set in environment." 17 18 name = self.DJANGO_SETTINGS_MODULE 18 19 if name in os.environ: … … 30 31 raise "%(name)s value in environment not valid: '%(value)'" 31 32 32 def getConfigFilePathEnvironmentVariableName(self):33 name = self.systemName.upper() + '_SETTINGS'34 return name35 36 33 def getConfigFilePath(self): 37 "Read system configuration pathfrom environment variable."34 "Reads path to system's configuration file from environment variable." 38 35 name = self.getConfigFilePathEnvironmentVariableName() 39 36 if name in os.environ: … … 42 39 message = "Environment variable '%s' not set." % name 43 40 raise EnvironmentError, message 44 # if not os.path.isfile(path):45 # message = 'System service files not found at: %s' % path46 # raise EnvironmentError, message47 41 return path 42 43 def getConfigFilePathEnvironmentVariableName(self): 44 name = self.systemName.upper() + '_SETTINGS' 45 return name 48 46 trunk/src/dm/filesystem.py
r39 r43 10 10 11 11 def getPluginPath(self, plugin): 12 """ 13 Get base path for plugin data 14 Use this only for common plugin data (service data should be going in 15 project specific directory, see getProjectPluginPath) 16 """ 17 return os.path.join( 18 self.pluginDataPath, 19 plugin.name 20 ) 12 "Returns path of directory containing plugin filesystems." 13 return os.path.join(self.pluginDataPath, plugin.name) 21 14 trunk/src/dm/view/basetest.py
r28 r43 12 12 unittest.makeSuite(TestAbstractInstanceView), 13 13 unittest.makeSuite(TestAbstractFormView), 14 unittest.makeSuite(TestAbstractHasManyView), 14 15 unittest.makeSuite(TestAbstractListView), 15 16 unittest.makeSuite(TestAbstractSearchView), … … 37 38 38 39 class MockAbstractFormView(MockView, AbstractFormView): 40 pass 41 42 class MockAbstractHasManyView(MockView, AbstractHasManyView): 39 43 pass 40 44 … … 203 207 204 208 209 class TestAbstractHasManyView(ViewTestCase): 210 211 viewClass = MockAbstractHasManyView 212 requiredResponseClassName = 'HttpResponseRedirect' 213 requiredRedirect = '/login/' 214 215 205 216 class TestAbstractListView(ViewTestCase): 206 217 trunk/src/dm/view/registry.py
r29 r43 158 158 return fieldNames 159 159 160 def getAssociationObject(self): 160 def getAssociationObject(self): # smell: refused bequest 161 161 return None 162 162
