Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar_network_server/env.py
blob: 20c50714eef900e7d6fad68981ba086b097e7797 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Copyright (C) 2012, Aleksey Lim
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

from gettext import gettext as _

import active_document as ad
util = ad.util


VERSION = '0.1'

CONTEXT_TYPES = ['application', 'library', 'activity', 'article']
SOLUTION_PARENTS = ['question', 'idea', 'problem']
NOTIFICATION_TYPES = ['create', 'update', 'delete', 'vote']
NOTIFICATION_OBJECT_TYPES = [
        '', 'content', 'question', 'idea', 'problem', 'review', 'solution',
        'artifact', 'version', 'report',
        ]
STABILITIES = [
        'insecure', 'buggy', 'developer', 'testing', 'stable',
        ]
ARTIFACT_TYPES = [
        'screenshot', 'jobject',
        ]


stats = util.Option(
        _('enable stats collecting'),
        default=True, type_cast=util.Option.bool_cast, action='store_true')

stats_root = util.Option(
        _('path to the root directory for placing stats'),
        default='/var/lib/sugar-network/stats')

stats_step = util.Option(
        _('step interval in seconds for RRD databases'),
        default=60, type_cast=int)

stats_server_rras = util.Option(
        _('space separated list of RRAs for RRD databases on a server side'),
        default='RRA:AVERAGE:0.5:1:4320 RRA:AVERAGE:0.5:5:2016',
        type_cast=lambda x: [i for i in x.split() if i],
        type_repr=lambda x: ' '.join(x))

stats_client_rras = util.Option(
        _('space separated list of RRAs for RRD databases on client side'),
        default='RRA:AVERAGE:0.5:1:4320 RRA:AVERAGE:0.5:5:2016',
        type_cast=lambda x: [i for i in x.split() if i],
        type_repr=lambda x: ' '.join(x))