~osomon/phatch/extract-all-metadata

« back to all changes in this revision

Viewing changes to phatch/core/context.py

  • Committer: spe.stani.be at gmail
  • Date: 2010-03-11 16:02:11 UTC
  • mto: This revision was merged to the branch mainline in revision 1795.
  • Revision ID: spe.stani.be@gmail.com-20100311160211-4i54s0voyymzoi4s
implementing the context modules

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2007-2008 www.stani.be
 
2
#
 
3
# This program is free software: you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation, either version 3 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program.  If not, see http://www.gnu.org/licenses/
 
15
 
 
16
 
 
17
__all__ = ['CONTEXT']
 
18
 
 
19
 
 
20
import os
 
21
import sys
 
22
 
 
23
if __name__ == '__main__':
 
24
    sys.path.insert(0, '..')
 
25
 
 
26
from lib.context import get_context, join, join_create
 
27
 
 
28
 
 
29
CONTEXT = get_context(app_name='phatch', base_source='phatch',
 
30
    sys_prefix=sys.prefix)
 
31
 
 
32
CONTEXT['app_actionlists_path'] = join(CONTEXT['app_data_path'], 'actionlists')
 
33
CONTEXT['app_blender_path'] = join(CONTEXT['app_data_path'], 'blender')
 
34
CONTEXT['app_fonts_path'] = join(CONTEXT['app_data_path'], 'fonts')
 
35
 
 
36
# data/images
 
37
CONTEXT['app_highlights_path'] = join(CONTEXT['app_images_path'], 'highlights')
 
38
CONTEXT['app_masks_path'] = join(CONTEXT['app_images_path'], 'masks')
 
39
 
 
40
# data/gui
 
41
CONTEXT['app_gui_path'] = join(CONTEXT['app_data_path'], 'gui')
 
42
CONTEXT['app_preview_path'] = join(CONTEXT['app_gui_path'], 'preview')
 
43
CONTEXT['app_preview_perspective_path'] = join(CONTEXT['app_preview_path'],
 
44
    'perspective')
 
45
 
 
46
# actions
 
47
if CONTEXT['distribute'] == 'source':
 
48
    CONTEXT['app_actions_path'] = join(CONTEXT['app_source_path'], 'actions')
 
49
else:
 
50
    CONTEXT['app_actions_path'] = join(CONTEXT['app_data_path'], 'actions')
 
51
 
 
52
# user cache paths
 
53
CONTEXT['user_fonts_cache_path'] = join(CONTEXT['user_cache_path'],
 
54
    'fonts.cache')
 
55
CONTEXT['user_log_path'] = join(CONTEXT['user_cache_path'], 'log')
 
56
 
 
57
# user config paths
 
58
CONTEXT['user_settings_path'] = join(CONTEXT['user_config_path'],
 
59
    'settings.py')
 
60
 
 
61
# user data paths (warning they will be create if they don't exist)
 
62
CONTEXT['user_actions_path'] = join_create(CONTEXT['user_data_path'],
 
63
    'actions')
 
64
CONTEXT['user_actionlists_path'] = join_create(CONTEXT['user_data_path'],
 
65
    'actionlists')
 
66
CONTEXT['user_bin_path'] = join_create(CONTEXT['user_data_path'], 'bin')
 
67
CONTEXT['user_fonts_path'] = join_create(CONTEXT['user_data_path'], 'fonts')
 
68
CONTEXT['user_geek_path'] = join(CONTEXT['user_data_path'], 'geek.txt')
 
69
CONTEXT['user_highlights_path'] = join_create(CONTEXT['user_data_path'],
 
70
    'highlights')
 
71
CONTEXT['user_masks_path'] = join_create(CONTEXT['user_data_path'], 'masks')
 
72
CONTEXT['user_watermarks_path'] = join_create(CONTEXT['user_data_path'],
 
73
    'watermarks')
 
74
 
 
75
 
 
76
if __name__ == '__main__':
 
77
    import pprint
 
78
    pprint.pprint(CONTEXT)