Mercurial > kallithea
annotate kallithea/lib/__init__.py @ 4208:ad38f9f93b3b kallithea-2.2.5-rebrand
Correct licensing information in individual files.
The top-level license file is now LICENSE.md.
Also, in various places where there should have been joint copyright holders
listed, a single copyright holder was listed. It does not appear easy to add
a link to a large list of copyright holders in these places, so it simply
refers to the fact that various authors hold copyright.
In future, if an easy method is discovered to link to a list from those
places, we should do so.
Finally, text is added to LICENSE.md to point to where the full list of
copyright holders is, and that Kallithea as a whole is GPLv3'd.
author | Bradley M. Kuhn <bkuhn@sfconservancy.org> |
---|---|
date | Wed, 21 May 2014 16:59:37 -0400 |
parents | d1addaf7a91e |
children | 1948ede028ef |
rev | line source |
---|---|
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
1 # -*- coding: utf-8 -*- |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
2 # This program is free software: you can redistribute it and/or modify |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
3 # it under the terms of the GNU General Public License as published by |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
4 # the Free Software Foundation, either version 3 of the License, or |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
5 # (at your option) any later version. |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
6 # |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
7 # This program is distributed in the hope that it will be useful, |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
10 # GNU General Public License for more details. |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
11 # |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
12 # You should have received a copy of the GNU General Public License |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
13 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
14 """ |
4186
7e5f8c12a3fc
First step in two-part process to rename directories to kallithea.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4116
diff
changeset
|
15 kallithea.lib |
4116
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
16 ~~~~~~~~~~~~~ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
17 |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
18 RhodeCode libs |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
19 |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
20 :created_on: Oct 06, 2010 |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
21 :author: marcink |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
22 :copyright: (c) 2013 RhodeCode GmbH. |
4208
ad38f9f93b3b
Correct licensing information in individual files.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4187
diff
changeset
|
23 :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:
3960
diff
changeset
|
24 """ |
ffd45b185016
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
3960
diff
changeset
|
25 |
1541
70e646b2806a
fixes rhodecode upgrade problem that caused setuptool to crash on importing sqlalchemy models
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
26 import os |
70e646b2806a
fixes rhodecode upgrade problem that caused setuptool to crash on importing sqlalchemy models
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
27 |
1571
a9888895b60d
added quiet flag into get_current_revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1541
diff
changeset
|
28 def get_current_revision(quiet=False): |
1541
70e646b2806a
fixes rhodecode upgrade problem that caused setuptool to crash on importing sqlalchemy models
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
29 """ |
70e646b2806a
fixes rhodecode upgrade problem that caused setuptool to crash on importing sqlalchemy models
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
30 Returns tuple of (number, id) from repository containing this package |
70e646b2806a
fixes rhodecode upgrade problem that caused setuptool to crash on importing sqlalchemy models
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
31 or None if repository could not be found. |
1818
cf51bbfb120e
auto white-space removal
Marcin Kuzminski <marcin@python-works.com>
parents:
1713
diff
changeset
|
32 |
1571
a9888895b60d
added quiet flag into get_current_revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1541
diff
changeset
|
33 :param quiet: prints error for fetching revision if True |
1541
70e646b2806a
fixes rhodecode upgrade problem that caused setuptool to crash on importing sqlalchemy models
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
34 """ |
70e646b2806a
fixes rhodecode upgrade problem that caused setuptool to crash on importing sqlalchemy models
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
35 |
70e646b2806a
fixes rhodecode upgrade problem that caused setuptool to crash on importing sqlalchemy models
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
36 try: |
4186
7e5f8c12a3fc
First step in two-part process to rename directories to kallithea.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4116
diff
changeset
|
37 from kallithea.lib.vcs import get_repo |
7e5f8c12a3fc
First step in two-part process to rename directories to kallithea.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
4116
diff
changeset
|
38 from kallithea.lib.vcs.utils.helpers import get_scm |
3797
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3796
diff
changeset
|
39 repopath = os.path.abspath(os.path.join(os.path.dirname(__file__), |
d7488551578e
synced vcs with upstream
Marcin Kuzminski <marcin@python-works.com>
parents:
3796
diff
changeset
|
40 '..', '..')) |
1541
70e646b2806a
fixes rhodecode upgrade problem that caused setuptool to crash on importing sqlalchemy models
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
41 scm = get_scm(repopath)[0] |
70e646b2806a
fixes rhodecode upgrade problem that caused setuptool to crash on importing sqlalchemy models
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
42 repo = get_repo(path=repopath, alias=scm) |
3796
2b5f94fc3b7a
current revision will show workdir state, not the latest revision
Marcin Kuzminski <marcin@python-works.com>
parents:
3231
diff
changeset
|
43 wk_dir = repo.workdir |
2b5f94fc3b7a
current revision will show workdir state, not the latest revision
Marcin Kuzminski <marcin@python-works.com>
parents:
3231
diff
changeset
|
44 cur_rev = wk_dir.get_changeset() |
2b5f94fc3b7a
current revision will show workdir state, not the latest revision
Marcin Kuzminski <marcin@python-works.com>
parents:
3231
diff
changeset
|
45 return (cur_rev.revision, cur_rev.short_id) |
1578
67168195a676
Catch all exception on get_current_revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1571
diff
changeset
|
46 except Exception, err: |
1571
a9888895b60d
added quiet flag into get_current_revision
Marcin Kuzminski <marcin@python-works.com>
parents:
1541
diff
changeset
|
47 if not quiet: |
3231
b5a5a60608a7
be blunt about that error message to not confuse people
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
48 print ("WARNING: Cannot retrieve rhodecode's revision. " |
b5a5a60608a7
be blunt about that error message to not confuse people
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
49 "disregard this if you don't know what that means. " |
b5a5a60608a7
be blunt about that error message to not confuse people
Marcin Kuzminski <marcin@python-works.com>
parents:
2109
diff
changeset
|
50 "Original error was: %s" % err) |
1541
70e646b2806a
fixes rhodecode upgrade problem that caused setuptool to crash on importing sqlalchemy models
Marcin Kuzminski <marcin@python-works.com>
parents:
1514
diff
changeset
|
51 return None |