aboutsummaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorhploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b>2007-05-08 09:23:25 +0000
committerhploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b>2007-05-08 09:23:25 +0000
commit47662ab48e7a8e385ec833e360255f5b4ee4c617 (patch)
treefb7662c2da9e549c7b8dfaeb97402c8a33368269 /utils.py
parenta94d4d8a32ab3588b3590c9a000bfa0399b36618 (diff)
Get working under Windows with http://cheeseshop.python.org/pypi/PyCSC/0.3 (with Python 2.5 for Windows)
Note: you additionally need pycrypto, the source of which you'll get from http://cheeseshop.python.org/pypi/pycrypto/2.0.1 Compilation of pycrypto can work with cygwin in two steps: python setup.py build -c mingw32 and python setup.py install --skip-build git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@190 f711b948-2313-0410-aaa9-d29f33439f0b
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/utils.py b/utils.py
index 57981fc..42bcd4f 100644
--- a/utils.py
+++ b/utils.py
@@ -1,4 +1,14 @@
-import pycsc, string, binascii, sys, re
+try:
+ import pycsc
+except ImportError,e:
+ try:
+ import PyCSC
+ from PyCSC import pycsc # Windows
+ pycsc.SCARD_PROTOCOL_ANY = PyCSC.SCARD_PROTOCOL_ANY
+ except ImportError:
+ raise e # raise the original exception, masking the windows-only attempt
+
+import string, binascii, sys, re
def represent_binary_fancy(len, value, mask = 0):
result = []