1 """wxpython smartcard utility module.
2
3 __author__ = "http://www.gemalto.com"
4
5 Copyright 2001-2012 gemalto
6 Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com
7
8 This file is part of pyscard.
9
10 pyscard is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 pyscard is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with pyscard; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 """
24
25 import imp
26 import os.path
27 import sys
28
29
31 return(hasattr(sys, "frozen") or \
32 hasattr(sys, "importers") or \
33 imp.is_frozen("__main__"))
34
35
36 ICO_SMARTCARD = None
37 ICO_READER = None
38
39
40 if not main_is_frozen():
41 ICO_SMARTCARD = os.path.join(
42 os.path.dirname(__file__),
43 'resources',
44 'smartcard.ico')
45 ICO_READER = os.path.join(
46 os.path.dirname(__file__),
47 'resources',
48 'reader.ico')
49
50
51
52 else:
53 if os.path.exists(os.path.join("images", 'smartcard.ico')):
54 ICO_SMARTCARD = os.path.join("images", 'smartcard.ico')
55 if os.path.exists(os.path.join("images", 'reader.ico')):
56 ICO_READER = os.path.join("images", 'reader.ico')
57