-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af88236
commit da31fdd
Showing
9 changed files
with
318 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
"""ClassLoader allows you to load modules from packages without | ||
hard-coding their class names in code; instead, they might be | ||
specified in a configuration file, as command-line parameters, | ||
or within an interface. | ||
Source: Robert Brewer at the Python Cookbook: | ||
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/223972 | ||
License: PSF license (http://docs.python.org/license.html). | ||
""" | ||
|
||
|
||
def get_mod(modulePath): | ||
"""Import a module.""" | ||
return __import__(modulePath, globals(), locals(), ['']) | ||
|
||
|
||
def get_func(fullFuncName): | ||
"""Retrieve a function object from a full dotted-package name.""" | ||
|
||
# Parse out the path, module, and function | ||
lastDot = fullFuncName.rfind(u".") | ||
funcName = fullFuncName[lastDot + 1:] | ||
modPath = fullFuncName[:lastDot] | ||
|
||
aMod = get_mod(modPath) | ||
aFunc = getattr(aMod, funcName) | ||
|
||
# Assert that the function is a *callable* attribute. | ||
assert callable(aFunc), u"%s is not callable." % fullFuncName | ||
|
||
# Return a reference to the function itself, | ||
# not the results of the function. | ||
return aFunc | ||
|
||
|
||
def get_class(fullClassName, parentClass=None): | ||
"""Load a module and retrieve a class (NOT an instance). | ||
If the parentClass is supplied, className must be of parentClass | ||
or a subclass of parentClass (or None is returned). | ||
""" | ||
aClass = get_func(fullClassName) | ||
|
||
# Assert that the class is a subclass of parentClass. | ||
if parentClass is not None: | ||
if not issubclass(aClass, parentClass): | ||
raise TypeError(u"%s is not a subclass of %s" % | ||
(fullClassName, parentClass)) | ||
|
||
# Return a reference to the class itself, not an instantiated object. | ||
return aClass | ||
"""ClassLoader allows you to load modules from packages without | ||
hard-coding their class names in code; instead, they might be | ||
specified in a configuration file, as command-line parameters, | ||
or within an interface. | ||
Source: Robert Brewer at the Python Cookbook: | ||
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/223972 | ||
License: PSF license (http://docs.python.org/license.html). | ||
""" | ||
|
||
|
||
def get_mod(modulePath): | ||
"""Import a module.""" | ||
return __import__(modulePath, globals(), locals(), ['']) | ||
|
||
|
||
def get_func(fullFuncName): | ||
"""Retrieve a function object from a full dotted-package name.""" | ||
|
||
# Parse out the path, module, and function | ||
lastDot = fullFuncName.rfind(u".") | ||
funcName = fullFuncName[lastDot + 1:] | ||
modPath = fullFuncName[:lastDot] | ||
|
||
aMod = get_mod(modPath) | ||
aFunc = getattr(aMod, funcName) | ||
|
||
# Assert that the function is a *callable* attribute. | ||
assert callable(aFunc), u"%s is not callable." % fullFuncName | ||
|
||
# Return a reference to the function itself, | ||
# not the results of the function. | ||
return aFunc | ||
|
||
|
||
def get_class(fullClassName, parentClass=None): | ||
"""Load a module and retrieve a class (NOT an instance). | ||
If the parentClass is supplied, className must be of parentClass | ||
or a subclass of parentClass (or None is returned). | ||
""" | ||
aClass = get_func(fullClassName) | ||
|
||
# Assert that the class is a subclass of parentClass. | ||
if parentClass is not None: | ||
if not issubclass(aClass, parentClass): | ||
raise TypeError(u"%s is not a subclass of %s" % | ||
(fullClassName, parentClass)) | ||
|
||
# Return a reference to the class itself, not an instantiated object. | ||
return aClass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
#! /usr/bin/env python | ||
""" | ||
Setup script to build a standalone apdumanager.exe executable on windows | ||
using py2exe. Run: python.exe setup.py py2exe, to build executable file. | ||
__author__ = "http://www.gemalto.com" | ||
Copyright 2001-2012 gemalto | ||
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com | ||
This file is part of pyscard. | ||
pyscard is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published by | ||
the Free Software Foundation; either version 2.1 of the License, or | ||
(at your option) any later version. | ||
pyscard 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 Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with pyscard; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
""" | ||
|
||
from distutils.core import setup | ||
import py2exe | ||
|
||
from smartcard.wx import ICO_SMARTCARD, ICO_READER | ||
|
||
Mydata_files = [('images', | ||
['images/mysmartcard.ico', | ||
ICO_SMARTCARD, ICO_READER])] | ||
|
||
|
||
setup(windows=['apdumanager.py'], | ||
data_files=Mydata_files, | ||
options={"py2exe": {"dll_excludes": ["MSVCP90.dll"]}} | ||
) | ||
#! /usr/bin/env python | ||
""" | ||
Setup script to build a standalone apdumanager.exe executable on windows | ||
using py2exe. Run: python.exe setup.py py2exe, to build executable file. | ||
__author__ = "http://www.gemalto.com" | ||
Copyright 2001-2012 gemalto | ||
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com | ||
This file is part of pyscard. | ||
pyscard is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published by | ||
the Free Software Foundation; either version 2.1 of the License, or | ||
(at your option) any later version. | ||
pyscard 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 Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with pyscard; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
""" | ||
|
||
from distutils.core import setup | ||
import py2exe | ||
|
||
from smartcard.wx import ICO_SMARTCARD, ICO_READER | ||
|
||
Mydata_files = [('images', | ||
['images/mysmartcard.ico', | ||
ICO_SMARTCARD, ICO_READER])] | ||
|
||
|
||
setup(windows=['apdumanager.py'], | ||
data_files=Mydata_files, | ||
options={"py2exe": {"dll_excludes": ["MSVCP90.dll"]}} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
#! /usr/bin/env python | ||
""" | ||
Setup script to build a standalone cardmonitor.exe executable on windows | ||
using py2exe. Run: python.exe setup.py py2exe, to build executable file. | ||
__author__ = "http://www.gemalto.com" | ||
Copyright 2001-2012 gemalto | ||
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com | ||
This file is part of pyscard. | ||
pyscard is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published by | ||
the Free Software Foundation; either version 2.1 of the License, or | ||
(at your option) any later version. | ||
pyscard 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 Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with pyscard; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
""" | ||
|
||
from distutils.core import setup | ||
import py2exe | ||
|
||
from smartcard.wx import ICO_SMARTCARD, ICO_READER | ||
|
||
Mydata_files = [('images', | ||
['images/mysmartcard.ico', | ||
ICO_SMARTCARD, ICO_READER])] | ||
|
||
setup(windows=['cardmonitor.py'], | ||
data_files=Mydata_files, | ||
options={"py2exe": {"dll_excludes": ["MSVCP90.dll"]}} | ||
) | ||
#! /usr/bin/env python | ||
""" | ||
Setup script to build a standalone cardmonitor.exe executable on windows | ||
using py2exe. Run: python.exe setup.py py2exe, to build executable file. | ||
__author__ = "http://www.gemalto.com" | ||
Copyright 2001-2012 gemalto | ||
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com | ||
This file is part of pyscard. | ||
pyscard is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published by | ||
the Free Software Foundation; either version 2.1 of the License, or | ||
(at your option) any later version. | ||
pyscard 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 Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with pyscard; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
""" | ||
|
||
from distutils.core import setup | ||
import py2exe | ||
|
||
from smartcard.wx import ICO_SMARTCARD, ICO_READER | ||
|
||
Mydata_files = [('images', | ||
['images/mysmartcard.ico', | ||
ICO_SMARTCARD, ICO_READER])] | ||
|
||
setup(windows=['cardmonitor.py'], | ||
data_files=Mydata_files, | ||
options={"py2exe": {"dll_excludes": ["MSVCP90.dll"]}} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
#! /usr/bin/env python | ||
""" | ||
Setup script to build a standalone readerviewer.exe executable on windows | ||
using py2exe. Run: python.exe setup.py py2exe, to build executable file. | ||
__author__ = "http://www.gemalto.com" | ||
Copyright 2001-2012 gemalto | ||
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com | ||
This file is part of pyscard. | ||
pyscard is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published by | ||
the Free Software Foundation; either version 2.1 of the License, or | ||
(at your option) any later version. | ||
pyscard 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 Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with pyscard; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
""" | ||
|
||
from distutils.core import setup | ||
import py2exe | ||
|
||
from smartcard.wx import ICO_SMARTCARD, ICO_READER | ||
|
||
Mydata_files = [('images', | ||
['images/readerviewer.ico', | ||
ICO_SMARTCARD, ICO_READER])] | ||
|
||
|
||
setup(windows=['readerviewer.py'], | ||
data_files=Mydata_files, | ||
options={"py2exe": {"dll_excludes": ["MSVCP90.dll"]}} | ||
) | ||
#! /usr/bin/env python | ||
""" | ||
Setup script to build a standalone readerviewer.exe executable on windows | ||
using py2exe. Run: python.exe setup.py py2exe, to build executable file. | ||
__author__ = "http://www.gemalto.com" | ||
Copyright 2001-2012 gemalto | ||
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com | ||
This file is part of pyscard. | ||
pyscard is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published by | ||
the Free Software Foundation; either version 2.1 of the License, or | ||
(at your option) any later version. | ||
pyscard 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 Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with pyscard; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
""" | ||
|
||
from distutils.core import setup | ||
import py2exe | ||
|
||
from smartcard.wx import ICO_SMARTCARD, ICO_READER | ||
|
||
Mydata_files = [('images', | ||
['images/readerviewer.ico', | ||
ICO_SMARTCARD, ICO_READER])] | ||
|
||
|
||
setup(windows=['readerviewer.py'], | ||
data_files=Mydata_files, | ||
options={"py2exe": {"dll_excludes": ["MSVCP90.dll"]}} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
"""pyro (remote python) utility module. | ||
__author__ = "http://www.gemalto.com" | ||
Copyright 2011 gemalto | ||
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com | ||
This file is part of pyscard. | ||
pyscard is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published by | ||
the Free Software Foundation; either version 2.1 of the License, or | ||
(at your option) any later version. | ||
pyscard 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 Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with pyscard; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
""" | ||
"""pyro (remote python) utility module. | ||
__author__ = "http://www.gemalto.com" | ||
Copyright 2011 gemalto | ||
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com | ||
This file is part of pyscard. | ||
pyscard is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published by | ||
the Free Software Foundation; either version 2.1 of the License, or | ||
(at your option) any later version. | ||
pyscard 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 Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with pyscard; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
""" |
Oops, something went wrong.