Subversion Repositories basico

Rev

Rev 353 | Rev 365 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
340 t00mlabs 1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3
"""
4
# File: mod_env.py
5
# Author: Tomás Vírseda
6
# License: GPL v3
7
# Description: Environment variables module
8
"""
9
 
10
import sys
11
import os
12
from os.path import abspath, sep as SEP
13
 
14
ROOT = abspath(sys.modules[__name__].__file__ + "/../../")
15
USER_DIR = os.path.expanduser('~')
16
 
17
# App Info
18
APP = {}
19
APP['short'] = "basico"
20
APP['name'] = "SAP Notes Manager for SAP Consultants"
21
APP['license'] = "The code is licensed under the terms of the  GPL v3\nso you're free to grab, extend, improve and fork the code\nas you want"
22
APP['copyright'] = "Copyright \xa9 2016-2019 Tomás Vírseda"
23
APP['desc'] = "SAP Notes Manager for SAP Consultants\n\nThe code is licensed under the terms of the  GPL v3 so you're free to grab, extend, improve and fork the code as you want"
342 t00mlabs 24
APP['version'] = "0.4"
340 t00mlabs 25
APP['authors'] = ["Tomás Vírseda <tomasvirseda@gmail.com>"]
26
APP['documenters'] = ["Tomás Vírseda <tomasvirseda@gmail.com>"]
27
APP['email'] = "t00m@t00mlabs.net"
28
 
29
 
30
# Local paths
31
LPATH = {}
32
LPATH['ROOT'] = USER_DIR + SEP + '.basico' + SEP
33
LPATH['ETC'] = LPATH['ROOT'] + 'etc' + SEP
34
LPATH['VAR'] = LPATH['ROOT'] + 'var' + SEP
35
LPATH['PLUGINS'] = LPATH['VAR'] + 'plugins' + SEP
36
LPATH['LOG'] = LPATH['VAR'] + 'log' + SEP
37
LPATH['TMP'] = LPATH['VAR'] + 'tmp' + SEP
38
LPATH['CACHE'] = LPATH['VAR'] + 'cache' + SEP
39
LPATH['CACHE_XML'] = LPATH['CACHE'] + 'xml' + SEP
40
LPATH['CACHE_PDF'] = LPATH['CACHE'] + 'pdf' + SEP
41
LPATH['DB'] = LPATH['VAR'] + 'db' + SEP
42
LPATH['SAPNOTES'] = LPATH['DB'] + 'sapnotes' + SEP
43
LPATH['ANNOTATIONS'] = LPATH['DB'] + 'annotations' + SEP
44
LPATH['COLLECTIONS'] = LPATH['DB'] + 'collections' + SEP
45
LPATH['RESOURCES'] = LPATH['DB'] + 'resources' + SEP
353 t00mlabs 46
LPATH['ATTACHMENTS'] = LPATH['DB'] + 'attachments' + SEP
340 t00mlabs 47
LPATH['WWW'] = LPATH['VAR'] + 'www' + SEP
48
LPATH['EXPORT'] = LPATH['VAR'] + 'export' + SEP
49
LPATH['BACKUP'] = LPATH['EXPORT'] + 'backup' + SEP
50
LPATH['PDF'] = LPATH['EXPORT'] + 'pdf' + SEP
51
LPATH['OPT'] = LPATH['ROOT'] + 'opt' + SEP
52
LPATH['DRIVERS'] = LPATH['OPT'] + 'webdrivers' + SEP
53
 
54
 
55
# Global paths
56
GPATH = {}
57
GPATH['ROOT'] = ROOT
58
GPATH['DATA'] = GPATH['ROOT'] + SEP  + 'data' + SEP
59
GPATH['UI'] = GPATH['DATA'] + 'ui' + SEP
60
GPATH['ICONS'] = GPATH['DATA'] + 'icons' + SEP
61
GPATH['PLUGINS'] = GPATH['DATA'] + 'plugins' + SEP
62
GPATH['SHARE'] = GPATH['DATA'] + 'share' + SEP
63
GPATH['DOC'] = GPATH['SHARE'] + 'docs' + SEP
64
GPATH['RES'] = GPATH['DATA'] + 'res' + SEP
348 t00mlabs 65
GPATH['CSS'] = GPATH['RES'] + 'css' + SEP
340 t00mlabs 66
GPATH['SELENIUM'] = GPATH['RES'] + 'selenium' + SEP
67
GPATH['DRIVERS'] = GPATH['SELENIUM'] + 'drivers' + SEP
68
GPATH['HELP'] = GPATH['DATA'] + 'help' + SEP
69
GPATH['HELP_HTML'] = GPATH['HELP'] + 'html' + SEP
70
 
71
# Configuration, SAP Notes Database and Log files
72
FILE = {}
348 t00mlabs 73
FILE['CSS'] = GPATH['CSS'] + 'basico.css'
355 t00mlabs 74
FILE['EXT'] = GPATH['RES'] + 'extensions.json'
340 t00mlabs 75
FILE['DBSAP'] = LPATH['SAPNOTES'] + 'sapnotes.json'
76
FILE['DBCOLS'] = LPATH['COLLECTIONS'] + 'collections.json'
77
FILE['CNF'] = LPATH['ETC'] + 'basico.ini'
78
FILE['LOG'] = LPATH['LOG'] + 'basico.log'
79
FILE['EVENTS'] = LPATH['LOG'] + 'events.log'
80
FILE['CREDITS'] = GPATH['DOC'] + 'CREDITS'
81
FILE['HELP_INDEX'] = GPATH['HELP_HTML'] + 'index.html'
82
 
83
# Annotations
84
ATYPES = ['Bookmark', 'Email', 'Fixme', 'Incident', 'Meeting', 'Note', 'Procedure', 'Snippet', 'Template', 'Todo']