changeset 4220:56dadd0e5cf7 kallithea-2.2.5-rebrand

db: tweak configuration of branding self references For RhodeCode compatibility: echo "BRAND='rhodecode'" > kallithea/brand.py
author Bradley M. Kuhn <bkuhn@sfconservancy.org>
date Wed, 02 Jul 2014 19:08:36 -0400
parents 24498ba2fbec
children 5b72a0dd966d
files kallithea/__init__.py
diffstat 1 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/__init__.py	Fri May 23 17:36:09 2014 -0400
+++ b/kallithea/__init__.py	Wed Jul 02 19:08:36 2014 -0400
@@ -44,19 +44,22 @@
 # Linked module for extensions
 EXTENSIONS = {}
 
-# SETTINGS_PREFIX is the prefix to use for form fields and database table names.
+# BRAND controls internal references in database and config to the products
+# own name.
+#
+# NOTE: If you want compatibility with a database that was originally created
+#  for use with the RhodeCode software product, change BRAND to "rhodecode",
+#  either by editing here or by creating a new file:
+#  echo "BRAND = 'rhodecode'" > kallithea/brand.py
 
-#  Ideally, SETTINGS_PREFIX would be in an ini file of some sort instead of
-#  in this code.  However, since this is used in kallithea/model/db.py as
-#  part of the database initialization in code that typically runs before
-#  CONFIG (above) is populated with settings from the ini file, it's instead
-#  hard-coded herein.
+BRAND = "kallithea"
+try:
+    from kallithea.brand import BRAND
+except ImportError:
+    pass
 
-SETTINGS_PREFIX = "kallithea_"
-# NOTE: If you want compatibility with a database that was originally created
-#  for use with the Rhodecode software product, changing SETTINGS_PREFIX to
-#  "rhodecode_" might work to make the old database and forms compatible with
-#  this application.
+# Prefix for the ui and settings table names
+SETTINGS_PREFIX = BRAND + "_"
 
 try:
     from kallithea.lib import get_current_revision