~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to djangoratings/__init__.py

  • Committer: franku
  • Date: 2016-12-13 18:28:51 UTC
  • mto: This revision was merged to the branch mainline in revision 443.
  • Revision ID: somal@arcor.de-20161213182851-bo5ebf8pdvw5beua
run the script

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
__version__ = (0, 3, 7)
5
5
 
 
6
 
6
7
def _get_git_revision(path):
7
8
    revision_file = os.path.join(path, 'refs', 'heads', 'master')
8
9
    if not os.path.exists(revision_file):
13
14
    finally:
14
15
        fh.close()
15
16
 
 
17
 
16
18
def get_revision():
17
19
    """
18
20
    :returns: Revision number of this branch/checkout, if available. None if
27
29
 
28
30
__build__ = get_revision()
29
31
 
 
32
 
30
33
def lazy_object(location):
31
34
    def inner(*args, **kwargs):
32
35
        parts = location.rsplit('.', 1)
33
 
        warnings.warn('`djangoratings.%s` is deprecated. Please use `%s` instead.' % (parts[1], location), DeprecationWarning)
 
36
        warnings.warn('`djangoratings.%s` is deprecated. Please use `%s` instead.' % (
 
37
            parts[1], location), DeprecationWarning)
34
38
        try:
35
39
            imp = __import__(parts[0], globals(), locals(), [parts[1]], -1)
36
40
        except:
43
47
 
44
48
RatingField = lazy_object('djangoratings.fields.RatingField')
45
49
AnonymousRatingField = lazy_object('djangoratings.fields.AnonymousRatingField')
46
 
Rating = lazy_object('djangoratings.fields.Rating')
 
 
b'\\ No newline at end of file'
 
50
Rating = lazy_object('djangoratings.fields.Rating')