annotate kallithea/__init__.py @ 5376:0ad053c172fa

cleanup: make module self-naming consistent The self naming is quite pointless ... but at least make it right.
author Mads Kiilerich <madski@unity3d.com>
date Tue, 11 Aug 2015 12:39:07 +0200
parents 72e0fe2e3278
children 23f8f477ed35
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
807
e8c9ff1da9ba added revision into version for beta
Marcin Kuzminski <marcin@python-works.com>
parents: 710
diff changeset
1 # -*- coding: utf-8 -*-
1206
a671db5bdd58 fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents: 1205
diff changeset
2 # This program is free software: you can redistribute it and/or modify
a671db5bdd58 fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents: 1205
diff changeset
3 # it under the terms of the GNU General Public License as published by
a671db5bdd58 fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents: 1205
diff changeset
4 # the Free Software Foundation, either version 3 of the License, or
a671db5bdd58 fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents: 1205
diff changeset
5 # (at your option) any later version.
1203
6832ef664673 source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents: 1194
diff changeset
6 #
252
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 246
diff changeset
7 # This program is distributed in the hope that it will be useful,
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 246
diff changeset
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 246
diff changeset
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 246
diff changeset
10 # GNU General Public License for more details.
1203
6832ef664673 source code cleanup: remove trailing white space, normalize file endings
Marcin Kuzminski <marcin@python-works.com>
parents: 1194
diff changeset
11 #
252
3782a6d698af licensing updates, code cleanups
Marcin Kuzminski <marcin@python-works.com>
parents: 246
diff changeset
12 # You should have received a copy of the GNU General Public License
1206
a671db5bdd58 fixed license issue #149
Marcin Kuzminski <marcin@python-works.com>
parents: 1205
diff changeset
13 # along with this program. If not, see <http://www.gnu.org/licenses/>.
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
14 """
5376
0ad053c172fa cleanup: make module self-naming consistent
Mads Kiilerich <madski@unity3d.com>
parents: 5305
diff changeset
15 kallithea
0ad053c172fa cleanup: make module self-naming consistent
Mads Kiilerich <madski@unity3d.com>
parents: 5305
diff changeset
16 ~~~~~~~~~
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
17
4212
24c0d584ba86 General renaming to Kallithea
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4211
diff changeset
18 Kallithea, a web based repository management based on pylons
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
19 versioning implementation: http://www.python.org/dev/peps/pep-0386/
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
20
4211
1948ede028ef RhodeCode GmbH is not the sole author of this work
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4208
diff changeset
21 This file was forked by the Kallithea project in July 2014.
1948ede028ef RhodeCode GmbH is not the sole author of this work
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4208
diff changeset
22 Original author and date, and relevant copyright and licensing information is below:
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
23 :created_on: Apr 9, 2010
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
24 :author: marcink
4219
24498ba2fbec SETTINGS_PREFIX for identifiers (e.g., db table names) incl. project's name.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4212
diff changeset
25 :copyright: (c) 2013 RhodeCode GmbH, (C) 2014 Bradley M. Kuhn, and others.
4208
ad38f9f93b3b Correct licensing information in individual files.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4187
diff changeset
26 :license: GPLv3, see LICENSE.md for more details.
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
27 """
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
28
1964
b1ad9efeec14 fixed requires files, added distinction on win vs other platforms
Marcin Kuzminski <marcin@python-works.com>
parents: 1903
diff changeset
29 import sys
1118
b0e2c949c34b Fixed Windows installation based on work of Mantis406 fork: "Replace py-bcrypt to make Windows installation easier"
Marcin Kuzminski <marcin@python-works.com>
parents: 902
diff changeset
30 import platform
185
3380ca40cdba added version generation to pylons_app and showed it into template. Propagated baseController with some data for acces into each controller. Fixed simplehg middleware to get proper name of application
Marcin Kuzminski <marcin@python-works.com>
parents: 0
diff changeset
31
5224
2906653151bf release: update version number to 0.2.2
Mads Kiilerich <madski@unity3d.com>
parents: 5012
diff changeset
32 VERSION = (0, 2, 2)
3797
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3714
diff changeset
33 BACKENDS = {
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3714
diff changeset
34 'hg': 'Mercurial repository',
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3714
diff changeset
35 'git': 'Git repository',
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3714
diff changeset
36 }
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3714
diff changeset
37
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3714
diff changeset
38 CELERY_ON = False
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3714
diff changeset
39 CELERY_EAGER = False
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3714
diff changeset
40
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3714
diff changeset
41 # link to config for pylons
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3714
diff changeset
42 CONFIG = {}
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3714
diff changeset
43
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3714
diff changeset
44 # Linked module for extensions
d7488551578e synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents: 3714
diff changeset
45 EXTENSIONS = {}
2136
b70721d03e84 pep386 versioning
Marcin Kuzminski <marcin@python-works.com>
parents: 2135
diff changeset
46
4220
56dadd0e5cf7 db: tweak configuration of branding self references
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4219
diff changeset
47 # BRAND controls internal references in database and config to the products
56dadd0e5cf7 db: tweak configuration of branding self references
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4219
diff changeset
48 # own name.
56dadd0e5cf7 db: tweak configuration of branding self references
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4219
diff changeset
49 #
56dadd0e5cf7 db: tweak configuration of branding self references
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4219
diff changeset
50 # NOTE: If you want compatibility with a database that was originally created
56dadd0e5cf7 db: tweak configuration of branding self references
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4219
diff changeset
51 # for use with the RhodeCode software product, change BRAND to "rhodecode",
56dadd0e5cf7 db: tweak configuration of branding self references
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4219
diff changeset
52 # either by editing here or by creating a new file:
56dadd0e5cf7 db: tweak configuration of branding self references
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4219
diff changeset
53 # echo "BRAND = 'rhodecode'" > kallithea/brand.py
4219
24498ba2fbec SETTINGS_PREFIX for identifiers (e.g., db table names) incl. project's name.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4212
diff changeset
54
4220
56dadd0e5cf7 db: tweak configuration of branding self references
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4219
diff changeset
55 BRAND = "kallithea"
56dadd0e5cf7 db: tweak configuration of branding self references
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4219
diff changeset
56 try:
56dadd0e5cf7 db: tweak configuration of branding self references
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4219
diff changeset
57 from kallithea.brand import BRAND
56dadd0e5cf7 db: tweak configuration of branding self references
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4219
diff changeset
58 except ImportError:
56dadd0e5cf7 db: tweak configuration of branding self references
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4219
diff changeset
59 pass
4219
24498ba2fbec SETTINGS_PREFIX for identifiers (e.g., db table names) incl. project's name.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4212
diff changeset
60
4220
56dadd0e5cf7 db: tweak configuration of branding self references
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4219
diff changeset
61 # Prefix for the ui and settings table names
4221
5b72a0dd966d db: introduce DB_PREFIX ... and let it be empty by default
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4220
diff changeset
62 DB_PREFIX = (BRAND + "_") if BRAND != "kallithea" else ""
4219
24498ba2fbec SETTINGS_PREFIX for identifiers (e.g., db table names) incl. project's name.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4212
diff changeset
63
4222
f5c9018a5cf0 db: introduce EXTERN_TYPE_INTERNAL for Users.extern_type and .extern_name value for auth type for internal users
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4221
diff changeset
64 # Users.extern_type and .extern_name value for local users
f5c9018a5cf0 db: introduce EXTERN_TYPE_INTERNAL for Users.extern_type and .extern_name value for auth type for internal users
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4221
diff changeset
65 EXTERN_TYPE_INTERNAL = BRAND if BRAND != 'kallithea' else 'internal'
f5c9018a5cf0 db: introduce EXTERN_TYPE_INTERNAL for Users.extern_type and .extern_name value for auth type for internal users
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4221
diff changeset
66
4223
400fbab35389 db: introduce DB_MIGRATIONS to handle the db_migrate version which has the product name in the key.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4222
diff changeset
67 # db_migrate_version.repository_id value, same as kallithea/lib/dbmigrate/migrate.cfg
400fbab35389 db: introduce DB_MIGRATIONS to handle the db_migrate version which has the product name in the key.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4222
diff changeset
68 DB_MIGRATIONS = BRAND + "_db_migrations"
400fbab35389 db: introduce DB_MIGRATIONS to handle the db_migrate version which has the product name in the key.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4222
diff changeset
69
2136
b70721d03e84 pep386 versioning
Marcin Kuzminski <marcin@python-works.com>
parents: 2135
diff changeset
70 try:
4186
7e5f8c12a3fc First step in two-part process to rename directories to kallithea.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4184
diff changeset
71 from kallithea.lib import get_current_revision
3960
5293d4bbb1ea Merged dev into stable/default/master branch
Marcin Kuzminski <marcin@python-works.com>
parents: 3857 3906
diff changeset
72 _rev = get_current_revision(quiet=True)
2171
28d9893d6a23 add dev version only for beta
Marcin Kuzminski <marcin@python-works.com>
parents: 2170
diff changeset
73 if _rev and len(VERSION) > 3:
5305
72e0fe2e3278 cleanup: remove unnecessary '%s'%s formatting
Mads Kiilerich <madski@unity3d.com>
parents: 5224
diff changeset
74 VERSION += (_rev[0],)
2136
b70721d03e84 pep386 versioning
Marcin Kuzminski <marcin@python-works.com>
parents: 2135
diff changeset
75 except ImportError:
b70721d03e84 pep386 versioning
Marcin Kuzminski <marcin@python-works.com>
parents: 2135
diff changeset
76 pass
b70721d03e84 pep386 versioning
Marcin Kuzminski <marcin@python-works.com>
parents: 2135
diff changeset
77
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
78 __version__ = ('.'.join((str(each) for each in VERSION[:3])))
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
79 __dbversion__ = 31 # defines current db version for migrations
1118
b0e2c949c34b Fixed Windows installation based on work of Mantis406 fork: "Replace py-bcrypt to make Windows installation easier"
Marcin Kuzminski <marcin@python-works.com>
parents: 902
diff changeset
80 __platform__ = platform.system()
1205
f4807acf643d added __license__ into main of rhodecode, PEP8ify
Marcin Kuzminski <marcin@python-works.com>
parents: 1203
diff changeset
81 __license__ = 'GPLv3'
1964
b1ad9efeec14 fixed requires files, added distinction on win vs other platforms
Marcin Kuzminski <marcin@python-works.com>
parents: 1903
diff changeset
82 __py_version__ = sys.version_info
4211
1948ede028ef RhodeCode GmbH is not the sole author of this work
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4208
diff changeset
83 __author__ = "Various Authors"
4184
48ad84558fb4 Change project URL - use kallithea-scm.org
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 4116
diff changeset
84 __url__ = 'https://kallithea-scm.org/'
185
3380ca40cdba added version generation to pylons_app and showed it into template. Propagated baseController with some data for acces into each controller. Fixed simplehg middleware to get proper name of application
Marcin Kuzminski <marcin@python-works.com>
parents: 0
diff changeset
85
3892
3a1cf70e0f42 Fix check statements from () which had no effect really
Marcin Kuzminski <marcin@python-works.com>
parents: 3797
diff changeset
86 is_windows = __platform__ in ['Windows']
2634
4b17216f2110 Deprecated validation of operating system, we just care if it's windows, let approve all other
Marcin Kuzminski <marcin@python-works.com>
parents: 2563
diff changeset
87 is_unix = not is_windows
4116
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
88
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
89 if len(VERSION) > 3:
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
90 __version__ += '.'+VERSION[3]
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
91
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
92 if len(VERSION) > 4:
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
93 __version__ += VERSION[4]
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
94 else:
ffd45b185016 Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents: 3972
diff changeset
95 __version__ += '0'