1
# -*- coding: utf-8; -*-
3
Copyright (C) 2007-2009 Lincoln de Sousa <lincoln@minaslivre.org>
4
Copyright (C) 2007 Gabriel Falcão <gabrielteratos@gmail.com>
6
This program is free software; you can redistribute it and/or
7
modify it under the terms of the GNU General Public License as
8
published by the Free Software Foundation; either version 2 of the
9
License, or (at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
General Public License for more details.
16
You should have received a copy of the GNU General Public
17
License along with this program; if not, write to the
18
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
Boston, MA 02111-1307, USA.
23
'NAME', 'VERSION', 'IMAGE_DIR', 'GLADE_DIR', 'LOCALE_DIR',
24
'GCONF_PATH', 'KEY', 'TERMINAL_MATCH_EXPRS', 'TERMINAL_MATCH_TAGS',
25
'ALIGN_CENTER', 'ALIGN_RIGHT', 'ALIGN_LEFT',
30
IMAGE_DIR = '/usr/local/share/pixmaps/' + NAME
31
GLADE_DIR = '/usr/local/share/' + NAME
32
LOCALE_DIR = '/usr/local/share/locale'
34
# Gconf stuff. Yep, it is hardcoded =)
35
GCONF_PATH = '/apps/guake'
36
KEY = lambda x: (GCONF_PATH+x)
38
# regular expressions to highlight links in terminal. This code was
39
# lovely stolen from the great gnome-terminal project, thank you =)
40
USERCHARS = "-[:alnum:]"
41
PASSCHARS = "-[:alnum:],?;.:/!%$^*&~\"#'"
42
HOSTCHARS = "-[:alnum:]"
43
HOST = "[" + HOSTCHARS + "]+(\\.[" + HOSTCHARS + "]+)*"
44
PORT = "(:[:digit:]{1,5})?"
45
PATHCHARS = "-[:alnum:]_$.+!*(),;:@&=?/~#%"
46
SCHEME = "(news:|telnet:|nntp:|file:/|https?:|ftps?:|webcal:)"
47
USER = "[" + USERCHARS + "]+(:[" + PASSCHARS + "]+)?"
48
URLPATH = "/[" + PATHCHARS + "]*[^]'.}>) \t\r\n,\\\"]"
50
TERMINAL_MATCH_EXPRS = [
51
"\<" + SCHEME + "//(" + USER + "@)?" + HOST + PORT + "(" + URLPATH + ")?\>/?",
52
"\<(www|ftp)[" + HOSTCHARS + "]*\." + HOST + PORT + "(" +URLPATH + ")?\>/?",
53
"\<(mailto:)?[" + USERCHARS + "][" + USERCHARS + ".]*@[" + HOSTCHARS +
57
TERMINAL_MATCH_TAGS = 'schema', 'http', 'email'
58
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT = range(3)