Source

gosvideo / conf.py


# This file is part of Gosvideo. 
# Gosvideo is a tool for ordering and downloading video files from http://www.gosuslugi.ru/.

# Copyright (C) 2012  Evstifeev Roman <someuniquename@gmail.com>

# Gosvideo 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.

# Gosvideo 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 Gosvideo.  If not, see <http://www.gnu.org/licenses/>.
# See file LICENSE.txt in the source code tree

import os, sys
from utils import safe_path

DEBUG = False

VERSION = '2.5'

PROJECT_SITE = 'http://bitbucket.org/fak3/gosvideo'

PROG_DIR = safe_path(os.path.dirname(__file__))

if sys.platform == 'win32' and PROG_DIR.endswith('.exe'):
    # this must be py2exe bundle, go one level up 
    PROG_DIR = os.path.dirname(PROG_DIR)
    
    # explicitly set certificates path for py2exe
    os.environ['REQUESTS_CA_BUNDLE'] = os.path.join(PROG_DIR, 'certs', 'cacert.pem')

rel = lambda *args: os.path.join(PROG_DIR, *args)


SHARED_DIR = safe_path(os.path.expanduser('~/gosvideo'))

if not os.path.exists(SHARED_DIR): 
    os.makedirs(SHARED_DIR)
    
srel = lambda *args: os.path.join(SHARED_DIR, *args)

try:
    from conf_local import *
except ImportError:
    pass