1 # -*- coding: UTF-8 -*-
2 # vim: expandtab sw=4 ts=4 sts=4:
5 Data path definition and misc path functions
7 __author__
= 'Michal Čihař'
8 __email__
= 'michal@cihar.com'
10 Copyright © 2003 - 2008 Michal Čihař
12 This program is free software; you can redistribute it and/or modify it
13 under the terms of the GNU General Public License version 2 as published by
14 the Free Software Foundation.
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
21 You should have received a copy of the GNU General Public License along with
22 this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 DATAPATH
= os
.path
.join(os
.path
.dirname(__file__
), '..')
31 if not os
.path
.exists(os
.path
.join(DATAPATH
, 'images')):
32 DATAPATH
= os
.path
.join(sys
.exec_prefix
, 'share', 'Wammu')
33 if not os
.path
.exists(os
.path
.join(DATAPATH
, 'images')):
34 print 'Could not find images, you will not see them, check your installation!'
36 def AppIconPath(*args
):
37 if sys
.platform
== 'win32':
41 p
= os
.path
.join(*args
) + os
.extsep
+ ext
42 if os
.path
.exists(os
.path
.join(sys
.exec_prefix
, 'share', 'pixmaps', p
)):
43 return os
.path
.join(sys
.exec_prefix
, 'share', 'pixmaps', p
)
45 return os
.path
.join('.', 'icon', p
)
48 return ImagePath('icons', *args
)
51 return ImagePath('misc', *args
)
54 return os
.path
.join(DATAPATH
, 'images', *args
) + os
.extsep
+ 'png'