aboutsummaryrefslogtreecommitdiff
blob: a39071fe9f6cbc674da5266211319a6e12ea4dd9 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/python
# -*- coding: utf-8 -*-
#################################################################################
# LAYMAN CONSTANTS
#################################################################################
# File:       constants.py
#
#             Handles layman actions via the command line interface.
#
# Copyright:
#             (c) 2010 - 2011
#                   Gunnar Wrobel
#                   Brian Dolbec
#             Distributed under the terms of the GNU General Public License v2
#
# Author(s):
#             Gunnar Wrobel <wrobel@gentoo.org>
#             Brian Dolbec <brian.dolbec@gmail.com
#
''' Provides the command line actions that can be performed by layman.'''

from __future__ import unicode_literals

__version__ = "$Id: constants.py 2011-01-16 23:52 PST Brian Dolbec$"




#################################################################################
##
## Color codes (taken from portage)
##
#################################################################################

esc_seq = '\x1b['

codes = {}
codes['reset']     = esc_seq + '39;49;00m'
codes['red']       = esc_seq + '31;01m'
codes['green']     = esc_seq + '32;01m'
codes['yellow']    = esc_seq + '33;01m'
codes['turquoise'] = esc_seq + '36;01m'


NOT_OFFICIAL_MSG = '*** This is not an official gentoo overlay ***\n'
NOT_SUPPORTED_MSG = '*** You are lacking the necessary tools' +\
    ' to install this overlay ***\n'


OFF = 0
WARN_LEVEL = 4
INFO_LEVEL = 4
NOTE_LEVEL = 4
DEBUG_LEVEL = 4
DEBUG_VERBOSITY = 2

FAILURE = 1
SUCCEED = 0

#################################################################################
##
## Overlay components
##
#################################################################################

COMPONENT_DEFAULTS  = ['name', 'description', 'owner', 'type', 'source']
POSSIBLE_COMPONENTS = ['name', 'description', 'homepage', 'owner', 'quality',
                       'priority', 'source', 'branch', 'irc', 'feed']

###############################################################################
##
## Archive overlay possible file extensions
##
###############################################################################

FILE_EXTENSIONS = {'Squashfs': ('.squashfs', '.squash', '.sqfs', '.sfs'),
                   'Tar': ('bz2', 'gz', 'lzma', 'xz', 'Z', 'tgz', 'tbz', 'taz',
                           'tlz', 'txz'),
                  }

###################################################################################
##
## Overlay types mountable by script
##
####################################################################################

MOUNT_TYPES = ['Squashfs']